├── xenial.md ├── firefox-esr.mozconfig ├── mozconfig.trusty ├── mozconfig ├── esr.md ├── mozconfig.xenial ├── trusty.md ├── armhf.patch ├── esr.patch ├── README.md └── gcc-4.8-trusty.patch /xenial.md: -------------------------------------------------------------------------------- 1 | # Cross-compiling Firefox for armhf with clang (xenial) 2 | 3 | For targeting Ubuntu 16.04 Xenial, start an `ubuntu:xenial` 4 | Docker container then for the most follow the main **README.md** 5 | using instructions similar to Stretch: 6 | 7 | For Xenial armhf sources, add these lines to your `sources.list`. 8 | 9 | deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe 10 | deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe 11 | 12 | Use the slightly modified `mozconfig.xenial`: 13 | 14 | cp path/to/firefox-armhf/mozconfig.xenial mozconfig 15 | 16 | then edit to paths to match your home directory. Note the 17 | --enable-crashreporter flag. Without it, the final packaging 18 | step may complain about missing `usr/lib/firefox/crashreporter`. 19 | -------------------------------------------------------------------------------- /firefox-esr.mozconfig: -------------------------------------------------------------------------------- 1 | # Please don't use this mozconfig unless you are planning to build 2 | # packages for Debian or a derivative. 3 | . $topsrcdir/browser/config/mozconfig 4 | CC=clang-3.9 5 | CXX=clang++-3.9 6 | ac_add_options --host=x86_64-linux-gnu 7 | ac_add_options --target=arm-linux-gnueabihf 8 | ac_add_options --enable-optimize="-O2 -march=armv7-a -mfloat-abi=hard" 9 | ac_add_options --disable-elf-hack 10 | ac_add_options --with-app-name=firefox-esr 11 | ac_add_options --enable-release 12 | ac_add_options --prefix=/usr 13 | ac_add_options --enable-default-toolkit=cairo-gtk3 14 | ac_add_options --with-google-api-keyfile=$topsrcdir/debian/google.key 15 | ac_add_options --with-mozilla-api-keyfile=$topsrcdir/debian/mls.key 16 | ac_add_options --with-system-zlib # MOZ_SYSTEM_ZLIB=1 17 | ac_add_options --with-system-bz2 # MOZ_SYSTEM_BZ2=1 18 | ac_add_options --disable-gconf 19 | ac_add_options --enable-readline 20 | ac_add_options --disable-strip 21 | ac_add_options --disable-install-strip 22 | ac_add_options --enable-startup-notification 23 | ac_add_options --enable-system-ffi # MOZ_SYSTEM_FFI=1 24 | ac_add_options --with-system-libvpx # MOZ_SYSTEM_LIBVPX=1 25 | ac_add_options --disable-updater 26 | ac_add_options --enable-pie 27 | ac_add_options --with-unsigned-addon-scopes=app,system 28 | ac_add_options --enable-alsa 29 | -------------------------------------------------------------------------------- /mozconfig.trusty: -------------------------------------------------------------------------------- 1 | CC=clang-3.9 2 | CXX=clang++-3.9 3 | ac_add_options --host=x86_64-linux-gnu 4 | ac_add_options --target=arm-linux-gnueabihf 5 | ac_add_options --prefix=/usr 6 | ac_add_options --with-l10n-base=/home/youruserid/firefox-65.0+build2/./l10n 7 | mk_add_options MOZ_OBJDIR=/home/youruserid/firefox-65.0+build2/./obj-arm-linux-gnueabihf 8 | ac_add_options --enable-release 9 | ac_add_options --disable-gconf 10 | ac_add_options --disable-install-strip 11 | ac_add_options --disable-updater 12 | ac_add_options --enable-application=browser 13 | ac_add_options --enable-startup-notification 14 | ac_add_options --with-distribution-id=com.ubuntu 15 | ac_add_options --enable-debug-symbols 16 | # See https://launchpad.net/bugs/1711337 17 | ac_add_options --enable-optimize="-O2 -march=armv7-a -mfloat-abi=hard -I/usr/arm-linux-gnueabihf/include/c++/4.8.4/arm-linux-gnueabihf" 18 | mk_add_options MOZ_MAKE_FLAGS=-j8 19 | ac_add_options --enable-tests 20 | ac_add_options --enable-crashreporter 21 | ac_add_options --enable-official-branding 22 | ac_add_options --enable-update-channel=release 23 | ac_add_options --disable-debug 24 | ac_add_options --disable-elf-hack 25 | ac_add_options --with-ua-vendor=Ubuntu 26 | mk_add_options "export CBINDGEN=/home/youruserid/firefox-65.0+build2/./cbindgen/bin/cbindgen" 27 | mk_add_options "export NODEJS=/usr/bin/node" 28 | ac_add_options --with-unsigned-addon-scopes=app 29 | # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . 30 | # Note: these are for Ubuntu use ONLY. For your own distribution, 31 | # please get your own set of keys. 32 | # Included with permission from Paweł Hajdan. 33 | # Feel free to contact Chad Miller (chad.miller@canonical.com) or Chris 34 | # Coulson (chris.coulson@canonical.com) for more info 35 | ac_add_options --with-google-api-keyfile=/home/youruserid/firefox-65.0+build2/debian/ga 36 | ac_add_options --enable-stdcxx-compat 37 | -------------------------------------------------------------------------------- /mozconfig: -------------------------------------------------------------------------------- 1 | CC=clang-3.9 2 | CXX=clang++-3.9 3 | ac_add_options --host=x86_64-linux-gnu 4 | ac_add_options --target=arm-linux-gnueabihf 5 | ac_add_options --prefix=/usr 6 | ac_add_options --with-l10n-base=/home/youruserid/firefox-65.0+build2/./l10n 7 | mk_add_options MOZ_OBJDIR=/home/youruserid/firefox-65.0+build2/./obj-arm-linux-gnueabihf 8 | ac_add_options --enable-release 9 | ac_add_options --disable-gconf 10 | ac_add_options --disable-install-strip 11 | ac_add_options --disable-updater 12 | ac_add_options --enable-application=browser 13 | ac_add_options --enable-startup-notification 14 | ac_add_options --with-distribution-id=org.debian 15 | ac_add_options --enable-debug-symbols 16 | # See https://launchpad.net/bugs/1711337 17 | ac_add_options --enable-optimize="-O2 -march=armv7-a -mfloat-abi=hard" 18 | mk_add_options MOZ_MAKE_FLAGS=-j8 19 | ac_add_options --enable-tests 20 | ac_add_options --disable-crashreporter 21 | mk_add_options "export CBINDGEN=/home/youruserid/firefox-65.0+build2/./cbindgen/bin/cbindgen" 22 | mk_add_options "export NODEJS=/usr/bin/nodejs" 23 | mk_add_options "export HOME=/home/youruserid" 24 | mk_add_options "export SHELL=/bin/bash" 25 | mk_add_options "export MOZBUILD_STATE_PATH=/home/youruserid/.mozbuild" 26 | ac_add_options --with-unsigned-addon-scopes=app 27 | ac_add_options --enable-official-branding 28 | ac_add_options --enable-update-channel=release 29 | ac_add_options --disable-debug 30 | ac_add_options --disable-elf-hack 31 | ac_add_options --with-ua-vendor=Debian 32 | # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . 33 | # Note: these are for Ubuntu use ONLY. For your own distribution, 34 | # please get your own set of keys. 35 | # Included with permission from Paweł Hajdan. 36 | # Feel free to contact Chad Miller (chad.miller@canonical.com) or Chris 37 | # Coulson (chris.coulson@canonical.com) for more info 38 | ac_add_options --with-google-api-keyfile=/home/youruserid/firefox-65.0+build2/debian/ga 39 | -------------------------------------------------------------------------------- /esr.md: -------------------------------------------------------------------------------- 1 | # Cross-compiling Firefox ESR for armhf with clang (stretch) 2 | 3 | The main **README.md** focuses on building the latest release of 4 | Firefox for Stretch, while this document is specific to Firefox 5 | ESR while still targeting Stretch. 6 | 7 | In a Debian Stetch Docker container, install all the dependencies 8 | as listed in **README.md**, including rustup and its armv7-unknown-linux-gnueabihf target. 9 | 10 | In addition, libffi-dev:armhf seems to be required for ESR. 11 | 12 | sudo apt install libffi-dev:armhf 13 | 14 | Next, add sources from debian-security to your `/etc/apt/sources.list` 15 | 16 | deb-src http://security.debian.org/ stretch/updates main contrib non-free 17 | 18 | Then: 19 | 20 | sudo apt update 21 | apt-get source firefox-esr:armhf 22 | cd firefox-esr-* 23 | 24 | Going back to Firefox 60.5 restores bugs that were fixed some time ago. 25 | Also as this is not from Ubuntu sources, I ended up hitting 26 | issues that may be due to hacks in Debian-specific patches. In any case, 27 | I lumped all the workarounds together in `esr.patch`. 28 | 29 | patch -p1 < path/to/firefox-armhf/esr.patch 30 | 31 | It seems the PYTHON and SHELL variables are practically required now. 32 | At this point there are so many environment variables that it makes 33 | sense to export all of them into the local shell. 34 | 35 | export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig 36 | export CONFIG_SITE=/etc/dpkg-cross/cross-config.amd64 37 | export DEB_BUILD_OPTIONS=nocheck 38 | export PYTHON=/usr/bin/python 39 | export SHELL=/bin/bash 40 | 41 | Then attempt to build: 42 | 43 | dpkg-buildpackage -aarmhf -b -d 44 | 45 | It'll fail due to an architecture mismatch in mozconfig which 46 | is now called `debian/firefox-esr.mozconfig`. Use the provided 47 | custom one. 48 | 49 | cp path/to/firefox-armhf/firefox-esr.mozconfig debian/ 50 | 51 | Then continue the build: 52 | 53 | dpkg-buildpackage -aarmhf -b -d -nc 54 | -------------------------------------------------------------------------------- /mozconfig.xenial: -------------------------------------------------------------------------------- 1 | CC=clang-3.9 2 | CXX=clang++-3.9 3 | ac_add_options --host=x86_64-linux-gnu 4 | ac_add_options --target=arm-linux-gnueabihf 5 | ac_add_options --prefix=/usr 6 | ac_add_options --with-l10n-base=/home/youruserid/firefox-65.0+build2/./l10n 7 | mk_add_options MOZ_OBJDIR=/home/youruserid/firefox-65.0+build2/./obj-arm-linux-gnueabihf 8 | ac_add_options --enable-release 9 | ac_add_options --disable-gconf 10 | ac_add_options --disable-install-strip 11 | ac_add_options --disable-updater 12 | ac_add_options --enable-application=browser 13 | ac_add_options --enable-startup-notification 14 | ac_add_options --with-distribution-id=com.ubuntu 15 | ac_add_options --enable-debug-symbols 16 | # See https://launchpad.net/bugs/1711337 17 | ac_add_options --enable-optimize="-O2 -march=armv7-a -mfloat-abi=hard" 18 | mk_add_options MOZ_MAKE_FLAGS=-j8 19 | ac_add_options --enable-tests 20 | ac_add_options --enable-crashreporter 21 | mk_add_options "export CBINDGEN=/home/youruserid/firefox-65.0+build2/./cbindgen/bin/cbindgen" 22 | mk_add_options "export NODEJS=/usr/bin/nodejs" 23 | mk_add_options "export HOME=/home/youruserid" 24 | mk_add_options "export SHELL=/bin/bash" 25 | mk_add_options "export MOZBUILD_STATE_PATH=/home/youruserid/.mozbuild" 26 | ac_add_options --with-unsigned-addon-scopes=app 27 | ac_add_options --enable-official-branding 28 | ac_add_options --enable-update-channel=release 29 | ac_add_options --disable-debug 30 | ac_add_options --disable-elf-hack 31 | ac_add_options --with-ua-vendor=Ubuntu 32 | # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . 33 | # Note: these are for Ubuntu use ONLY. For your own distribution, 34 | # please get your own set of keys. 35 | # Included with permission from Paweł Hajdan. 36 | # Feel free to contact Chad Miller (chad.miller@canonical.com) or Chris 37 | # Coulson (chris.coulson@canonical.com) for more info 38 | ac_add_options --with-google-api-keyfile=/home/youruserid/firefox-65.0+build2/debian/ga 39 | ac_add_options --enable-stdcxx-compat 40 | -------------------------------------------------------------------------------- /trusty.md: -------------------------------------------------------------------------------- 1 | # Cross-compiling Firefox for armhf with clang (trusty) 2 | 3 | The main **README.md** describes how to cross-compile from an amd64 4 | Debian Stretch container. Read that first, then for specifics on 5 | building for Ubuntu 14.04 Trusty see these add-on notes. A Trusty 6 | binary is the most portable (run it on Xenial or even Stretch). 7 | 8 | Instead of adding Bionic sources, make sure your existing sources.list 9 | contains the expected Trusty ports. 10 | 11 | deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted 12 | deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted 13 | deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted 14 | deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted 15 | deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty universe 16 | deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty universe 17 | deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe 18 | deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe 19 | deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty multiverse 20 | deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty multiverse 21 | deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates multiverse 22 | deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ trusty-updates multiverse 23 | 24 | Then sudo apt update and install the many packages listed in README in addition 25 | to **rustup** and **node** version 11. 26 | 27 | Python 3.4 is the default on Trusty, but Firefox's build process requires 3.5 or newer. 28 | 29 | sudo apt install python3.5 30 | 31 | We can use the same big patchfile used for Stretch: 32 | 33 | patch -p1 < path/to/firefox-armhf/armhf.patch 34 | 35 | For clang to use old gcc headers, you must apply a *system-level* libstdc++ patch: 36 | 37 | (cd / && sudo patch -p1 < path/to/firefox-armhf/gcc-4.8-trusty.patch) 38 | 39 | Get Firefox source: 40 | 41 | apt-get source firefox:armhf 42 | cd firefox-* 43 | 44 | Build: 45 | 46 | PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig \ 47 | CONFIG_SITE=/etc/dpkg-cross/cross-config.amd64 \ 48 | DEB_BUILD_OPTIONS=nocheck \ 49 | dpkg-buildpackage -aarmhf -b -d 50 | 51 | After configuration errors, replace mozconfig with `mozconfig.trusty` 52 | and edit paths. It's similar to the included mozconfig except s/6.3.0/4.8.4/ 53 | 54 | PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig \ 55 | CONFIG_SITE=/etc/dpkg-cross/cross-config.amd64 \ 56 | DEB_BUILD_OPTIONS=nocheck \ 57 | dpkg-buildpackage -aarmhf -b -d -nc 58 | 59 | This will likely encounter the shlibsign error so work around that 60 | just as described in **README.md**. 61 | 62 | The final build step might complain about missing files from debian/tmp, which 63 | is frustrating as the build process nukes the tmp subfolder. To get past that, 64 | try pausing with Ctrl+Z followed by: 65 | 66 | mkdir -p debian/tmp/usr/lib 67 | cp -rpf obj-arm-linux-gnueabihf/dist/* debian/tmp/usr/lib 68 | 69 | Then bring the incremental build back into the foreground with: 70 | 71 | fg 72 | -------------------------------------------------------------------------------- /armhf.patch: -------------------------------------------------------------------------------- 1 | diff --git a/debian/build/rules.mk b/debian/build/rules.mk 2 | index 0681341..40e7c89 100644 3 | --- a/debian/build/rules.mk 4 | +++ b/debian/build/rules.mk 5 | @@ -124,7 +124,6 @@ DEB_MAKE_ENVVARS += CXX=$(CURDIR)/debian/gcc-mozilla/g++ 6 | DEB_MAKE_ENVVARS += PATH=$(CURDIR)/debian/gcc-mozilla:$$PATH 7 | DEB_MAKE_ENVVARS += CPLUS_INCLUDE_PATH=/usr/lib/gcc-mozilla/include/c++/6:/usr/lib/gcc-mozilla/include/c++/6/$(DEB_HOST_GNU_TYPE) 8 | 9 | -export HOME=/tmp 10 | export SHELL=/bin/bash 11 | export NO_PNG_PKG_MANGLE=1 12 | export DEB_BUILD_HARDENING=1 13 | diff --git a/debian/rules b/debian/rules 14 | index 4dba05d..daf521b 100755 15 | --- a/debian/rules 16 | +++ b/debian/rules 17 | @@ -60,10 +60,12 @@ include $(CURDIR)/debian/build/rules.mk 18 | $(NULL) 19 | 20 | debian/usr.bin.firefox.in: 21 | - if [ '$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)' -ge '1410' ]; then \ 22 | + if [ '$(DISTRIB_VERSION_MAJOR)' -eq '9' ] || [ '$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)' -ge '1410' ]; then \ 23 | cp $(CURDIR)/debian/usr.bin.firefox.apparmor.14.10 $(CURDIR)/debian/usr.bin.firefox.in ; \ 24 | elif [ '$(DISTRIB_VERSION_MAJOR)$(DISTRIB_VERSION_MINOR)' -ge '1310' ]; then \ 25 | cp $(CURDIR)/debian/usr.bin.firefox.apparmor.13.10 $(CURDIR)/debian/usr.bin.firefox.in ; \ 26 | + else \ 27 | + echo "If this line is reached, unsupported config failing miserably unable to find usr.bin.firefox.in"; \ 28 | fi 29 | 30 | WRITE_SUBSTVARS = $(shell echo "$(2)=$(3)" | sed 's/[ \t\n]\+/ /g' >> debian/$(1).substvars) 31 | diff --git a/media/libwebp/src/dsp/moz.build b/media/libwebp/src/dsp/moz.build 32 | index 49ab4a1..079714f 100644 33 | --- a/media/libwebp/src/dsp/moz.build 34 | +++ b/media/libwebp/src/dsp/moz.build 35 | @@ -22,7 +22,7 @@ LOCAL_INCLUDES += [ 36 | '/media/libwebp', 37 | ] 38 | 39 | -if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']: 40 | +if CONFIG['CPU_ARCH'] == 'arm': 41 | SOURCES += [ 42 | 'alpha_processing_neon.c', 43 | 'dec_neon.c', 44 | diff --git a/media/webrtc/trunk/webrtc/common_audio/common_audio_c_arm_asm_gn/moz.build b/media/webrtc/trunk/webrtc/common_audio/common_audio_c_arm_asm_gn/moz.build 45 | index ca041b5..3ed0f78 100644 46 | --- a/media/webrtc/trunk/webrtc/common_audio/common_audio_c_arm_asm_gn/moz.build 47 | +++ b/media/webrtc/trunk/webrtc/common_audio/common_audio_c_arm_asm_gn/moz.build 48 | @@ -132,6 +132,10 @@ if CONFIG["CPU_ARCH"] == "arm": 49 | DEFINES["WEBRTC_ARCH_ARM_V7"] = True 50 | DEFINES["WEBRTC_HAS_NEON"] = True 51 | 52 | + ASFLAGS += [ 53 | + "-march=armv7-a" 54 | + ] 55 | + 56 | SOURCES += [ 57 | "/media/webrtc/trunk/webrtc/common_audio/signal_processing/complex_bit_reverse_arm.S", 58 | "/media/webrtc/trunk/webrtc/common_audio/signal_processing/filter_ar_fast_q12_armv7.S", 59 | diff --git a/media/webrtc/trunk/webrtc/common_audio/common_audio_c_gn/moz.build b/media/webrtc/trunk/webrtc/common_audio/common_audio_c_gn/moz.build 60 | index 2c9e630..b9e0a96 100644 61 | --- a/media/webrtc/trunk/webrtc/common_audio/common_audio_c_gn/moz.build 62 | +++ b/media/webrtc/trunk/webrtc/common_audio/common_audio_c_gn/moz.build 63 | @@ -212,6 +212,10 @@ if CONFIG["CPU_ARCH"] == "arm": 64 | "-mfpu=neon" 65 | ] 66 | 67 | + ASFLAGS += [ 68 | + "-march=armv7-a" 69 | + ] 70 | + 71 | DEFINES["WEBRTC_ARCH_ARM"] = True 72 | DEFINES["WEBRTC_ARCH_ARM_V7"] = True 73 | DEFINES["WEBRTC_HAS_NEON"] = True 74 | diff --git a/security/manager/ssl/OSKeyStore.cpp b/security/manager/ssl/OSKeyStore.cpp 75 | index f22475e..0a08408 100644 76 | --- a/security/manager/ssl/OSKeyStore.cpp 77 | +++ b/security/manager/ssl/OSKeyStore.cpp 78 | @@ -712,7 +712,7 @@ nsresult AbstractOSKeyStore::DoCipher(const UniquePK11SymKey& aSymKey, 79 | &outLen, inBytes.size() + blockLength, inBytes.data(), 80 | inBytes.size()); 81 | // Prepend the used IV to the ciphertext. 82 | - Unused << outBytes.insert(outBytes.begin(), ivp, ivp + mIVLength); 83 | + outBytes.insert(outBytes.begin(), ivp, ivp + mIVLength); 84 | outLen += mIVLength; 85 | } else { 86 | // Remove the IV from the input. 87 | diff --git a/servo/components/style/build_gecko.rs b/servo/components/style/build_gecko.rs 88 | index 4b5d362..4ca6925 100644 89 | --- a/servo/components/style/build_gecko.rs 90 | +++ b/servo/components/style/build_gecko.rs 91 | @@ -139,7 +139,9 @@ mod bindings { 92 | 93 | // Disable rust unions, because we replace some types inside of 94 | // them. 95 | - let mut builder = Builder::default().rust_target(RustTarget::Stable_1_0); 96 | + let mut builder = Builder::default().rust_target(RustTarget::Stable_1_0) 97 | + .clang_arg("-target") 98 | + .clang_arg("arm-linux-gnueabihf"); 99 | 100 | let rustfmt_path = env::var_os("RUSTFMT") 101 | // This can be replaced with 102 | -------------------------------------------------------------------------------- /esr.patch: -------------------------------------------------------------------------------- 1 | diff --git a/build/moz.configure/util.configure b/build/moz.configure/util.configure 2 | index 3284fd8..f73de39 100644 3 | --- a/build/moz.configure/util.configure 4 | +++ b/build/moz.configure/util.configure 5 | @@ -182,6 +182,10 @@ def find_program(file, paths=None): 6 | else: 7 | exts = None 8 | 9 | + if file.endswith(' -B'): 10 | + log.info('workaround for which(\'python -B\')') 11 | + file = file[:-3] 12 | + 13 | try: 14 | if is_absolute_or_relative(file): 15 | return normalize_path(which(os.path.basename(file), 16 | diff --git a/debian/browser.install.in b/debian/browser.install.in 17 | index 75c4654..e8ca1d0 100644 18 | --- a/debian/browser.install.in 19 | +++ b/debian/browser.install.in 20 | @@ -16,15 +16,12 @@ usr/lib/@browser@/libplc4.so 21 | usr/lib/@browser@/libplds4.so 22 | %endif 23 | %ifndef USE_SYSTEM_NSS 24 | -usr/lib/@browser@/libfreeblpriv3.chk 25 | usr/lib/@browser@/libfreeblpriv3.so 26 | usr/lib/@browser@/libnss3.so 27 | usr/lib/@browser@/libnssckbi.so 28 | usr/lib/@browser@/libnssdbm3.so 29 | usr/lib/@browser@/libnssutil3.so 30 | -usr/lib/@browser@/libnssdbm3.chk 31 | usr/lib/@browser@/libsmime3.so 32 | -usr/lib/@browser@/libsoftokn3.chk 33 | usr/lib/@browser@/libsoftokn3.so 34 | usr/lib/@browser@/libssl3.so 35 | %endif 36 | diff --git a/debian/rules b/debian/rules 37 | index 275f1f9..e021fe5 100755 38 | --- a/debian/rules 39 | +++ b/debian/rules 40 | @@ -116,15 +116,6 @@ ifeq (default,$(origin CXX)) 41 | CXX := g++ 42 | endif 43 | 44 | -ifneq (,$(findstring gcc,$(CC))) 45 | -ifeq (,$(filter 4.% 5.%,$(shell $(CC) -dumpversion))) 46 | -CFLAGS += -fno-schedule-insns2 -fno-lifetime-dse -fno-delete-null-pointer-checks 47 | -ifneq (,$(filter armel armhf,$(DEB_HOST_ARCH))) 48 | -CFLAGS += -fno-schedule-insns 49 | -endif 50 | -endif 51 | -endif 52 | - 53 | CXXFLAGS = $(CFLAGS) 54 | 55 | ifeq ($(DEB_HOST_ARCH_ENDIAN),big) 56 | @@ -307,7 +298,7 @@ debian/$($(PRODUCT))-symbolic.svg: browser/extensions/onboarding/content/img/wat 57 | cat $< > $@ 58 | 59 | stamps/dh_install:: debian/noinstall debian/$($(PRODUCT))-symbolic.svg 60 | - awk '{print "debian/tmp/" $$1 }' < debian/noinstall | xargs rm -r 61 | + awk '{print "debian/tmp/" $$1 }' < debian/noinstall | xargs rm -rf 62 | dh_install --fail-missing 63 | 64 | override_dh_install: stamps/dh_install 65 | diff --git a/media/libpng/moz.build b/media/libpng/moz.build 66 | index 6be9171..abe06cf 100644 67 | --- a/media/libpng/moz.build 68 | +++ b/media/libpng/moz.build 69 | @@ -66,7 +66,4 @@ FINAL_LIBRARY = 'gkmedias' 70 | AllowCompilerWarnings() 71 | 72 | if CONFIG['CC_TYPE'] in ('clang', 'gcc'): 73 | - if CONFIG['OS_ARCH'] == 'WINNT': 74 | - CFLAGS += ['-std=gnu89'] 75 | - else: 76 | - CFLAGS += ['-std=c89'] 77 | + CFLAGS += ['-std=gnu89'] 78 | diff --git a/media/webrtc/trunk/webrtc/common_audio/common_audio_c_gn/moz.build b/media/webrtc/trunk/webrtc/common_audio/common_audio_c_gn/moz.build 79 | index 97bf581..0cecd17 100644 80 | --- a/media/webrtc/trunk/webrtc/common_audio/common_audio_c_gn/moz.build 81 | +++ b/media/webrtc/trunk/webrtc/common_audio/common_audio_c_gn/moz.build 82 | @@ -513,6 +513,26 @@ if CONFIG["CPU_ARCH"] == "arm" and CONFIG["HOST_CPU_ARCH"] == "arm" and CONFIG[" 83 | "/media/webrtc/trunk/webrtc/common_audio/signal_processing/spl_sqrt_floor_arm.S" 84 | ] 85 | 86 | +if CONFIG["CPU_ARCH"] == "arm" and CONFIG["HOST_CPU_ARCH"] == "arm" and CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux": 87 | + 88 | + CFLAGS += [ 89 | + "-mfpu=neon" 90 | + ] 91 | + 92 | + ASFLAGS += [ 93 | + "-march=armv7-a" 94 | + ] 95 | + 96 | + DEFINES["WEBRTC_ARCH_ARM"] = True 97 | + DEFINES["WEBRTC_ARCH_ARM_V7"] = True 98 | + DEFINES["WEBRTC_HAS_NEON"] = True 99 | + 100 | + SOURCES += [ 101 | + "/media/webrtc/trunk/webrtc/common_audio/signal_processing/complex_bit_reverse_arm.S", 102 | + "/media/webrtc/trunk/webrtc/common_audio/signal_processing/filter_ar_fast_q12_armv7.S", 103 | + "/media/webrtc/trunk/webrtc/common_audio/signal_processing/spl_sqrt_floor_arm.S" 104 | + ] 105 | + 106 | if CONFIG["CPU_ARCH"] == "x86" and CONFIG["HOST_CPU_ARCH"] == "x86" and CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "NetBSD": 107 | 108 | CFLAGS += [ 109 | diff --git a/servo/components/style/build_gecko.rs b/servo/components/style/build_gecko.rs 110 | index bf6ded1..b0a10f2 100644 111 | --- a/servo/components/style/build_gecko.rs 112 | +++ b/servo/components/style/build_gecko.rs 113 | @@ -205,7 +205,10 @@ mod bindings { 114 | // Disable rust unions, because we replace some types inside of 115 | // them. 116 | let mut builder = Builder::default() 117 | - .rust_target(RustTarget::Stable_1_0); 118 | + .rust_target(RustTarget::Stable_1_0) 119 | + .clang_arg("-target") 120 | + .clang_arg("arm-linux-gnueabihf"); 121 | + 122 | let rustfmt_path = env::var_os("MOZ_AUTOMATION").and_then(|_| { 123 | env::var_os("TOOLTOOL_DIR") 124 | }).map(PathBuf::from); 125 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cross-compiling Firefox for armhf with clang 2 | 3 | The first run in spring 2018 was done in an Ubuntu 14.04 Trusty container, 4 | but this flow has since been revised for a Debian Stretch amd64 container 5 | targeting Raspbian. 6 | 7 | The instructions below are for a recent major release such as Firefox 8 | 65.0 as this was last revised in February 2019. To build Firefox ESR 60.5, 9 | see **esr.md**. Trusty-specific notes have been moved to **trusty.md**. 10 | There is also a **xenial.md**. 11 | 12 | While this is glaringly out-of-date relative to Firefox 68.0.1, Firefox 13 | ESR 60.8, and beyond, as of June 2019 they released Raspbian 10 Buster. 14 | That distro plays nicely with the gcc-based Firefox Bionic binaries and 15 | relieves the needs of most users. 16 | 17 | If you attempt the build procedure below please expect to run into 18 | missing packages or other problems that you'll have to troubleshoot. Also 19 | keep an eye on the list of GitHub issues for what others have come across. 20 | 21 | If you're interested in maintaining this for newer releases of Firefox, 22 | pull requests are welcome. 23 | 24 | sudo dpkg --add-architecture armhf 25 | sudo apt update 26 | curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - 27 | sudo apt install -y gir1.2-atk-1.0:armhf gir1.2-freedesktop:armhf gir1.2-gdkpixbuf-2.0:armhf \ 28 | gir1.2-notify-0.7:armhf gir1.2-pango-1.0:armhf libatk1.0-dev:armhf libgdk-pixbuf2.0-dev:armhf \ 29 | libgirepository-1.0-1:armhf libgtk-3-dev:armhf libgtk2.0-dev:armhf \ 30 | libpango1.0-dev:armhf libharfbuzz-dev:armhf libicu-dev:armhf libxt-dev:armhf \ 31 | libstartup-notification0-dev:armhf libasound2-dev:armhf libcurl4-openssl-dev:armhf \ 32 | libdbus-glib-1-dev:armhf libiw-dev:armhf libnotify-dev:armhf libpulse-dev:armhf fakeroot \ 33 | devscripts build-essential dpkg-cross crossbuild-essential-armhf \ 34 | libreadline-dev:armhf libbz2-dev:armhf libjsoncpp-dev:armhf \ 35 | libnss3-tools debhelper autoconf2.13 cdbs clang-3.9 zip python nodejs 36 | 37 | Install **rustup**: 38 | 39 | curl https://sh.rustup.rs -sSf | sh 40 | # Edit ~/.bashrc, add Rust sourcing: . ~/.cargo/env 41 | rustup target add armv7-unknown-linux-gnueabihf 42 | 43 | Add Firefox bionic source packages and fetch source: 44 | 45 | cat <": No secret key 108 | gpg: dpkg-sign.8YBNCg8D/firefox_65.0+build2-0ubuntu0.18.04.1_armhf.buildinfo: clear-sign failed: No secret key 109 | 110 | dpkg-buildpackage: error: failed to sign .buildinfo file 111 | 112 | Although the message may not sound positive, at that point you'll find a set of deb packages in your home directory. 113 | On a good day you might see a clean finish: 114 | 115 | dpkg-buildpackage: info: binary-only upload (no source included) 116 | -------------------------------------------------------------------------------- /gcc-4.8-trusty.patch: -------------------------------------------------------------------------------- 1 | --- /usr/include/c++/4.8/cstdio.old 2019-01-31 17:48:53.014814177 +0000 2 | +++ /usr/include/c++/4.8/cstdio 2019-01-31 17:49:15.630946991 +0000 3 | @@ -117,7 +117,7 @@ 4 | using ::fwrite; 5 | using ::getc; 6 | using ::getchar; 7 | - using ::gets; 8 | + //using ::gets; 9 | using ::perror; 10 | using ::printf; 11 | using ::putc; 12 | --- /usr/include/c++/4.8/complex.old 2019-01-31 17:49:06.918884581 +0000 13 | +++ /usr/include/c++/4.8/complex 2019-01-31 18:21:39.571921488 +0000 14 | @@ -1,6 +1,6 @@ 15 | // The template and inlines for the -*- C++ -*- complex number classes. 16 | 17 | -// Copyright (C) 1997-2013 Free Software Foundation, Inc. 18 | +// Copyright (C) 1997-2016 Free Software Foundation, Inc. 19 | // 20 | // This file is part of the GNU ISO C++ Library. This library is free 21 | // software; you can redistribute it and/or modify it under the 22 | @@ -88,11 +88,8 @@ 23 | template complex<_Tp> log(const complex<_Tp>&); 24 | /// Return complex base 10 logarithm of @a z. 25 | template complex<_Tp> log10(const complex<_Tp>&); 26 | -#if __cplusplus < 201103L 27 | - // DR 844. 28 | /// Return @a x to the @a y'th power. 29 | template complex<_Tp> pow(const complex<_Tp>&, int); 30 | -#endif 31 | /// Return @a x to the @a y'th power. 32 | template complex<_Tp> pow(const complex<_Tp>&, const _Tp&); 33 | /// Return @a x to the @a y'th power. 34 | @@ -132,9 +129,12 @@ 35 | _GLIBCXX_CONSTEXPR complex(const _Tp& __r = _Tp(), const _Tp& __i = _Tp()) 36 | : _M_real(__r), _M_imag(__i) { } 37 | 38 | - // Lets the compiler synthesize the copy constructor 39 | - // complex (const complex<_Tp>&); 40 | - /// Copy constructor. 41 | + // Let the compiler synthesize the copy constructor 42 | +#if __cplusplus >= 201103L 43 | + constexpr complex(const complex&) = default; 44 | +#endif 45 | + 46 | + /// Converting constructor. 47 | template 48 | _GLIBCXX_CONSTEXPR complex(const complex<_Up>& __z) 49 | : _M_real(__z.real()), _M_imag(__z.imag()) { } 50 | @@ -144,11 +144,11 @@ 51 | // DR 387. std::complex over-encapsulated. 52 | _GLIBCXX_ABI_TAG_CXX11 53 | constexpr _Tp 54 | - real() { return _M_real; } 55 | + real() const { return _M_real; } 56 | 57 | _GLIBCXX_ABI_TAG_CXX11 58 | constexpr _Tp 59 | - imag() { return _M_imag; } 60 | + imag() const { return _M_imag; } 61 | #else 62 | /// Return real part of complex number. 63 | _Tp& 64 | @@ -175,10 +175,10 @@ 65 | void 66 | imag(_Tp __val) { _M_imag = __val; } 67 | 68 | - /// Assign this complex number to scalar @a t. 69 | + /// Assign a scalar to this complex number. 70 | complex<_Tp>& operator=(const _Tp&); 71 | 72 | - /// Add @a t to this complex number. 73 | + /// Add a scalar to this complex number. 74 | // 26.2.5/1 75 | complex<_Tp>& 76 | operator+=(const _Tp& __t) 77 | @@ -187,7 +187,7 @@ 78 | return *this; 79 | } 80 | 81 | - /// Subtract @a t from this complex number. 82 | + /// Subtract a scalar from this complex number. 83 | // 26.2.5/3 84 | complex<_Tp>& 85 | operator-=(const _Tp& __t) 86 | @@ -196,31 +196,33 @@ 87 | return *this; 88 | } 89 | 90 | - /// Multiply this complex number by @a t. 91 | + /// Multiply this complex number by a scalar. 92 | complex<_Tp>& operator*=(const _Tp&); 93 | - /// Divide this complex number by @a t. 94 | + /// Divide this complex number by a scalar. 95 | complex<_Tp>& operator/=(const _Tp&); 96 | 97 | - // Lets the compiler synthesize the 98 | - // copy and assignment operator 99 | - // complex<_Tp>& operator= (const complex<_Tp>&); 100 | - /// Assign this complex number to complex @a z. 101 | + // Let the compiler synthesize the copy assignment operator 102 | +#if __cplusplus >= 201103L 103 | + complex& operator=(const complex&) = default; 104 | +#endif 105 | + 106 | + /// Assign another complex number to this one. 107 | template 108 | complex<_Tp>& operator=(const complex<_Up>&); 109 | - /// Add @a z to this complex number. 110 | + /// Add another complex number to this one. 111 | template 112 | complex<_Tp>& operator+=(const complex<_Up>&); 113 | - /// Subtract @a z from this complex number. 114 | + /// Subtract another complex number from this one. 115 | template 116 | complex<_Tp>& operator-=(const complex<_Up>&); 117 | - /// Multiply this complex number by @a z. 118 | + /// Multiply this complex number by another. 119 | template 120 | complex<_Tp>& operator*=(const complex<_Up>&); 121 | - /// Divide this complex number by @a z. 122 | + /// Divide this complex number by another. 123 | template 124 | complex<_Tp>& operator/=(const complex<_Up>&); 125 | 126 | - _GLIBCXX_USE_CONSTEXPR complex __rep() const 127 | + _GLIBCXX_CONSTEXPR complex __rep() const 128 | { return *this; } 129 | 130 | private: 131 | @@ -628,7 +630,7 @@ 132 | 133 | // 26.2.7/5: norm(__z) returns the squared magnitude of __z. 134 | // As defined, norm() is -not- a norm is the common mathematical 135 | - // sens used in numerics. The helper class _Norm_helper<> tries to 136 | + // sense used in numerics. The helper class _Norm_helper<> tries to 137 | // distinguish between builtin floating point and the rest, so as 138 | // to deliver an answer as close as possible to the real value. 139 | template 140 | @@ -665,7 +667,10 @@ 141 | template 142 | inline complex<_Tp> 143 | polar(const _Tp& __rho, const _Tp& __theta) 144 | - { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } 145 | + { 146 | + __glibcxx_assert( __rho >= 0 ); 147 | + return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); 148 | + } 149 | 150 | template 151 | inline complex<_Tp> 152 | @@ -738,7 +743,7 @@ 153 | template 154 | inline complex<_Tp> 155 | __complex_exp(const complex<_Tp>& __z) 156 | - { return std::polar(exp(__z.real()), __z.imag()); } 157 | + { return std::polar<_Tp>(exp(__z.real()), __z.imag()); } 158 | 159 | #if _GLIBCXX_USE_C99_COMPLEX 160 | inline __complex__ float 161 | @@ -955,7 +960,6 @@ 162 | // 26.2.8/9 pow(__x, __y): Returns the complex power base of __x 163 | // raised to the __y-th power. The branch 164 | // cut is on the negative axis. 165 | -#if __cplusplus < 201103L 166 | template 167 | complex<_Tp> 168 | __complex_pow_unsigned(complex<_Tp> __x, unsigned __n) 169 | @@ -972,8 +976,12 @@ 170 | return __y; 171 | } 172 | 173 | - // _GLIBCXX_RESOLVE_LIB_DEFECTS 174 | + // In C++11 mode we used to implement the resolution of 175 | // DR 844. complex pow return type is ambiguous. 176 | + // thus the following overload was disabled in that mode. However, doing 177 | + // that causes all sorts of issues, see, for example: 178 | + // http://gcc.gnu.org/ml/libstdc++/2013-01/msg00058.html 179 | + // and also PR57974. 180 | template 181 | inline complex<_Tp> 182 | pow(const complex<_Tp>& __z, int __n) 183 | @@ -982,13 +990,12 @@ 184 | ? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -(unsigned)__n) 185 | : std::__complex_pow_unsigned(__z, __n); 186 | } 187 | -#endif 188 | 189 | template 190 | complex<_Tp> 191 | pow(const complex<_Tp>& __x, const _Tp& __y) 192 | { 193 | -#ifndef _GLIBCXX_USE_C99_COMPLEX 194 | +#if ! _GLIBCXX_USE_C99_COMPLEX 195 | if (__x == _Tp()) 196 | return _Tp(); 197 | #endif 198 | @@ -996,7 +1003,7 @@ 199 | return pow(__x.real(), __y); 200 | 201 | complex<_Tp> __t = std::log(__x); 202 | - return std::polar(exp(__y * __t.real()), __y * __t.imag()); 203 | + return std::polar<_Tp>(exp(__y * __t.real()), __y * __t.imag()); 204 | } 205 | 206 | template 207 | @@ -1033,8 +1040,8 @@ 208 | inline complex<_Tp> 209 | pow(const _Tp& __x, const complex<_Tp>& __y) 210 | { 211 | - return __x > _Tp() ? std::polar(pow(__x, __y.real()), 212 | - __y.imag() * log(__x)) 213 | + return __x > _Tp() ? std::polar<_Tp>(pow(__x, __y.real()), 214 | + __y.imag() * log(__x)) 215 | : std::pow(complex<_Tp>(__x), __y); 216 | } 217 | 218 | @@ -1066,11 +1073,11 @@ 219 | // DR 387. std::complex over-encapsulated. 220 | __attribute ((__abi_tag__ ("cxx11"))) 221 | constexpr float 222 | - real() { return __real__ _M_value; } 223 | + real() const { return __real__ _M_value; } 224 | 225 | __attribute ((__abi_tag__ ("cxx11"))) 226 | constexpr float 227 | - imag() { return __imag__ _M_value; } 228 | + imag() const { return __imag__ _M_value; } 229 | #else 230 | float& 231 | real() { return __real__ _M_value; } 232 | @@ -1181,7 +1188,7 @@ 233 | return *this; 234 | } 235 | 236 | - _GLIBCXX_USE_CONSTEXPR _ComplexT __rep() const { return _M_value; } 237 | + _GLIBCXX_CONSTEXPR _ComplexT __rep() const { return _M_value; } 238 | 239 | private: 240 | _ComplexT _M_value; 241 | @@ -1217,11 +1224,11 @@ 242 | // DR 387. std::complex over-encapsulated. 243 | __attribute ((__abi_tag__ ("cxx11"))) 244 | constexpr double 245 | - real() { return __real__ _M_value; } 246 | + real() const { return __real__ _M_value; } 247 | 248 | __attribute ((__abi_tag__ ("cxx11"))) 249 | constexpr double 250 | - imag() { return __imag__ _M_value; } 251 | + imag() const { return __imag__ _M_value; } 252 | #else 253 | double& 254 | real() { return __real__ _M_value; } 255 | @@ -1331,7 +1338,7 @@ 256 | return *this; 257 | } 258 | 259 | - _GLIBCXX_USE_CONSTEXPR _ComplexT __rep() const { return _M_value; } 260 | + _GLIBCXX_CONSTEXPR _ComplexT __rep() const { return _M_value; } 261 | 262 | private: 263 | _ComplexT _M_value; 264 | @@ -1369,11 +1376,11 @@ 265 | // DR 387. std::complex over-encapsulated. 266 | __attribute ((__abi_tag__ ("cxx11"))) 267 | constexpr long double 268 | - real() { return __real__ _M_value; } 269 | + real() const { return __real__ _M_value; } 270 | 271 | __attribute ((__abi_tag__ ("cxx11"))) 272 | constexpr long double 273 | - imag() { return __imag__ _M_value; } 274 | + imag() const { return __imag__ _M_value; } 275 | #else 276 | long double& 277 | real() { return __real__ _M_value; } 278 | @@ -1483,7 +1490,7 @@ 279 | return *this; 280 | } 281 | 282 | - _GLIBCXX_USE_CONSTEXPR _ComplexT __rep() const { return _M_value; } 283 | + _GLIBCXX_CONSTEXPR _ComplexT __rep() const { return _M_value; } 284 | 285 | private: 286 | _ComplexT _M_value; 287 | @@ -1824,7 +1831,7 @@ 288 | arg(_Tp __x) 289 | { 290 | typedef typename __gnu_cxx::__promote<_Tp>::__type __type; 291 | -#if (_GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC) 292 | +#if (_GLIBCXX11_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC) 293 | return std::signbit(__x) ? __type(3.1415926535897932384626433832795029L) 294 | : __type(); 295 | #else 296 | @@ -1926,6 +1933,45 @@ 297 | { return __x; } 298 | 299 | _GLIBCXX_END_NAMESPACE_VERSION 300 | + 301 | +#if __cplusplus > 201103L 302 | + 303 | +inline namespace literals { 304 | +inline namespace complex_literals { 305 | +_GLIBCXX_BEGIN_NAMESPACE_VERSION 306 | + 307 | +#define __cpp_lib_complex_udls 201309 308 | + 309 | + constexpr std::complex 310 | + operator""if(long double __num) 311 | + { return std::complex{0.0F, static_cast(__num)}; } 312 | + 313 | + constexpr std::complex 314 | + operator""if(unsigned long long __num) 315 | + { return std::complex{0.0F, static_cast(__num)}; } 316 | + 317 | + constexpr std::complex 318 | + operator""i(long double __num) 319 | + { return std::complex{0.0, static_cast(__num)}; } 320 | + 321 | + constexpr std::complex 322 | + operator""i(unsigned long long __num) 323 | + { return std::complex{0.0, static_cast(__num)}; } 324 | + 325 | + constexpr std::complex 326 | + operator""il(long double __num) 327 | + { return std::complex{0.0L, __num}; } 328 | + 329 | + constexpr std::complex 330 | + operator""il(unsigned long long __num) 331 | + { return std::complex{0.0L, static_cast(__num)}; } 332 | + 333 | +_GLIBCXX_END_NAMESPACE_VERSION 334 | +} // inline namespace complex_literals 335 | +} // inline namespace literals 336 | + 337 | +#endif // C++14 338 | + 339 | } // namespace 340 | 341 | #endif // C++11 342 | --- /usr/include/c++/4.8/utility.old 2019-01-31 17:49:21.034991834 +0000 343 | +++ /usr/include/c++/4.8/utility 2019-01-31 17:58:21.339050693 +0000 344 | @@ -152,6 +152,81 @@ 345 | get(const std::pair<_Tp1, _Tp2>& __in) noexcept 346 | { return __pair_get<_Int>::__const_get(__in); } 347 | 348 | + // Stores a tuple of indices. Used by tuple and pair, and by bind() to 349 | + // extract the elements in a tuple. 350 | + template struct _Index_tuple_gcc6 { }; 351 | + 352 | + // Concatenates two _Index_tuple_gcc6s. 353 | + template struct _Itup_cat; 354 | + 355 | + template 356 | + struct _Itup_cat<_Index_tuple_gcc6<_Ind1...>, _Index_tuple_gcc6<_Ind2...>> 357 | + { 358 | + using __type = _Index_tuple_gcc6<_Ind1..., (_Ind2 + sizeof...(_Ind1))...>; 359 | + }; 360 | + 361 | + // Builds an _Index_tuple_gcc6<0, 1, 2, ..., _Num-1>. 362 | + template 363 | + struct _Build_index_tuple_gcc6 364 | + : _Itup_cat::__type, 365 | + typename _Build_index_tuple_gcc6<_Num - _Num / 2>::__type> 366 | + { }; 367 | + 368 | + template<> 369 | + struct _Build_index_tuple_gcc6<1> 370 | + { 371 | + typedef _Index_tuple_gcc6<0> __type; 372 | + }; 373 | + 374 | + template<> 375 | + struct _Build_index_tuple_gcc6<0> 376 | + { 377 | + typedef _Index_tuple_gcc6<> __type; 378 | + }; 379 | + 380 | +#if __cplusplus > 201103L 381 | + 382 | +#define __cpp_lib_integer_sequence 201304 383 | + 384 | + /// Class template integer_sequence 385 | + template 386 | + struct integer_sequence 387 | + { 388 | + typedef _Tp value_type; 389 | + static constexpr size_t size() { return sizeof...(_Idx); } 390 | + }; 391 | + 392 | + template::__type> 394 | + struct _Make_integer_sequence; 395 | + 396 | + template 397 | + struct _Make_integer_sequence<_Tp, _Num, _Index_tuple_gcc6<_Idx...>> 398 | + { 399 | + static_assert( _Num >= 0, 400 | + "Cannot make integer sequence of negative length" ); 401 | + 402 | + typedef integer_sequence<_Tp, static_cast<_Tp>(_Idx)...> __type; 403 | + }; 404 | + 405 | + /// Alias template make_integer_sequence 406 | + template 407 | + using make_integer_sequence 408 | + = typename _Make_integer_sequence<_Tp, _Num>::__type; 409 | + 410 | + /// Alias template index_sequence 411 | + template 412 | + using index_sequence = integer_sequence; 413 | + 414 | + /// Alias template make_index_sequence 415 | + template 416 | + using make_index_sequence = make_integer_sequence; 417 | + 418 | + /// Alias template index_sequence_for 419 | + template 420 | + using index_sequence_for = make_index_sequence; 421 | +#endif 422 | + 423 | _GLIBCXX_END_NAMESPACE_VERSION 424 | } // namespace 425 | 426 | --- /usr/include/c++/4.8/type_traits.old 2019-01-31 17:50:04.455479333 +0000 427 | +++ /usr/include/c++/4.8/type_traits 2019-01-31 18:49:04.661314780 +0000 428 | @@ -59,7 +59,13 @@ 429 | static constexpr _Tp value = __v; 430 | typedef _Tp value_type; 431 | typedef integral_constant<_Tp, __v> type; 432 | - constexpr operator value_type() { return value; } 433 | + constexpr operator value_type() const { return value; } 434 | +#if __cplusplus > 201103L 435 | + 436 | +#define __cpp_lib_integral_constant_callable 201304 437 | + 438 | + constexpr value_type operator()() const { return value; } 439 | +#endif 440 | }; 441 | 442 | template 443 | @@ -1366,6 +1372,35 @@ 444 | add_const::type>::type type; 445 | }; 446 | 447 | +#if __cplusplus > 201103L 448 | + 449 | +#define __cpp_lib_transformation_trait_aliases 201304 450 | + 451 | + /// Alias template for remove_const 452 | + template 453 | + using remove_const_t = typename remove_const<_Tp>::type; 454 | + 455 | + /// Alias template for remove_volatile 456 | + template 457 | + using remove_volatile_t = typename remove_volatile<_Tp>::type; 458 | + 459 | + /// Alias template for remove_cv 460 | + template 461 | + using remove_cv_t = typename remove_cv<_Tp>::type; 462 | + 463 | + /// Alias template for add_const 464 | + template 465 | + using add_const_t = typename add_const<_Tp>::type; 466 | + 467 | + /// Alias template for add_volatile 468 | + template 469 | + using add_volatile_t = typename add_volatile<_Tp>::type; 470 | + 471 | + /// Alias template for add_cv 472 | + template 473 | + using add_cv_t = typename add_cv<_Tp>::type; 474 | + 475 | +#endif 476 | 477 | // Reference transformations. 478 | 479 | @@ -1645,6 +1680,15 @@ 480 | struct remove_all_extents<_Tp[]> 481 | { typedef typename remove_all_extents<_Tp>::type type; }; 482 | 483 | +#if __cplusplus > 201103L 484 | + /// Alias template for remove_extent 485 | + template 486 | + using remove_extent_t = typename remove_extent<_Tp>::type; 487 | + 488 | + /// Alias template for remove_all_extents 489 | + template 490 | + using remove_all_extents_t = typename remove_all_extents<_Tp>::type; 491 | +#endif 492 | 493 | // Pointer modifications. 494 | 495 | --- /usr/include/c++/4.8/bits/unique_ptr.h.old 2019-01-31 18:46:36.366304880 +0000 496 | +++ /usr/include/c++/4.8/bits/unique_ptr.h 2019-01-31 18:47:14.271074223 +0000 497 | @@ -607,6 +607,40 @@ 498 | } 499 | }; 500 | 501 | +#if __cplusplus > 201103L 502 | + 503 | +#define __cpp_lib_make_unique 201304 504 | + 505 | + template 506 | + struct _MakeUniq 507 | + { typedef unique_ptr<_Tp> __single_object; }; 508 | + 509 | + template 510 | + struct _MakeUniq<_Tp[]> 511 | + { typedef unique_ptr<_Tp[]> __array; }; 512 | + 513 | + template 514 | + struct _MakeUniq<_Tp[_Bound]> 515 | + { struct __invalid_type { }; }; 516 | + 517 | + /// std::make_unique for single objects 518 | + template 519 | + inline typename _MakeUniq<_Tp>::__single_object 520 | + make_unique(_Args&&... __args) 521 | + { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); } 522 | + 523 | + /// std::make_unique for arrays of unknown bound 524 | + template 525 | + inline typename _MakeUniq<_Tp>::__array 526 | + make_unique(size_t __num) 527 | + { return unique_ptr<_Tp>(new remove_extent_t<_Tp>[__num]()); } 528 | + 529 | + /// Disable std::make_unique for arrays of known bound 530 | + template 531 | + inline typename _MakeUniq<_Tp>::__invalid_type 532 | + make_unique(_Args&&...) = delete; 533 | +#endif 534 | + 535 | // @} group pointer_abstractions 536 | 537 | _GLIBCXX_END_NAMESPACE_VERSION 538 | --------------------------------------------------------------------------------