firefox: unbreak build; merge patches from Alpine for musl.

... and still the musl build is incomplete.
This commit is contained in:
Juan RP 2015-06-11 18:59:32 +02:00
parent a81139e4f2
commit 02107ebc71
11 changed files with 422 additions and 9 deletions

View file

@ -0,0 +1,17 @@
--- xpcom/ds/nsMathUtils.h.orig
+++ xpcom/ds/nsMathUtils.h
@@ -104,12 +104,12 @@
#ifdef WIN32
// NOTE: '!!' casts an int to bool without spamming MSVC warning C4800.
return !!_finite(aNum);
-#elif defined(XP_DARWIN)
+#elif defined(XP_DARWIN) || defined(_GLIBCXX_CMATH)
// Darwin has deprecated |finite| and recommends |isfinite|. The former is
// not present in the iOS SDK.
return std::isfinite(aNum);
#else
- return finite(aNum);
+ return isfinite(aNum);
#endif
}

View file

@ -0,0 +1,11 @@
--- media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h
+++ media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h
@@ -27,8 +27,5 @@
typedef int16_t int16;
typedef unsigned short ushort;
typedef unsigned long ulong;
-#ifndef __GNUC_STDC_INLINE__
-#define inline
-#endif
#endif /* _SDP_OS_DEFS_H_ */

View file

@ -0,0 +1,26 @@
--- configure.orig 2015-05-29 18:30:41.474423097 +0200
+++ configure 2015-05-29 18:30:53.451550589 +0200
@@ -10966,8 +10966,8 @@ ac_have_llvm_pr8927="no"
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_compile='${CC-cc} -c conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
--- js/src/configure.orig 2015-05-29 18:31:25.049874012 +0200
+++ js/src/configure 2015-05-29 18:31:36.898995291 +0200
@@ -9820,8 +9820,8 @@ ac_have_llvm_pr8927="no"
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_compile='${CC-cc} -c conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

View file

@ -0,0 +1,55 @@
--- ipc/chromium/src/base/file_util.h
+++ ipc/chromium/src/base/file_util.h
@@ -14,10 +14,15 @@
#include <windows.h>
#elif defined(ANDROID)
#include <sys/stat.h>
+#define NO_FTS
#elif defined(OS_POSIX)
#include <sys/types.h>
-#include <fts.h>
#include <sys/stat.h>
+#ifdef __GLIBC__
+#include <fts.h>
+#else
+#define NO_FTS
+#endif
#endif
#include <stdio.h>
--- ipc/chromium/src/base/file_util_posix.cc
+++ ipc/chromium/src/base/file_util_posix.cc
@@ -8,13 +8,13 @@
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
-#ifndef ANDROID
+#ifndef NO_FTS
#include <fts.h>
#endif
#include <libgen.h>
#include <stdio.h>
#include <string.h>
-#include <sys/errno.h>
+#include <errno.h>
#include <sys/mman.h>
#define _DARWIN_USE_64_BIT_INODE // Use 64-bit inode data structures
#include <sys/stat.h>
@@ -67,7 +67,7 @@
if (!recursive)
return (rmdir(path_str) == 0);
-#ifdef ANDROID
+#ifdef NO_FTS
// XXX Need ftsless impl for bionic
return false;
#else
@@ -140,7 +140,7 @@
return false;
}
-#ifdef ANDROID
+#ifdef NO_FTS
// XXX Need ftsless impl for bionic
return false;
#else

View file

@ -0,0 +1,10 @@
--- xpcom/io/nsLocalFileUnix.cpp.orig
+++ xpcom/io/nsLocalFileUnix.cpp
@@ -28,6 +28,7 @@
#define USE_LINUX_QUOTACTL
#include <sys/mount.h>
#include <sys/quota.h>
+#include <linux/fs.h>
#endif
#include "xpcom-private.h"

View file

@ -0,0 +1,10 @@
--- media.orig/mtransport/third_party/nICEr/src/stun/addrs.c
+++ media/mtransport/third_party/nICEr/src/stun/addrs.c
@@ -45,7 +45,6 @@
#include <sys/param.h>
#include <sys/socket.h>
#ifndef ANDROID
-#include <sys/sysctl.h>
#include <sys/syslog.h>
#else
#include <syslog.h>

View file

