From c481446c0210205deca32bef6e199b5dd84f7b11 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 6 Feb 2015 17:38:29 +0100 Subject: update firefox, partially working. --- package/firefox/Makefile | 52 +- package/firefox/files/firefox | 2 +- package/firefox/patches/patch-configure | 63 +- .../patch-gfx_angle_src_common_angleutils_cpp | 10 + .../patches/patch-gfx_layers_BufferUnrotate_cpp | 10 - ...patch-ipc_chromium_src_base_debug_util_posix_cc | 13 - .../patch-ipc_chromium_src_base_file_util_h | 10 - .../patch-ipc_chromium_src_base_file_util_posix_cc | 48 - package/firefox/patches/patch-js_src_Makefile_in | 14 +- .../patches/patch-js_src_assembler_wtf_Platform_h | 12 - package/firefox/patches/patch-js_src_configure | 31 - .../patch-js_src_yarr_BumpPointerAllocator_h | 11 - ...a_mtransport_third_party_nICEr_src_stun_addrs_c | 43 - ...ia_mtransport_third_party_nICEr_src_stun_stun_h | 12 - ...edia_webrtc_trunk_tools_gyp_pylib_gyp_common_py | 23 - ..._trunk_tools_gyp_pylib_gyp_generator_mozmake_py | 26 - ...ebrtc_modules_audio_device_audio_device_impl_cc | 11 - ...s_audio_device_linux_audio_device_alsa_linux_cc | 11 - ..._device_linux_audio_mixer_manager_alsa_linux_cc | 11 - ...trunk_webrtc_system_wrappers_source_cpu_info_cc | 23 - ...em_wrappers_source_spreadsortlib_spreadsort_hpp | 3385 -------------------- .../patch-netwerk_sctp_src_netinet_sctp_bsd_addr_c | 15 - ...ch-netwerk_sctp_src_netinet_sctp_os_userspace_h | 22 - .../patch-netwerk_sctp_src_netinet_sctp_pcb_c | 25 - .../patch-netwerk_sctp_src_user_environment_c | 14 - .../patches/patch-netwerk_sctp_src_user_queue_h | 12 - ...thon_mozbuild_mozbuild_backend_recursivemake_py | 10 +- .../patches/patch-tools_profiler_platform-linux_cc | 12 +- .../patch-tools_profiler_shared-libraries-linux_cc | 11 - .../firefox/patches/patch-xpcom_ds_nsMathUtils_h | 22 +- .../patches/patch-xpcom_io_nsLocalFileUnix_cpp | 31 +- .../patches/patch-xpcom_threads_nsThread_cpp | 17 - 32 files changed, 125 insertions(+), 3887 deletions(-) create mode 100644 package/firefox/patches/patch-gfx_angle_src_common_angleutils_cpp delete mode 100644 package/firefox/patches/patch-gfx_layers_BufferUnrotate_cpp delete mode 100644 package/firefox/patches/patch-ipc_chromium_src_base_debug_util_posix_cc delete mode 100644 package/firefox/patches/patch-ipc_chromium_src_base_file_util_h delete mode 100644 package/firefox/patches/patch-ipc_chromium_src_base_file_util_posix_cc delete mode 100644 package/firefox/patches/patch-js_src_assembler_wtf_Platform_h delete mode 100644 package/firefox/patches/patch-js_src_configure delete mode 100644 package/firefox/patches/patch-js_src_yarr_BumpPointerAllocator_h delete mode 100644 package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_addrs_c delete mode 100644 package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_stun_h delete mode 100644 package/firefox/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_common_py delete mode 100644 package/firefox/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake_py delete mode 100644 package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_audio_device_impl_cc delete mode 100644 package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_linux_audio_device_alsa_linux_cc delete mode 100644 package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_linux_audio_mixer_manager_alsa_linux_cc delete mode 100644 package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_cpu_info_cc delete mode 100644 package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_spreadsortlib_spreadsort_hpp delete mode 100644 package/firefox/patches/patch-netwerk_sctp_src_netinet_sctp_bsd_addr_c delete mode 100644 package/firefox/patches/patch-netwerk_sctp_src_netinet_sctp_os_userspace_h delete mode 100644 package/firefox/patches/patch-netwerk_sctp_src_netinet_sctp_pcb_c delete mode 100644 package/firefox/patches/patch-netwerk_sctp_src_user_environment_c delete mode 100644 package/firefox/patches/patch-netwerk_sctp_src_user_queue_h delete mode 100644 package/firefox/patches/patch-tools_profiler_shared-libraries-linux_cc delete mode 100644 package/firefox/patches/patch-xpcom_threads_nsThread_cpp (limited to 'package/firefox') diff --git a/package/firefox/Makefile b/package/firefox/Makefile index e7b81944d..1a9aabb77 100644 --- a/package/firefox/Makefile +++ b/package/firefox/Makefile @@ -4,9 +4,9 @@ include $(ADK_TOPDIR)/rules.mk PKG_NAME:= firefox -PKG_VERSION:= 26.0 -PKG_RELEASE:= 4 -PKG_HASH:= 31c4fb2792df63ae450e350380a5e18cf1c51487011a9da0b6cc4bffb69d9812 +PKG_VERSION:= 35.0 +PKG_RELEASE:= 1 +PKG_HASH:= bedeb5bbd8b49e5b286497ef7732542c6e7441088fd8cd577d7ca8af4c871e81 PKG_DESCR:= graphical webbrowser PKG_SECTION:= x11/apps PKG_DEPENDS:= libpthread alsa-lib glib libgtk libpng libtiff libxcursor libffi @@ -18,20 +18,21 @@ PKG_BUILDDEP+= nspr nss libjpeg-turbo libXt fontconfig sqlite atk libpng hicolo PKG_BUILDDEP+= libvpx pango gettext-tiny bzip2 libevent bzip2-host python2-host yasm-host PKG_BUILDDEP+= zip-host PKG_URL:= http://www.mozilla.org/ -PKG_SITES:= http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PKG_VERSION}/source/ +PKG_SITES:= http://releases.mozilla.org/pub/mozilla.org/firefox/releases/$(PKG_VERSION)/source/ PKG_NOPARALLEL:= 1 PKG_ARCH_DEPENDS:= arm x86 x86_64 mips PKG_HOST_DEPENDS:= !netbsd !freebsd !openbsd !cygwin -PKG_SYSTEM_DEPENDS:= tarox-pc ibm-x40 lemote-yeelong qemu-i686 qemu-x86_64 qemu-mips64el raspberry-pi +PKG_SYSTEM_DEPENDS:= solidrun-imx6 ibm-x40 lemote-yeelong qemu-i686 qemu-x86_64 qemu-mips64el raspberry-pi -DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.source.tar.bz2 -WRKDIST= ${WRKDIR}/mozilla-release +DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).source.tar.bz2 +WRKDIST= $(WRKDIR)/mozilla-release +WRKBUILD= $(WRKDIR)/$(PKG_NAME)-obj include $(ADK_TOPDIR)/mk/package.mk include $(ADK_TOPDIR)/mk/python.mk -$(eval $(call PKG_template,FIREFOX,firefox,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) +$(eval $(call PKG_template,FIREFOX,firefox,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION))) ifeq ($(ADK_DEBUG),y) CONFIGURE_ARGS+= --enable-debug --enable-logging @@ -42,14 +43,14 @@ endif CONFIGURE_ENV+= CROSS_COMPILE=1 \ PYTHON="$(PYTHON)" \ - HOST_CC="${HOST_CC}" \ - HOST_CPPFLAGS="${HOST_CPPFLAGS}" \ - HOST_CFLAGS="${HOST_CFLAGS}" \ - HOST_LDFLAGS="${HOST_LDLAGS}" \ - HOST_CXX="${HOST_CXX}" \ - HOST_CXXFLAGS="${HOST_CXXFLAGS}" \ + HOST_CC="$(HOST_CC)" \ + HOST_CPPFLAGS="$(HOST_CPPFLAGS)" \ + HOST_CFLAGS="$(HOST_CFLAGS)" \ + HOST_LDFLAGS="$(HOST_LDLAGS)" \ + HOST_CXX="$(HOST_CXX)" \ + HOST_CXXFLAGS="$(HOST_CXXFLAGS)" \ HOST_RANLIB="ranlib" HOST_AR="ar" \ - CPPFLAGS="-I${STAGING_TARGET_DIR}/usr/include/freetype2" \ + CPPFLAGS="-I$(STAGING_TARGET_DIR)/usr/include/freetype2" \ ac_cv_sqlite_secure_delete=yes \ ac_cv_sqlite_threadsafe=yes \ ac_cv_sqlite_enable_fts3=yes \ @@ -66,19 +67,24 @@ CONFIGURE_ARGS+= --enable-application=browser \ --with-system-nspr \ --with-system-pango \ --with-system-libvpx \ - --with-system-libevent=${STAGING_TARGET_DIR}/usr \ + --with-system-libevent=$(STAGING_TARGET_DIR)/usr \ --enable-system-ffi \ --enable-system-sqlite \ --disable-libnotify \ - --with-libIDL-prefix=${STAGING_TARGET_DIR}/usr \ - --with-glib-prefix=${STAGING_TARGET_DIR}/usr \ + --with-libIDL-prefix=$(STAGING_TARGET_DIR)/usr \ + --with-glib-prefix=$(STAGING_TARGET_DIR)/usr \ --enable-chrome-format=jar \ --enable-necko-protocols=all \ --enable-libxul \ --enable-alsa \ + --disable-profiling \ + --disable-jprof \ + --disable-shark \ + --disable-systrace \ --disable-pulseaudio \ --disable-gstreamer \ --disable-gio \ + --disable-gold \ --disable-gconf \ --disable-accessibility \ --disable-smil \ @@ -98,6 +104,8 @@ CONFIGURE_ARGS+= --enable-application=browser \ --disable-mathml \ --disable-jemalloc \ --disable-crashreporter \ + --disable-printing \ + --disable-pie \ --disable-updater \ --disable-xpcom-fastload \ --disable-url-classifier \ @@ -109,17 +117,17 @@ TARGET_CFLAGS:= $(subst Os,g3,$(TARGET_CFLAGS)) endif XAKE_FLAGS+= OS_RELEASE="2.6" HOST_CC=$(HOST_CC) HOST_LDFLAGS=$(HOST_LDFLAGS) -XAKE_FLAGS+= ARCHFLAG="${TARGET_CFLAGS} ${TARGET_CPPFLAGS} ${TARGET_LDFLAGS} -lnss3 -lnssutil3 -lsmime3 -lssl3 -fPIC" +XAKE_FLAGS+= ARCHFLAG="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS) -lnss3 -lnssutil3 -lsmime3 -lssl3 -fPIC" pre-build: - -mkdir ${WRKBUILD}/js/src/.deps + -mkdir $(WRKBUILD)/js/src/.deps firefox-install: $(INSTALL_DIR) $(IDIR_FIREFOX)/usr/bin $(INSTALL_DIR) $(IDIR_FIREFOX)/usr/lib - $(CP) $(WRKINST)/usr/lib/firefox-${PKG_VERSION} \ + $(CP) $(WRKINST)/usr/lib/firefox-$(PKG_VERSION) \ $(IDIR_FIREFOX)/usr/lib $(CP) ./files/firefox \ $(IDIR_FIREFOX)/usr/bin -include ${ADK_TOPDIR}/mk/pkg-bottom.mk +include $(ADK_TOPDIR)/mk/pkg-bottom.mk diff --git a/package/firefox/files/firefox b/package/firefox/files/firefox index 339daaf09..30470334a 100755 --- a/package/firefox/files/firefox +++ b/package/firefox/files/firefox @@ -1,2 +1,2 @@ #!/bin/sh -env LD_LIBRARY_PATH=/usr/lib/firefox-26.0 /usr/lib/firefox-26.0/firefox +env LD_LIBRARY_PATH=/usr/lib/firefox-35.0 /usr/lib/firefox-35.0/firefox diff --git a/package/firefox/patches/patch-configure b/package/firefox/patches/patch-configure index 884cea4dd..52210624e 100644 --- a/package/firefox/patches/patch-configure +++ b/package/firefox/patches/patch-configure @@ -1,30 +1,41 @@ ---- mozilla-release.orig/configure 2013-12-05 17:08:46.000000000 +0100 -+++ mozilla-release/configure 2014-01-06 18:17:43.008094174 +0100 -@@ -9787,27 +9787,6 @@ if test -z "$GNU_CC"; then - esac +--- mozilla-release.orig/configure 2015-01-09 05:39:04.000000000 +0100 ++++ mozilla-release/configure 2015-02-04 11:49:00.000000000 +0100 +@@ -8156,38 +8156,6 @@ EOF + fi --if test "$GNU_CC" -a -n "$DEVELOPER_OPTIONS"; then -- if $CC -Wl,--version 2>&1 | grep -q "GNU ld"; then -- GOLD=$($CC -print-prog-name=ld.gold) -- case "$GOLD" in -- /*) -- ;; -- *) -- GOLD=$(which $GOLD) -- ;; -- esac -- if test -n "$GOLD"; then -- mkdir -p $_objdir/build/unix/gold -- ln -s "$GOLD" $_objdir/build/unix/gold/ld -- if $CC -B $_objdir/build/unix/gold -Wl,--version 2>&1 | grep -q "GNU gold"; then -- LDFLAGS="$LDFLAGS -B $_objdir/build/unix/gold" -- else -- rm -rf $_objdir/build/unix/gold -- fi -- fi -- fi +-MOZ_ENABLE_PROFILER_SPS=1 +- +-case "${OS_TARGET}" in +-Android) +- case "${CPU_ARCH}" in +- x86 | arm) ;; +- *) +- MOZ_ENABLE_PROFILER_SPS= +- esac +- ;; +-Linux) +- case "${CPU_ARCH}" in +- x86 | x86_64) ;; +- *) +- MOZ_ENABLE_PROFILER_SPS= +- esac +- ;; +-WINNT|Darwin) ;; +-*) +- MOZ_ENABLE_PROFILER_SPS= +- ;; +-esac +- +-if test -n "$MOZ_ENABLE_PROFILER_SPS"; then +- cat >> confdefs.pytmp <<\EOF +- (''' MOZ_ENABLE_PROFILER_SPS ''', ' 1 ') +-EOF +-cat >> confdefs.h <<\EOF +-#define MOZ_ENABLE_PROFILER_SPS 1 +-EOF +- -fi - if test "$GNU_CC"; then - if test -z "$DEVELOPER_OPTIONS"; then + # Check whether --enable-shark or --disable-shark was given. + if test "${enable_shark+set}" = set; then diff --git a/package/firefox/patches/patch-gfx_angle_src_common_angleutils_cpp b/package/firefox/patches/patch-gfx_angle_src_common_angleutils_cpp new file mode 100644 index 000000000..bcf9ac30a --- /dev/null +++ b/package/firefox/patches/patch-gfx_angle_src_common_angleutils_cpp @@ -0,0 +1,10 @@ +--- mozilla-release.orig/gfx/angle/src/common/angleutils.cpp 2015-01-09 05:38:28.000000000 +0100 ++++ mozilla-release/gfx/angle/src/common/angleutils.cpp 2015-02-03 04:42:10.000000000 +0100 +@@ -7,6 +7,7 @@ + #include "common/angleutils.h" + + #include ++#include + + std::string FormatString(const char *fmt, va_list vararg) + { diff --git a/package/firefox/patches/patch-gfx_layers_BufferUnrotate_cpp b/package/firefox/patches/patch-gfx_layers_BufferUnrotate_cpp deleted file mode 100644 index 0a96d2259..000000000 --- a/package/firefox/patches/patch-gfx_layers_BufferUnrotate_cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- mozilla-release.orig/gfx/layers/BufferUnrotate.cpp 2013-12-05 17:07:31.000000000 +0100 -+++ mozilla-release/gfx/layers/BufferUnrotate.cpp 2014-01-06 21:27:39.000000000 +0100 -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - - void BufferUnrotate(uint8_t* aBuffer, int aByteWidth, int aHeight, - int aByteStride, int aXBoundary, int aYBoundary) diff --git a/package/firefox/patches/patch-ipc_chromium_src_base_debug_util_posix_cc b/package/firefox/patches/patch-ipc_chromium_src_base_debug_util_posix_cc deleted file mode 100644 index 8537bed9a..000000000 --- a/package/firefox/patches/patch-ipc_chromium_src_base_debug_util_posix_cc +++ /dev/null @@ -1,13 +0,0 @@ ---- mozilla-release.orig/ipc/chromium/src/base/debug_util_posix.cc 2013-09-11 01:15:04.000000000 +0200 -+++ mozilla-release/ipc/chromium/src/base/debug_util_posix.cc 2013-10-23 16:28:38.000000000 +0200 -@@ -5,7 +5,9 @@ - #include "build/build_config.h" - #include "base/debug_util.h" - --#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && !defined(ANDROID)) -+#include -+ -+#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && !defined(ANDROID) && !defined(__UCLIBC__)) && defined(__GLIBC__) - - #include - #include diff --git a/package/firefox/patches/patch-ipc_chromium_src_base_file_util_h b/package/firefox/patches/patch-ipc_chromium_src_base_file_util_h deleted file mode 100644 index 5f7e30a10..000000000 --- a/package/firefox/patches/patch-ipc_chromium_src_base_file_util_h +++ /dev/null @@ -1,10 +0,0 @@ ---- mozilla-release.orig/ipc/chromium/src/base/file_util.h 2013-12-05 17:07:35.000000000 +0100 -+++ mozilla-release/ipc/chromium/src/base/file_util.h 2014-01-02 15:01:42.000000000 +0100 -@@ -16,7 +16,6 @@ - #include - #elif defined(OS_POSIX) - #include --#include - #include - #endif - diff --git a/package/firefox/patches/patch-ipc_chromium_src_base_file_util_posix_cc b/package/firefox/patches/patch-ipc_chromium_src_base_file_util_posix_cc deleted file mode 100644 index 7680a29c4..000000000 --- a/package/firefox/patches/patch-ipc_chromium_src_base_file_util_posix_cc +++ /dev/null @@ -1,48 +0,0 @@ ---- mozilla-release.orig/ipc/chromium/src/base/file_util_posix.cc 2013-12-05 17:07:35.000000000 +0100 -+++ mozilla-release/ipc/chromium/src/base/file_util_posix.cc 2014-01-02 14:53:44.000000000 +0100 -@@ -8,13 +8,16 @@ - #include - #include - #include --#ifndef ANDROID -+#ifndef __GLIBC__ -+#define NO_FTS -+#endif -+#ifndef NO_FTS - #include - #endif - #include - #include - #include --#include -+#include - #include - #define _DARWIN_USE_64_BIT_INODE // Use 64-bit inode data structures - #include -@@ -67,7 +70,7 @@ bool Delete(const FilePath& path, bool r - if (!recursive) - return (rmdir(path_str) == 0); - --#ifdef ANDROID -+#ifdef NO_FTS - // XXX Need ftsless impl for bionic - return false; - #else -@@ -140,7 +143,7 @@ bool CopyDirectory(const FilePath& from_ - return false; - } - --#ifdef ANDROID -+#ifdef NO_FTS - // XXX Need ftsless impl for bionic - return false; - #else -@@ -333,7 +336,7 @@ bool CreateNewTempDirectory(const FilePa - return false; - tmpdir = tmpdir.Append(kTempFileName); - std::string tmpdir_string = tmpdir.value(); --#ifdef ANDROID -+#ifdef NO_FTS - char* dtemp = NULL; - #else - // this should be OK since mkdtemp just replaces characters in place diff --git a/package/firefox/patches/patch-js_src_Makefile_in b/package/firefox/patches/patch-js_src_Makefile_in index d4acee98c..b536ab3f5 100644 --- a/package/firefox/patches/patch-js_src_Makefile_in +++ b/package/firefox/patches/patch-js_src_Makefile_in @@ -1,11 +1,11 @@ ---- mozilla-release.orig/js/src/Makefile.in 2013-12-05 17:07:35.000000000 +0100 -+++ mozilla-release/js/src/Makefile.in 2014-01-02 14:53:44.000000000 +0100 -@@ -103,7 +103,7 @@ ifdef JS_HAS_CTYPES - VPATH += $(srcdir)/ctypes +--- mozilla-release.orig/js/src/Makefile.in 2015-01-09 05:38:17.000000000 +0100 ++++ mozilla-release/js/src/Makefile.in 2015-01-29 17:03:28.000000000 +0100 +@@ -21,7 +21,7 @@ NO_EXPAND_LIBS = 1 + ifdef JS_HAS_CTYPES ifdef MOZ_NATIVE_FFI -LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS) -+LOCAL_INCLUDES = - else - LOCAL_INCLUDES = -Ictypes/libffi/include ++LOCAL_INCLUDES = endif + + # Windows needs this to be linked with a static library. diff --git a/package/firefox/patches/patch-js_src_assembler_wtf_Platform_h b/package/firefox/patches/patch-js_src_assembler_wtf_Platform_h deleted file mode 100644 index 68a7adf0a..000000000 --- a/package/firefox/patches/patch-js_src_assembler_wtf_Platform_h +++ /dev/null @@ -1,12 +0,0 @@ ---- mozilla-release.orig/js/src/assembler/wtf/Platform.h 2013-09-11 01:15:04.000000000 +0200 -+++ mozilla-release/js/src/assembler/wtf/Platform.h 2013-10-28 12:43:50.000000000 +0100 -@@ -139,8 +139,7 @@ - - /* WTF_CPU_MIPS - MIPS 32-bit */ - /* Note: Only O32 ABI is tested, so we enable it for O32 ABI for now. */ --#if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) \ -- && defined(_ABIO32) -+#if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) - #define WTF_CPU_MIPS 1 - #if defined(__MIPSEB__) - #define WTF_CPU_BIG_ENDIAN 1 diff --git a/package/firefox/patches/patch-js_src_configure b/package/firefox/patches/patch-js_src_configure deleted file mode 100644 index c37f501e4..000000000 --- a/package/firefox/patches/patch-js_src_configure +++ /dev/null @@ -1,31 +0,0 @@ ---- mozilla-release.orig/js/src/configure 2013-12-05 17:08:46.000000000 +0100 -+++ mozilla-release/js/src/configure 2014-01-07 19:30:38.660353287 +0100 -@@ -8652,28 +8652,6 @@ if test -z "$GNU_CC"; then - esac - fi - --if test "$GNU_CC" -a -n "$DEVELOPER_OPTIONS"; then -- if $CC -Wl,--version 2>&1 | grep -q "GNU ld"; then -- GOLD=$($CC -print-prog-name=ld.gold) -- case "$GOLD" in -- /*) -- ;; -- *) -- GOLD=$(which $GOLD) -- ;; -- esac -- if test -n "$GOLD"; then -- mkdir -p $_objdir/build/unix/gold -- ln -s "$GOLD" $_objdir/build/unix/gold/ld -- if $CC -B $_objdir/build/unix/gold -Wl,--version 2>&1 | grep -q "GNU gold"; then -- LDFLAGS="$LDFLAGS -B $_objdir/build/unix/gold" -- else -- rm -rf $_objdir/build/unix/gold -- fi -- fi -- fi --fi -- - if test "$GNU_CC"; then - if test -z "$DEVELOPER_OPTIONS"; then - CFLAGS="$CFLAGS -ffunction-sections -fdata-sections" diff --git a/package/firefox/patches/patch-js_src_yarr_BumpPointerAllocator_h b/package/firefox/patches/patch-js_src_yarr_BumpPointerAllocator_h deleted file mode 100644 index 1697dfddd..000000000 --- a/package/firefox/patches/patch-js_src_yarr_BumpPointerAllocator_h +++ /dev/null @@ -1,11 +0,0 @@ ---- mozilla-release.orig/js/src/yarr/BumpPointerAllocator.h 2013-09-11 01:15:09.000000000 +0200 -+++ mozilla-release/js/src/yarr/BumpPointerAllocator.h 2013-10-28 12:44:10.000000000 +0100 -@@ -38,6 +38,8 @@ namespace WTF { - #define MINIMUM_BUMP_POOL_SIZE 0x2000 - #elif WTF_CPU_IA64 - #define MINIMUM_BUMP_POOL_SIZE 0x4000 -+#elif WTF_CPU_MIPS -+#define MINIMUM_BUMP_POOL_SIZE 0x4000 - #else - #define MINIMUM_BUMP_POOL_SIZE 0x1000 - #endif diff --git a/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_addrs_c b/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_addrs_c deleted file mode 100644 index f2b55cd6a..000000000 --- a/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_addrs_c +++ /dev/null @@ -1,43 +0,0 @@ ---- mozilla-release.orig/media/mtransport/third_party/nICEr/src/stun/addrs.c 2013-12-05 17:07:48.000000000 +0100 -+++ mozilla-release/media/mtransport/third_party/nICEr/src/stun/addrs.c 2014-03-16 18:41:03.000000000 +0100 -@@ -45,7 +45,9 @@ static char *RCSSTRING __UNUSED__="$Id: - #include - #include - #ifndef ANDROID -+#ifdef __GLIBC__ - #include -+#endif - #include - #else - #include -@@ -53,7 +55,9 @@ static char *RCSSTRING __UNUSED__="$Id: - #undef __unused - #include - #endif -+#if defined(__GLIBC__) - #include -+#endif - #ifndef LINUX - #if !defined(__OpenBSD__) && !defined(__NetBSD__) - #include -@@ -61,14 +65,17 @@ static char *RCSSTRING __UNUSED__="$Id: - #include - #include - #include --#else -+#elif defined(__GLIBC__) - #include - #include - #include - #include --#ifndef ANDROID - #include --#endif -+#else -+#include -+#include -+#include -+#include - #endif - #include - diff --git a/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_stun_h b/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_stun_h deleted file mode 100644 index 7877d65cc..000000000 --- a/package/firefox/patches/patch-media_mtransport_third_party_nICEr_src_stun_stun_h +++ /dev/null @@ -1,12 +0,0 @@ ---- mozilla-release.orig/media/mtransport/third_party/nICEr/src/stun/stun.h 2013-12-05 17:07:48.000000000 +0100 -+++ mozilla-release/media/mtransport/third_party/nICEr/src/stun/stun.h 2014-01-03 17:19:05.000000000 +0100 -@@ -39,7 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE - #else - #include - #include -+#if defined(__GLIBC__) - #include -+#endif - #ifndef LINUX - #if !defined(__OpenBSD__) && !defined(__NetBSD__) - #include diff --git a/package/firefox/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_common_py b/package/firefox/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_common_py deleted file mode 100644 index 60d33bb2e..000000000 --- a/package/firefox/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_common_py +++ /dev/null @@ -1,23 +0,0 @@ ---- mozilla-release.orig/media/webrtc/trunk/tools/gyp/pylib/gyp/common.py 2013-12-05 17:07:48.000000000 +0100 -+++ mozilla-release/media/webrtc/trunk/tools/gyp/pylib/gyp/common.py 2014-02-05 08:12:49.000000000 +0100 -@@ -364,20 +364,6 @@ def WriteOnDiff(filename): - - def GetFlavor(params): - """Returns |params.flavor| if it's set, the system's default flavor else.""" -- flavors = { -- 'cygwin': 'win', -- 'win32': 'win', -- 'darwin': 'mac', -- } -- -- if 'flavor' in params: -- return params['flavor'] -- if sys.platform in flavors: -- return flavors[sys.platform] -- if sys.platform.startswith('sunos'): -- return 'solaris' -- if sys.platform.startswith('freebsd'): -- return 'freebsd' - - return 'linux' - diff --git a/package/firefox/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake_py b/package/firefox/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake_py deleted file mode 100644 index 452d380f0..000000000 --- a/package/firefox/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake_py +++ /dev/null @@ -1,26 +0,0 @@ ---- mozilla-release.orig/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py 2013-12-05 17:07:48.000000000 +0100 -+++ mozilla-release/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py 2014-02-05 08:13:30.000000000 +0100 -@@ -118,23 +118,6 @@ def ensure_directory_exists(path): - - def GetFlavor(params): - """Returns |params.flavor| if it's set, the system's default flavor else.""" -- system = platform.system().lower() -- flavors = { -- 'microsoft': 'win', -- 'windows' : 'win', -- 'cygwin' : 'win', -- 'darwin' : 'mac', -- 'sunos' : 'solaris', -- 'dragonfly': 'dragonfly', -- 'freebsd' : 'freebsd', -- 'netbsd' : 'netbsd', -- 'openbsd' : 'openbsd', -- } -- -- if 'flavor' in params: -- return params['flavor'] -- if system in flavors: -- return flavors[system] - - return 'linux' - diff --git a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_audio_device_impl_cc b/package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_audio_device_impl_cc deleted file mode 100644 index 0ef4e5714..000000000 --- a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_audio_device_impl_cc +++ /dev/null @@ -1,11 +0,0 @@ ---- mozilla-release.orig/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc 2013-09-11 01:15:17.000000000 +0200 -+++ mozilla-release/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc 2013-10-23 16:28:38.000000000 +0200 -@@ -8,6 +8,8 @@ - * be found in the AUTHORS file in the root of the source tree. - */ - -+#define _POSIX_SOURCE -+ - #include "audio_device_impl.h" - #include "audio_device_config.h" - #include "common_audio/signal_processing/include/signal_processing_library.h" diff --git a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_linux_audio_device_alsa_linux_cc b/package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_linux_audio_device_alsa_linux_cc deleted file mode 100644 index a5fd50511..000000000 --- a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_linux_audio_device_alsa_linux_cc +++ /dev/null @@ -1,11 +0,0 @@ ---- mozilla-release.orig/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc 2013-09-11 01:15:17.000000000 +0200 -+++ mozilla-release/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc 2013-10-23 16:28:38.000000000 +0200 -@@ -8,6 +8,8 @@ - * be found in the AUTHORS file in the root of the source tree. - */ - -+#define _POSIX_SOURCE -+ - #include - - #include "audio_device_utility.h" diff --git a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_linux_audio_mixer_manager_alsa_linux_cc b/package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_linux_audio_mixer_manager_alsa_linux_cc deleted file mode 100644 index 2544d6c08..000000000 --- a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_modules_audio_device_linux_audio_mixer_manager_alsa_linux_cc +++ /dev/null @@ -1,11 +0,0 @@ ---- mozilla-release.orig/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc 2013-09-11 01:15:17.000000000 +0200 -+++ mozilla-release/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc 2013-10-23 16:28:38.000000000 +0200 -@@ -8,6 +8,8 @@ - * be found in the AUTHORS file in the root of the source tree. - */ - -+#define _POSIX_SOURCE -+ - #include - - #include "audio_mixer_manager_alsa_linux.h" diff --git a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_cpu_info_cc b/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_cpu_info_cc deleted file mode 100644 index 5e066a88a..000000000 --- a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_cpu_info_cc +++ /dev/null @@ -1,23 +0,0 @@ ---- mozilla-release.orig/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc 2013-12-05 17:07:50.000000000 +0100 -+++ mozilla-release/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc 2014-03-16 10:56:09.000000000 +0100 -@@ -36,11 +36,6 @@ uint32_t CpuInfo::DetectNumberOfCores() - WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, - "Available number of cores:%d", number_of_cores_); - --#elif defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID) && !defined(WEBRTC_GONK) -- number_of_cores_ = static_cast(sysconf(_SC_NPROCESSORS_ONLN)); -- WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, -- "Available number of cores:%d", number_of_cores_); -- - #elif defined(WEBRTC_BSD) || defined(WEBRTC_MAC) - int name[] = { - CTL_HW, -@@ -61,8 +56,6 @@ uint32_t CpuInfo::DetectNumberOfCores() - "Failed to get number of cores"); - number_of_cores_ = 1; - } --#elif defined(_SC_NPROCESSORS_ONLN) -- number_of_cores_ = sysconf(_SC_NPROCESSORS_ONLN); - #else - WEBRTC_TRACE(kTraceWarning, kTraceUtility, -1, - "No function to get number of cores"); diff --git a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_spreadsortlib_spreadsort_hpp b/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_spreadsortlib_spreadsort_hpp deleted file mode 100644 index 95cfd56ba..000000000 --- a/package/firefox/patches/patch-media_webrtc_trunk_webrtc_system_wrappers_source_spreadsortlib_spreadsort_hpp +++ /dev/null @@ -1,3385 +0,0 @@ ---- mozilla-release.orig/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp 2013-12-05 17:07:50.000000000 +0100 -+++ mozilla-release/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp 2014-02-05 09:52:11.000000000 +0100 -@@ -1,1688 +1,1694 @@ --//Templated spread_sort library -- --// Copyright Steven J. Ross 2001 - 2009. --// Distributed under the Boost Software License, Version 1.0. --// (See accompanying file LICENSE_1_0.txt or copy at --// http://www.boost.org/LICENSE_1_0.txt) -- --// See http://www.boost.org/ for updates, documentation, and revision history. -- --/* --Some improvements suggested by: --Phil Endecott and Frank Gennari --Cygwin fix provided by: --Scott McMurray --*/ -- --#ifndef BOOST_SPREAD_SORT_H --#define BOOST_SPREAD_SORT_H --#include --#include --#include --#include "webrtc/system_wrappers/source/spreadsortlib/constants.hpp" -- --namespace boost { -- namespace detail { -- //This only works on unsigned data types -- template -- inline unsigned -- rough_log_2_size(const T& input) -- { -- unsigned result = 0; -- //The && is necessary on some compilers to avoid infinite loops; it doesn't significantly impair performance -- while((input >> result) && (result < (8*sizeof(T)))) ++result; -- return result; -- } -- -- //Gets the maximum size which we'll call spread_sort on to control worst-case performance -- //Maintains both a minimum size to recurse and a check of distribution size versus count -- //This is called for a set of bins, instead of bin-by-bin, to avoid performance overhead -- inline size_t -- get_max_count(unsigned log_range, size_t count) -- { -- unsigned divisor = rough_log_2_size(count); -- //Making sure the divisor is positive -- if(divisor > LOG_MEAN_BIN_SIZE) -- divisor -= LOG_MEAN_BIN_SIZE; -- else -- divisor = 1; -- unsigned relative_width = (LOG_CONST * log_range)/((divisor > MAX_SPLITS) ? MAX_SPLITS : divisor); -- //Don't try to bitshift more than the size of an element -- if((8*sizeof(size_t)) <= relative_width) -- relative_width = (8*sizeof(size_t)) - 1; -- return (size_t)1 << ((relative_width < (LOG_MEAN_BIN_SIZE + LOG_MIN_SPLIT_COUNT)) ? -- (LOG_MEAN_BIN_SIZE + LOG_MIN_SPLIT_COUNT) : relative_width); -- } -- -- //Find the minimum and maximum using < -- template -- inline void -- find_extremes(RandomAccessIter current, RandomAccessIter last, RandomAccessIter & max, RandomAccessIter & min) -- { -- min = max = current; -- //Start from the second item, as max and min are initialized to the first -- while(++current < last) { -- if(*max < *current) -- max = current; -- else if(*current < *min) -- min = current; -- } -- } -- -- //Uses a user-defined comparison operator to find minimum and maximum -- template -- inline void -- find_extremes(RandomAccessIter current, RandomAccessIter last, RandomAccessIter & max, RandomAccessIter & min, compare comp) -- { -- min = max = current; -- while(++current < last) { -- if(comp(*max, *current)) -- max = current; -- else if(comp(*current, *min)) -- min = current; -- } -- } -- -- //Gets a non-negative right bit shift to operate as a logarithmic divisor -- inline int -- get_log_divisor(size_t count, unsigned log_range) -- { -- int log_divisor; -- //If we can finish in one iteration without exceeding either (2 to the MAX_SPLITS) or n bins, do so -- if((log_divisor = log_range - rough_log_2_size(count)) <= 0 && log_range < MAX_SPLITS) -- log_divisor = 0; -- else { -- //otherwise divide the data into an optimized number of pieces -- log_divisor += LOG_MEAN_BIN_SIZE; -- if(log_divisor < 0) -- log_divisor = 0; -- //Cannot exceed MAX_SPLITS or cache misses slow down bin lookups dramatically -- if((log_range - log_divisor) > MAX_SPLITS) -- log_divisor = log_range - MAX_SPLITS; -- } -- return log_divisor; -- } -- -- template -- inline RandomAccessIter * -- size_bins(std::vector &bin_sizes, std::vector &bin_cache, unsigned cache_offset, unsigned &cache_end, unsigned bin_count) -- { -- //Assure space for the size of each bin, followed by initializing sizes -- if(bin_count > bin_sizes.size()) -- bin_sizes.resize(bin_count); -- for(size_t u = 0; u < bin_count; u++) -- bin_sizes[u] = 0; -- //Make sure there is space for the bins -- cache_end = cache_offset + bin_count; -- if(cache_end > bin_cache.size()) -- bin_cache.resize(cache_end); -- return &(bin_cache[cache_offset]); -- } -- -- //Implementation for recursive integer sorting -- template -- inline void -- spread_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector &bin_cache, unsigned cache_offset -- , std::vector &bin_sizes) -- { -- //This step is roughly 10% of runtime, but it helps avoid worst-case behavior and improve behavior with real data -- //If you know the maximum and minimum ahead of time, you can pass those values in and skip this step for the first iteration -- RandomAccessIter max, min; -- find_extremes(first, last, max, min); -- //max and min will be the same (the first item) iff all values are equivalent -- if(max == min) -- return; -- RandomAccessIter * target_bin; -- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(*max >> 0) - (*min >> 0))); -- div_type div_min = *min >> log_divisor; -- div_type div_max = *max >> log_divisor; -- unsigned bin_count = div_max - div_min + 1; -- unsigned cache_end; -- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); -- -- //Calculating the size of each bin; this takes roughly 10% of runtime -- for (RandomAccessIter current = first; current != last;) -- bin_sizes[(*(current++) >> log_divisor) - div_min]++; -- //Assign the bin positions -- bins[0] = first; -- for(unsigned u = 0; u < bin_count - 1; u++) -- bins[u + 1] = bins[u] + bin_sizes[u]; -- -- //Swap into place -- //This dominates runtime, mostly in the swap and bin lookups -- RandomAccessIter nextbinstart = first; -- for(unsigned u = 0; u < bin_count - 1; ++u) { -- RandomAccessIter * local_bin = bins + u; -- nextbinstart += bin_sizes[u]; -- //Iterating over each element in this bin -- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { -- //Swapping elements in current into place until the correct element has been swapped in -- for(target_bin = (bins + ((*current >> log_divisor) - div_min)); target_bin != local_bin; -- target_bin = bins + ((*current >> log_divisor) - div_min)) { -- //3-way swap; this is about 1% faster than a 2-way swap with integers -- //The main advantage is less copies are involved per item put in the correct place -- data_type tmp; -- RandomAccessIter b = (*target_bin)++; -- RandomAccessIter * b_bin = bins + ((*b >> log_divisor) - div_min); -- if (b_bin != local_bin) { -- RandomAccessIter c = (*b_bin)++; -- tmp = *c; -- *c = *b; -- } -- else -- tmp = *b; -- *b = *current; -- *current = tmp; -- } -- } -- *local_bin = nextbinstart; -- } -- bins[bin_count - 1] = last; -- -- //If we've bucketsorted, the array is sorted and we should skip recursion -- if(!log_divisor) -- return; -- -- //Recursing; log_divisor is the remaining range -- size_t max_count = get_max_count(log_divisor, last - first); -- RandomAccessIter lastPos = first; -- for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) { -- size_t count = bin_cache[u] - lastPos; -- //don't sort unless there are at least two items to compare -- if(count < 2) -- continue; -- //using std::sort if its worst-case is better -- if(count < max_count) -- std::sort(lastPos, bin_cache[u]); -- else -- spread_sort_rec(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes); -- } -- } -- -- //Generic bitshift-based 3-way swapping code -- template -- inline void inner_swap_loop(RandomAccessIter * bins, const RandomAccessIter & nextbinstart, unsigned ii, right_shift &shift -- , const unsigned log_divisor, const div_type div_min) -- { -- RandomAccessIter * local_bin = bins + ii; -- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { -- for(RandomAccessIter * target_bin = (bins + (shift(*current, log_divisor) - div_min)); target_bin != local_bin; -- target_bin = bins + (shift(*current, log_divisor) - div_min)) { -- data_type tmp; -- RandomAccessIter b = (*target_bin)++; -- RandomAccessIter * b_bin = bins + (shift(*b, log_divisor) - div_min); -- //Three-way swap; if the item to be swapped doesn't belong in the current bin, swap it to where it belongs -- if (b_bin != local_bin) { -- RandomAccessIter c = (*b_bin)++; -- tmp = *c; -- *c = *b; -- } -- //Note: we could increment current once the swap is done in this case, but that seems to impair performance -- else -- tmp = *b; -- *b = *current; -- *current = tmp; -- } -- } -- *local_bin = nextbinstart; -- } -- -- //Standard swapping wrapper for ascending values -- template -- inline void swap_loop(RandomAccessIter * bins, RandomAccessIter & nextbinstart, unsigned ii, right_shift &shift -- , const std::vector &bin_sizes, const unsigned log_divisor, const div_type div_min) -- { -- nextbinstart += bin_sizes[ii]; -- inner_swap_loop(bins, nextbinstart, ii, shift, log_divisor, div_min); -- } -- -- //Functor implementation for recursive sorting -- template -- inline void -- spread_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector &bin_cache, unsigned cache_offset -- , std::vector &bin_sizes, right_shift shift, compare comp) -- { -- RandomAccessIter max, min; -- find_extremes(first, last, max, min, comp); -- if(max == min) -- return; -- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(shift(*max, 0)) - (shift(*min, 0)))); -- div_type div_min = shift(*min, log_divisor); -- div_type div_max = shift(*max, log_divisor); -- unsigned bin_count = div_max - div_min + 1; -- unsigned cache_end; -- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); -- -- //Calculating the size of each bin -- for (RandomAccessIter current = first; current != last;) -- bin_sizes[shift(*(current++), log_divisor) - div_min]++; -- bins[0] = first; -- for(unsigned u = 0; u < bin_count - 1; u++) -- bins[u + 1] = bins[u] + bin_sizes[u]; -- -- //Swap into place -- RandomAccessIter nextbinstart = first; -- for(unsigned u = 0; u < bin_count - 1; ++u) -- swap_loop(bins, nextbinstart, u, shift, bin_sizes, log_divisor, div_min); -- bins[bin_count - 1] = last; -- -- //If we've bucketsorted, the array is sorted and we should skip recursion -- if(!log_divisor) -- return; -- -- //Recursing -- size_t max_count = get_max_count(log_divisor, last - first); -- RandomAccessIter lastPos = first; -- for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) { -- size_t count = bin_cache[u] - lastPos; -- if(count < 2) -- continue; -- if(count < max_count) -- std::sort(lastPos, bin_cache[u], comp); -- else -- spread_sort_rec(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift, comp); -- } -- } -- -- //Functor implementation for recursive sorting with only Shift overridden -- template -- inline void -- spread_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector &bin_cache, unsigned cache_offset -- , std::vector &bin_sizes, right_shift shift) -- { -- RandomAccessIter max, min; -- find_extremes(first, last, max, min); -- if(max == min) -- return; -- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(shift(*max, 0)) - (shift(*min, 0)))); -- div_type div_min = shift(*min, log_divisor); -- div_type div_max = shift(*max, log_divisor); -- unsigned bin_count = div_max - div_min + 1; -- unsigned cache_end; -- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); -- -- //Calculating the size of each bin -- for (RandomAccessIter current = first; current != last;) -- bin_sizes[shift(*(current++), log_divisor) - div_min]++; -- bins[0] = first; -- for(unsigned u = 0; u < bin_count - 1; u++) -- bins[u + 1] = bins[u] + bin_sizes[u]; -- -- //Swap into place -- RandomAccessIter nextbinstart = first; -- for(unsigned ii = 0; ii < bin_count - 1; ++ii) -- swap_loop(bins, nextbinstart, ii, shift, bin_sizes, log_divisor, div_min); -- bins[bin_count - 1] = last; -- -- //If we've bucketsorted, the array is sorted and we should skip recursion -- if(!log_divisor) -- return; -- -- //Recursing -- size_t max_count = get_max_count(log_divisor, last - first); -- RandomAccessIter lastPos = first; -- for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) { -- size_t count = bin_cache[u] - lastPos; -- if(count < 2) -- continue; -- if(count < max_count) -- std::sort(lastPos, bin_cache[u]); -- else -- spread_sort_rec(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes, shift); -- } -- } -- -- //Holds the bin vector and makes the initial recursive call -- template -- inline void -- spread_sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type) -- { -- std::vector bin_sizes; -- std::vector bin_cache; -- spread_sort_rec(first, last, bin_cache, 0, bin_sizes); -- } -- -- template -- inline void -- spread_sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift, compare comp) -- { -- std::vector bin_sizes; -- std::vector bin_cache; -- spread_sort_rec(first, last, bin_cache, 0, bin_sizes, shift, comp); -- } -- -- template -- inline void -- spread_sort(RandomAccessIter first, RandomAccessIter last, div_type, data_type, right_shift shift) -- { -- std::vector bin_sizes; -- std::vector bin_cache; -- spread_sort_rec(first, last, bin_cache, 0, bin_sizes, shift); -- } -- } -- -- //Top-level sorting call for integers -- template -- inline void integer_sort(RandomAccessIter first, RandomAccessIter last) -- { -- //Don't sort if it's too small to optimize -- if(last - first < detail::MIN_SORT_SIZE) -- std::sort(first, last); -- else -- detail::spread_sort(first, last, *first >> 0, *first); -- } -- -- //integer_sort with functors -- template -- inline void integer_sort(RandomAccessIter first, RandomAccessIter last, -- right_shift shift, compare comp) { -- if(last - first < detail::MIN_SORT_SIZE) -- std::sort(first, last, comp); -- else -- detail::spread_sort(first, last, shift(*first, 0), *first, shift, comp); -- } -- -- //integer_sort with right_shift functor -- template -- inline void integer_sort(RandomAccessIter first, RandomAccessIter last, -- right_shift shift) { -- if(last - first < detail::MIN_SORT_SIZE) -- std::sort(first, last); -- else -- detail::spread_sort(first, last, shift(*first, 0), *first, shift); -- } -- -- //------------------------------------------------------ float_sort source -------------------------------------- -- //Casts a RandomAccessIter to the specified data type -- template -- inline cast_type -- cast_float_iter(const RandomAccessIter & floatiter) -- { -- cast_type result; -- std::memcpy(&result, &(*floatiter), sizeof(cast_type)); -- return result; -- } -- -- //Casts a data element to the specified datinner_float_a type -- template -- inline cast_type -- mem_cast(const data_type & data) -- { -- cast_type result; -- std::memcpy(&result, &data, sizeof(cast_type)); -- return result; -- } -- -- namespace detail { -- template -- inline void -- find_extremes(RandomAccessIter current, RandomAccessIter last, div_type & max, div_type & min, right_shift shift) -- { -- min = max = shift(*current, 0); -- while(++current < last) { -- div_type value = shift(*current, 0); -- if(max < value) -- max = value; -- else if(value < min) -- min = value; -- } -- } -- -- //Specialized swap loops for floating-point casting -- template -- inline void inner_float_swap_loop(RandomAccessIter * bins, const RandomAccessIter & nextbinstart, unsigned ii -- , const unsigned log_divisor, const div_type div_min) -- { -- RandomAccessIter * local_bin = bins + ii; -- for(RandomAccessIter current = *local_bin; current < nextbinstart; ++current) { -- for(RandomAccessIter * target_bin = (bins + ((cast_float_iter(current) >> log_divisor) - div_min)); target_bin != local_bin; -- target_bin = bins + ((cast_float_iter(current) >> log_divisor) - div_min)) { -- data_type tmp; -- RandomAccessIter b = (*target_bin)++; -- RandomAccessIter * b_bin = bins + ((cast_float_iter(b) >> log_divisor) - div_min); -- //Three-way swap; if the item to be swapped doesn't belong in the current bin, swap it to where it belongs -- if (b_bin != local_bin) { -- RandomAccessIter c = (*b_bin)++; -- tmp = *c; -- *c = *b; -- } -- else -- tmp = *b; -- *b = *current; -- *current = tmp; -- } -- } -- *local_bin = nextbinstart; -- } -- -- template -- inline void float_swap_loop(RandomAccessIter * bins, RandomAccessIter & nextbinstart, unsigned ii -- , const std::vector &bin_sizes, const unsigned log_divisor, const div_type div_min) -- { -- nextbinstart += bin_sizes[ii]; -- inner_float_swap_loop(bins, nextbinstart, ii, log_divisor, div_min); -- } -- -- template -- inline void -- find_extremes(RandomAccessIter current, RandomAccessIter last, cast_type & max, cast_type & min) -- { -- min = max = cast_float_iter(current); -- while(++current < last) { -- cast_type value = cast_float_iter(current); -- if(max < value) -- max = value; -- else if(value < min) -- min = value; -- } -- } -- -- //Special-case sorting of positive floats with casting instead of a right_shift -- template -- inline void -- positive_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector &bin_cache, unsigned cache_offset -- , std::vector &bin_sizes) -- { -- div_type max, min; -- find_extremes(first, last, max, min); -- if(max == min) -- return; -- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); -- div_type div_min = min >> log_divisor; -- div_type div_max = max >> log_divisor; -- unsigned bin_count = div_max - div_min + 1; -- unsigned cache_end; -- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); -- -- //Calculating the size of each bin -- for (RandomAccessIter current = first; current != last;) -- bin_sizes[(cast_float_iter(current++) >> log_divisor) - div_min]++; -- bins[0] = first; -- for(unsigned u = 0; u < bin_count - 1; u++) -- bins[u + 1] = bins[u] + bin_sizes[u]; -- -- //Swap into place -- RandomAccessIter nextbinstart = first; -- for(unsigned u = 0; u < bin_count - 1; ++u) -- float_swap_loop(bins, nextbinstart, u, bin_sizes, log_divisor, div_min); -- bins[bin_count - 1] = last; -- -- //Return if we've completed bucketsorting -- if(!log_divisor) -- return; -- -- //Recursing -- size_t max_count = get_max_count(log_divisor, last - first); -- RandomAccessIter lastPos = first; -- for(unsigned u = cache_offset; u < cache_end; lastPos = bin_cache[u], ++u) { -- size_t count = bin_cache[u] - lastPos; -- if(count < 2) -- continue; -- if(count < max_count) -- std::sort(lastPos, bin_cache[u]); -- else -- positive_float_sort_rec(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes); -- } -- } -- -- //Sorting negative_ float_s -- //Note that bins are iterated in reverse order because max_neg_float = min_neg_int -- template -- inline void -- negative_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector &bin_cache, unsigned cache_offset -- , std::vector &bin_sizes) -- { -- div_type max, min; -- find_extremes(first, last, max, min); -- if(max == min) -- return; -- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); -- div_type div_min = min >> log_divisor; -- div_type div_max = max >> log_divisor; -- unsigned bin_count = div_max - div_min + 1; -- unsigned cache_end; -- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); -- -- //Calculating the size of each bin -- for (RandomAccessIter current = first; current != last;) -- bin_sizes[(cast_float_iter(current++) >> log_divisor) - div_min]++; -- bins[bin_count - 1] = first; -- for(int ii = bin_count - 2; ii >= 0; --ii) -- bins[ii] = bins[ii + 1] + bin_sizes[ii + 1]; -- -- //Swap into place -- RandomAccessIter nextbinstart = first; -- //The last bin will always have the correct elements in it -- for(int ii = bin_count - 1; ii > 0; --ii) -- float_swap_loop(bins, nextbinstart, ii, bin_sizes, log_divisor, div_min); -- //Since we don't process the last bin, we need to update its end position -- bin_cache[cache_offset] = last; -- -- //Return if we've completed bucketsorting -- if(!log_divisor) -- return; -- -- //Recursing -- size_t max_count = get_max_count(log_divisor, last - first); -- RandomAccessIter lastPos = first; -- for(int ii = cache_end - 1; ii >= (int)cache_offset; lastPos = bin_cache[ii], --ii) { -- size_t count = bin_cache[ii] - lastPos; -- if(count < 2) -- continue; -- if(count < max_count) -- std::sort(lastPos, bin_cache[ii]); -- else -- negative_float_sort_rec(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes); -- } -- } -- -- //Sorting negative_ float_s -- //Note that bins are iterated in reverse order because max_neg_float = min_neg_int -- template -- inline void -- negative_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector &bin_cache, unsigned cache_offset -- , std::vector &bin_sizes, right_shift shift) -- { -- div_type max, min; -- find_extremes(first, last, max, min, shift); -- if(max == min) -- return; -- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); -- div_type div_min = min >> log_divisor; -- div_type div_max = max >> log_divisor; -- unsigned bin_count = div_max - div_min + 1; -- unsigned cache_end; -- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); -- -- //Calculating the size of each bin -- for (RandomAccessIter current = first; current != last;) -- bin_sizes[shift(*(current++), log_divisor) - div_min]++; -- bins[bin_count - 1] = first; -- for(int ii = bin_count - 2; ii >= 0; --ii) -- bins[ii] = bins[ii + 1] + bin_sizes[ii + 1]; -- -- //Swap into place -- RandomAccessIter nextbinstart = first; -- //The last bin will always have the correct elements in it -- for(int ii = bin_count - 1; ii > 0; --ii) -- swap_loop(bins, nextbinstart, ii, shift, bin_sizes, log_divisor, div_min); -- //Since we don't process the last bin, we need to update its end position -- bin_cache[cache_offset] = last; -- -- //Return if we've completed bucketsorting -- if(!log_divisor) -- return; -- -- //Recursing -- size_t max_count = get_max_count(log_divisor, last - first); -- RandomAccessIter lastPos = first; -- for(int ii = cache_end - 1; ii >= (int)cache_offset; lastPos = bin_cache[ii], --ii) { -- size_t count = bin_cache[ii] - lastPos; -- if(count < 2) -- continue; -- if(count < max_count) -- std::sort(lastPos, bin_cache[ii]); -- else -- negative_float_sort_rec(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift); -- } -- } -- -- template -- inline void -- negative_float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector &bin_cache, unsigned cache_offset -- , std::vector &bin_sizes, right_shift shift, compare comp) -- { -- div_type max, min; -- find_extremes(first, last, max, min, shift); -- if(max == min) -- return; -- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); -- div_type div_min = min >> log_divisor; -- div_type div_max = max >> log_divisor; -- unsigned bin_count = div_max - div_min + 1; -- unsigned cache_end; -- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); -- -- //Calculating the size of each bin -- for (RandomAccessIter current = first; current != last;) -- bin_sizes[shift(*(current++), log_divisor) - div_min]++; -- bins[bin_count - 1] = first; -- for(int ii = bin_count - 2; ii >= 0; --ii) -- bins[ii] = bins[ii + 1] + bin_sizes[ii + 1]; -- -- //Swap into place -- RandomAccessIter nextbinstart = first; -- //The last bin will always have the correct elements in it -- for(int ii = bin_count - 1; ii > 0; --ii) -- swap_loop(bins, nextbinstart, ii, shift, bin_sizes, log_divisor, div_min); -- //Since we don't process the last bin, we need to update its end position -- bin_cache[cache_offset] = last; -- -- //Return if we've completed bucketsorting -- if(!log_divisor) -- return; -- -- //Recursing -- size_t max_count = get_max_count(log_divisor, last - first); -- RandomAccessIter lastPos = first; -- for(int ii = cache_end - 1; ii >= (int)cache_offset; lastPos = bin_cache[ii], --ii) { -- size_t count = bin_cache[ii] - lastPos; -- if(count < 2) -- continue; -- if(count < max_count) -- std::sort(lastPos, bin_cache[ii], comp); -- else -- negative_float_sort_rec(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes, shift, comp); -- } -- } -- -- //Casting special-case for floating-point sorting -- template -- inline void -- float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector &bin_cache, unsigned cache_offset -- , std::vector &bin_sizes) -- { -- div_type max, min; -- find_extremes(first, last, max, min); -- if(max == min) -- return; -- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); -- div_type div_min = min >> log_divisor; -- div_type div_max = max >> log_divisor; -- unsigned bin_count = div_max - div_min + 1; -- unsigned cache_end; -- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); -- -- //Calculating the size of each bin -- for (RandomAccessIter current = first; current != last;) -- bin_sizes[(cast_float_iter(current++) >> log_divisor) - div_min]++; -- //The index of the first positive bin -- div_type first_positive = (div_min < 0) ? -div_min : 0; -- //Resetting if all bins are negative -- if(cache_offset + first_positive > cache_end) -- first_positive = cache_end - cache_offset; -- //Reversing the order of the negative bins -- //Note that because of the negative/positive ordering direction flip -- //We can not depend upon bin order and positions matching up -- //so bin_sizes must be reused to contain the end of the bin -- if(first_positive > 0) { -- bins[first_positive - 1] = first; -- for(int ii = first_positive - 2; ii >= 0; --ii) { -- bins[ii] = first + bin_sizes[ii + 1]; -- bin_sizes[ii] += bin_sizes[ii + 1]; -- } -- //Handling positives following negatives -- if((unsigned)first_positive < bin_count) { -- bins[first_positive] = first + bin_sizes[0]; -- bin_sizes[first_positive] += bin_sizes[0]; -- } -- } -- else -- bins[0] = first; -- for(unsigned u = first_positive; u < bin_count - 1; u++) { -- bins[u + 1] = first + bin_sizes[u]; -- bin_sizes[u + 1] += bin_sizes[u]; -- } -- -- //Swap into place -- RandomAccessIter nextbinstart = first; -- for(unsigned u = 0; u < bin_count; ++u) { -- nextbinstart = first + bin_sizes[u]; -- inner_float_swap_loop(bins, nextbinstart, u, log_divisor, div_min); -- } -- -- if(!log_divisor) -- return; -- -- //Handling negative values first -- size_t max_count = get_max_count(log_divisor, last - first); -- RandomAccessIter lastPos = first; -- for(int ii = cache_offset + first_positive - 1; ii >= (int)cache_offset ; lastPos = bin_cache[ii--]) { -- size_t count = bin_cache[ii] - lastPos; -- if(count < 2) -- continue; -- if(count < max_count) -- std::sort(lastPos, bin_cache[ii]); -- //sort negative values using reversed-bin spread_sort -- else -- negative_float_sort_rec(lastPos, bin_cache[ii], bin_cache, cache_end, bin_sizes); -- } -- -- for(unsigned u = cache_offset + first_positive; u < cache_end; lastPos = bin_cache[u], ++u) { -- size_t count = bin_cache[u] - lastPos; -- if(count < 2) -- continue; -- if(count < max_count) -- std::sort(lastPos, bin_cache[u]); -- //sort positive values using normal spread_sort -- else -- positive_float_sort_rec(lastPos, bin_cache[u], bin_cache, cache_end, bin_sizes); -- } -- } -- -- //Functor implementation for recursive sorting -- template -- inline void -- float_sort_rec(RandomAccessIter first, RandomAccessIter last, std::vector &bin_cache, unsigned cache_offset -- , std::vector &bin_sizes, right_shift shift) -- { -- div_type max, min; -- find_extremes(first, last, max, min, shift); -- if(max == min) -- return; -- unsigned log_divisor = get_log_divisor(last - first, rough_log_2_size((size_t)(max) - min)); -- div_type div_min = min >> log_divisor; -- div_type div_max = max >> log_divisor; -- unsigned bin_count = div_max - div_min + 1; -- unsigned cache_end; -- RandomAccessIter * bins = size_bins(bin_sizes, bin_cache, cache_offset, cache_end, bin_count); -- -- //Calculating the size of each bin -- for (RandomAccessIter current = first; current != last;) -- bin_sizes[shift(*(current++), log_divisor) - div_min]++; -- //The index of the first positive bin -- div_type first_positive = (div_min < 0) ? -div_min : 0; -- //Resetting if all bins are negative -- if(cache_offset + first_positive > cache_end) -- first_positive = cache_end - cache_offset; -- //Reversing the order of the negative bins -- //Note that because of the negative/positive ordering direction flip -- //We can not depend upon bin order and positions matching up -- //so bin_sizes must be reused to contain the end of the bin -- if(first_positive > 0) { -- bins[first_posit