@ -0,0 +1,37 @@
--- netwerk.orig/sctp/src/netinet/sctp_os_userspace.h
+++ netwerk/sctp/src/netinet/sctp_os_userspace.h
@@ -400,11 +400,8 @@
};
#else /* !defined(Userspace_os_Windows) */
-#include <sys/cdefs.h> /* needed? added from old __FreeBSD__ */
#include <sys/socket.h>
-#if defined(__Userspace_os_DragonFly) || defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_Linux) || defined(__Userspace_os_NetBSD) || defined(__Userspace_os_OpenBSD) || defined(ANDROID)
#include <pthread.h>
-#endif
typedef pthread_mutex_t userland_mutex_t;
typedef pthread_cond_t userland_cond_t;
typedef pthread_t userland_thread_t;
--- netwerk.orig/sctp/src/netinet/sctp_pcb.c
+++ netwerk/sctp/src/netinet/sctp_pcb.c
@@ -30,6 +30,9 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define _BSD_SOURCE /* for IPPORT_RESERVED */
+#include <netdb.h>
+
#ifdef __FreeBSD__
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 258765 2013-11-30 12:51:19Z tuexen $");
--- netwerk.orig/sctp/src/user_queue.h
+++ netwerk/sctp/src/user_queue.h
@@ -31,7 +31,7 @@
#ifndef _USER_QUEUE_H_
#define _USER_QUEUE_H_
-#if !defined (__Userspace_os_Windows)
+#if defined(__Userspace_os_FreeBSD)
#include <sys/cdefs.h>
#endif
/*

View file

@ -0,0 +1,144 @@
--- toolkit.orig/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc 2014-03-15 05:19:36.000000000 +0000
+++ toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc 2014-04-17 10:24:33.793431933 +0000
@@ -45,6 +45,7 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <libgen.h>
#include <iostream>
#include <set>
--- toolkit.orig/crashreporter/google-breakpad/src/common/stabs_reader.cc 2014-03-15 05:19:36.000000000 +0000
+++ toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc 2014-04-17 10:24:33.793431933 +0000
@@ -41,6 +41,10 @@
#include "common/using_std_string.h"
+#ifndef N_UNDF
+#define N_UNDF 0
+#endif
+
using std::vector;
namespace google_breakpad {
--- toolkit.orig/crashreporter/google-breakpad/src/common/stabs_reader.h 2014-03-15 05:19:36.000000000 +0000
+++ toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h 2014-04-17 10:24:33.793431933 +0000
@@ -53,9 +53,10 @@
#include <config.h>
#endif
-#ifdef HAVE_A_OUT_H
+#if 0
#include <a.out.h>
#endif
+
#ifdef HAVE_MACH_O_NLIST_H
#include <mach-o/nlist.h>
#endif
--- toolkit.orig/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2014-03-15 05:19:37.000000000 +0000
+++ toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2014-04-17 10:24:33.793431933 +0000
@@ -2813,7 +2813,7 @@
LSS_INLINE _syscall6(void*, mmap, void*, s,
size_t, l, int, p,
int, f, int, d,
- __off64_t, o)
+ off_t, o)
LSS_INLINE _syscall4(int, newfstatat, int, d,
const char *, p,
--- toolkit.orig/mozapps/update/common/updatedefines.h 2014-03-15 05:19:37.000000000 +0000
+++ toolkit/mozapps/update/common/updatedefines.h 2014-04-17 10:24:33.793431933 +0000
@@ -105,7 +105,7 @@
#ifdef SOLARIS
# include <sys/stat.h>
-#else
+#elif !defined(__linux__) || defined(__GLIBC__)
# include <fts.h>
#endif
# include <dirent.h>
--- toolkit.orig/mozapps/update/updater/updater.cpp 2014-03-15 05:19:37.000000000 +0000
+++ toolkit/mozapps/update/updater/updater.cpp 2014-04-17 10:24:33.796765327 +0000
@@ -3432,6 +3432,7 @@
int add_dir_entries(const NS_tchar *dirpath, ActionList *list)
{
int rv = OK;
+#if !defined(__linux__) || defined(__GLIBC__)
FTS *ftsdir;
FTSENT *ftsdirEntry;
NS_tchar searchpath[MAXPATHLEN];
@@ -3534,6 +3535,7 @@
}
fts_close(ftsdir);
+#endif
return rv;
}
--- toolkit.orig/xre/nsSigHandlers.cpp 2014-03-15 05:19:38.000000000 +0000
+++ toolkit/xre/nsSigHandlers.cpp 2014-04-17 10:24:33.796765327 +0000
@@ -15,6 +15,7 @@
#include <signal.h>
#include <stdio.h>
#include <string.h>
+#include <sys/types.h>
#include "prthread.h"
#include "plstr.h"
#include "prenv.h"
@@ -152,7 +153,7 @@
status->__invalid = status->__denorm = status->__zdiv = status->__ovrfl = status->__undfl =
status->__precis = status->__stkflt = status->__errsumm = 0;
- __uint32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr;
+ u_int32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr;
*mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
*mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
#endif
@@ -172,13 +173,13 @@
*sw &= ~FPU_STATUS_FLAGS;
#endif
#if defined(__amd64__)
- __uint16_t *cw = &uc->uc_mcontext.fpregs->cwd;
+ u_int16_t *cw = &uc->uc_mcontext.fpregs->cwd;
*cw |= FPU_EXCEPTION_MASK;
- __uint16_t *sw = &uc->uc_mcontext.fpregs->swd;
+ u_int16_t *sw = &uc->uc_mcontext.fpregs->swd;
*sw &= ~FPU_STATUS_FLAGS;
- __uint32_t *mxcsr = &uc->uc_mcontext.fpregs->mxcsr;
+ u_int32_t *mxcsr = &uc->uc_mcontext.fpregs->mxcsr;
*mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
*mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
#endif
@@ -187,24 +188,24 @@
ucontext_t *uc = (ucontext_t *)context;
#if defined(__i386)
- uint32_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0];
+ u_int32_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0];
*cw |= FPU_EXCEPTION_MASK;
- uint32_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1];
+ u_int32_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1];
*sw &= ~FPU_STATUS_FLAGS;
/* address of the instruction that caused the exception */
- uint32_t *ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3];
+ u_int32_t *ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3];
uc->uc_mcontext.gregs[REG_PC] = *ip;
#endif
#if defined(__amd64__)
- uint16_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw;
+ u_int16_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw;
*cw |= FPU_EXCEPTION_MASK;
- uint16_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw;
+ u_int16_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw;
*sw &= ~FPU_STATUS_FLAGS;
- uint32_t *mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr;
+ u_int32_t *mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr;
*mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
*mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
#endif

View file

@ -0,0 +1,65 @@
--- tools/profiler/local_debug_info_symbolizer.cc
+++ tools/profiler/local_debug_info_symbolizer.cc
@@ -3,6 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include <sys/types.h>
#include "PlatformMacros.h"
#include "nsAutoPtr.h"
--- tools/profiler/platform-linux.cc
+++ tools/profiler/platform-linux.cc
@@ -84,7 +84,7 @@
#define SIGNAL_SAVE_PROFILE SIGUSR2
-#if defined(__GLIBC__)
+#if 1
// glibc doesn't implement gettid(2).
#include <sys/syscall.h>
pid_t gettid()
--- tools/profiler/platform.h
+++ tools/profiler/platform.h
@@ -29,6 +29,8 @@
#ifndef TOOLS_PLATFORM_H_
#define TOOLS_PLATFORM_H_
+#include <sys/types.h>
+
#ifdef ANDROID
#include <android/log.h>
#else
--- tools/profiler/LulElf.cpp
+++ tools/profiler/LulElf.cpp
@@ -579,10 +579,10 @@
// Return the non-directory portion of FILENAME: the portion after the
// last slash, or the whole filename if there are no slashes.
string BaseFileName(const string &filename) {
- // Lots of copies! basename's behavior is less than ideal.
- char *c_filename = strdup(filename.c_str());
- string base = basename(c_filename);
- free(c_filename);
+ // basename's behavior is less than ideal so avoid it
+ const char *c_filename = filename.c_str();
+ const char *p = strrchr(c_filename, '/');
+ string base = p ? p+1 : c_filename;
return base;
}
--- tools/profiler/platform-linux.cc.orig 2015-06-11 18:39:35.689739054 +0200
+++ tools/profiler/platform-linux.cc 2015-06-11 18:40:04.479706749 +0200
@@ -651,11 +651,13 @@ void OS::Startup() {
void TickSample::PopulateContext(void* aContext)
{
MOZ_ASSERT(aContext);
+#if defined(__GLIBC__)
ucontext_t* pContext = reinterpret_cast<ucontext_t*>(aContext);
if (!getcontext(pContext)) {
context = pContext;
SetSampleContext(this, aContext);
}
+#endif
}
void OS::SleepMicro(int microseconds)

View file

@ -0,0 +1,25 @@
--- dom/system/OSFileConstants.cpp.orig 2013-04-17 06:17:29.798371189 +0000
+++ dom/system/OSFileConstants.cpp 2013-04-17 06:30:30.032285977 +0000
@@ -509,6 +509,11 @@
INT_CONSTANT(_STAT_VER),
#endif // defined(_STAT_VER)
+ // glibc's stat/lstat/fstat are macros while uclibc's are not
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
+ { "OSFILE_STAT_MACROS", INT_TO_JSVAL(1) },
+#endif // defined(stat)
+
PROP_END
};
--- toolkit/components/osfile/modules/osfile_unix_back.jsm.orig 2014-04-03 13:08:26.686409787 +0000
+++ toolkit/components/osfile/modules/osfile_unix_back.jsm 2014-04-03 13:34:14.101716259 +0000
@@ -512,7 +512,7 @@
/*path*/ Type.fd,
/*buf*/ Type.stat.out_ptr
);
- } else if (Const._STAT_VER != undefined) {
+ } else if (Const.OSFILE_STAT_MACROS != undefined) {
const ver = Const._STAT_VER;
let xstat_name, lxstat_name, fxstat_name;
if (OS.Constants.Sys.Name == "SunOS") {

View file

@ -25,6 +25,16 @@ depends="nss>=3.17 desktop-file-utils hicolor-icon-theme"
LDFLAGS="-lXt"
pre_configure() {
case "$XBPS_TARGET_MACHINE" in
*-musl)
$XBPS_FETCH_CMD http://git.alpinelinux.org/cgit/aports/plain/main/firefox/stab.h
mv stab.h toolkit/crashreporter/google-breakpad/src/
;;
esac
# configure script misdetects the preprocessor without an optimization level
sed -i '/ac_cpp=/s/$CPPFLAGS/& -O2/' configure
# Google API key (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: This is for Void Linux use ONLY.
_google_api_key="AIzaSyCIFdBA7eQP43R6kXRwTq7j6Mvj1ITze90"
@ -39,30 +49,33 @@ do_configure() {
export CXXFLAGS+=" -I${XBPS_CROSS_BASE}/usr/include/nspr -I${XBPS_CROSS_BASE}/usr/include/nss"
cross_args+=" --target=$XBPS_CROSS_TRIPLET"
export ac_cv_sqlite_secure_delete=yes
export ac_cv_sqlite_threadsafe=yes
export ac_cv_sqlite_enable_fts3=yes
export ac_cv_sqlite_enable_unlock_notify=yes
export ac_cv_prog_hostcxx_works=1
fi
export ac_cv_sqlite_secure_delete=yes
export ac_cv_sqlite_threadsafe=yes
export ac_cv_sqlite_enable_fts3=yes
export ac_cv_sqlite_enable_unlock_notify=yes
export ac_cv_prog_hostcxx_works=1
cd xbps-build
SHELL=/bin/bash ../configure --prefix=/usr --libdir=/usr/lib \
--with-system-nspr --with-system-nss --with-system-bz2 \
--with-system-jpeg --with-system-zlib --without-system-png \
--with-system-libevent --with-system-libvpx --enable-system-cairo \
--enable-system-pixman --enable-system-hunspell --enable-system-sqlite \
--enable-system-ffi --enable-startup-notification --enable-gio \
--enable-system-ffi --enable-startup-notification --disable-gio \
--with-pthreads --enable-official-branding --enable-safe-browsing \
--enable-skia --disable-debug --disable-gnomevfs --disable-gconf \
--disable-crashreporter --disable-updater --disable-tests \
--disable-skia --disable-debug --disable-gnomevfs --disable-gconf \
--disable-crashreporter --disable-updater --disable-xprint --disable-tests \
--disable-mochitest --disable-installer --disable-elf-hack \
--with-system-icu --enable-pulseaudio --enable-gstreamer=1.0 \
--disable-crashreporter --disable-cpp-exceptions --disable-javaxpcom \
--with-nspr-prefix=${XBPS_CROSS_BASE}/usr \
--with-nss-prefix=${XBPS_CROSS_BASE}/usr ${cross_args} \
--with-google-api-keyfile="${wrksrc}/google-api-key" \
--enable-optimize="$CFLAGS" --disable-strip --disable-install-strip \
--disable-static --enable-pie
--disable-static --disable-jemalloc --enable-pie \
--disable-profiling --disable-profilelocking
}
do_build() {
cd xbps-build