diff options
author | ohfp <1813007-ohfp@users.noreply.gitlab.com> | 2020-03-29 18:37:23 +0200 |
---|---|---|
committer | ohfp <1813007-ohfp@users.noreply.gitlab.com> | 2020-03-30 00:26:30 +0200 |
commit | 85f55868f631d67e5a4ab190f69e919f38be57f8 (patch) | |
tree | 4b91a6ed7ef90064c835403d5e1af952f8bff43b /deb_patches | |
parent | re-introduce profiling (diff) | |
download | librewolf-linux-85f55868f631d67e5a4ab190f69e919f38be57f8.tar.gz librewolf-linux-85f55868f631d67e5a4ab190f69e919f38be57f8.tar.bz2 librewolf-linux-85f55868f631d67e5a4ab190f69e919f38be57f8.zip |
Disable PGO for deb/ubuntu, because everything is horrible.
Also: Grab dependencies, patches and further config options from ubuntu
upstream build sources. Builds statically against a
mozilla-gcc-7/libstdc++7. Let's hope this works for Appimages and
Flatpaks as well, "everywhere".
Diffstat (limited to 'deb_patches')
-rw-r--r-- | deb_patches/build-with-libstdc++-7.patch | 36 | ||||
-rw-r--r-- | deb_patches/drop-check-glibc-symbols.patch | 19 | ||||
-rw-r--r-- | deb_patches/fix-armhf-webrtc-build.patch | 83 | ||||
-rw-r--r-- | deb_patches/webrtc-fix-compiler-flags-for-armhf.patch | 35 |
4 files changed, 173 insertions, 0 deletions
diff --git a/deb_patches/build-with-libstdc++-7.patch b/deb_patches/build-with-libstdc++-7.patch new file mode 100644 index 0000000..dfc0665 --- /dev/null +++ b/deb_patches/build-with-libstdc++-7.patch @@ -0,0 +1,36 @@ +Description: point clang to the toolchain provided by the gcc-mozilla package (version 7 required for C++ 17), and statically link against libstdc++ +Author: Olivier Tilloy <olivier.tilloy@canonical.com> +Bug-Ubuntu: https://launchpad.net/bugs/1856861 + +--- a/build/moz.configure/toolchain.configure ++++ b/build/moz.configure/toolchain.configure +@@ -1387,6 +1387,9 @@ set_config('_DEPEND_CFLAGS', depend_cfla + set_config('_HOST_DEPEND_CFLAGS', depend_cflags(host_c_compiler)) + + ++add_old_configure_assignment('CXXFLAGS', ['--gcc-toolchain=/usr/lib/gcc-mozilla']) ++ ++ + @depends(c_compiler) + def preprocess_option(compiler): + # The uses of PREPROCESS_OPTION depend on the spacing for -o/-Fi. +@@ -2074,7 +2074,7 @@ + flags.append('-Wl,-syslibroot,%s' % macos_sdk) + else: + flags.append('-Wl,--sysroot=%s' % macos_sdk) +- ++ flags.append('-static-libstdc++') + return flags + + +--- a/servo/components/style/build_gecko.rs ++++ b/servo/components/style/build_gecko.rs +@@ -148,6 +148,8 @@ impl BuilderExt for Builder { + builder = builder.with_rustfmt(path); + } + ++ builder = builder.clang_arg("--gcc-toolchain=/usr/lib/gcc-mozilla"); ++ + for dir in SEARCH_PATHS.iter() { + builder = builder.clang_arg("-I").clang_arg(dir.to_str().unwrap()); + } diff --git a/deb_patches/drop-check-glibc-symbols.patch b/deb_patches/drop-check-glibc-symbols.patch new file mode 100644 index 0000000..98cbf92 --- /dev/null +++ b/deb_patches/drop-check-glibc-symbols.patch @@ -0,0 +1,19 @@ +Description: Drop the glibc and stdcxx checks. + We're not compiling Firefox to run on a different version. +Author: Chris Coulson <chris.coulson@canonical.com> +Author: Olivier Tilloy <olivier.tilloy@canonical.com> +Forwarded: not-needed + +--- a/python/mozbuild/mozbuild/action/check_binary.py ++++ b/python/mozbuild/mozbuild/action/check_binary.py +@@ -296,9 +296,7 @@ def checks(target, binary): + target = HOST + checks = [] + if target['MOZ_LIBSTDCXX_VERSION']: +- checks.append(check_stdcxx) + checks.append(check_libgcc) +- checks.append(check_glibc) + + # Disabled for local builds because of readelf performance: See bug 1472496 + if not buildconfig.substs.get('DEVELOPER_OPTIONS'): + diff --git a/deb_patches/fix-armhf-webrtc-build.patch b/deb_patches/fix-armhf-webrtc-build.patch new file mode 100644 index 0000000..44e88a6 --- /dev/null +++ b/deb_patches/fix-armhf-webrtc-build.patch @@ -0,0 +1,83 @@ +diff -r 53fd96ca5aa4 media/webrtc/gn-configs/arm_False_arm_linux.json +--- a/media/webrtc/gn-configs/arm_False_arm_linux.json Sun Dec 09 23:42:51 2018 +0200 ++++ b/media/webrtc/gn-configs/arm_False_arm_linux.json Mon Dec 10 10:40:13 2018 +0100 +@@ -15969,9 +15969,7 @@ + "/home/jenkins/workspace/Firefox-default/label/armv7/firefox/obj-armv7l-unknown-linux-gnueabihf/media/webrtc/trunk/webrtc/gn-output/gen/" + ], + "libs": [], +- "sources": [ +- "//system_wrappers/source/cpu_features_linux.c" +- ], ++ "sources": [], + "type": "static_library" + }, + "//system_wrappers:field_trial_api": { +diff -r 53fd96ca5aa4 media/webrtc/gn-configs/arm_True_arm_linux.json +--- a/media/webrtc/gn-configs/arm_True_arm_linux.json Sun Dec 09 23:42:51 2018 +0200 ++++ b/media/webrtc/gn-configs/arm_True_arm_linux.json Mon Dec 10 10:40:13 2018 +0100 +@@ -15558,9 +15558,7 @@ + "/home/jenkins/workspace/Firefox-default/label/armv7/firefox/obj-armv7l-unknown-linux-gnueabihf/media/webrtc/trunk/webrtc/gn-output/gen/" + ], + "libs": [], +- "sources": [ +- "//system_wrappers/source/cpu_features_linux.c" +- ], ++ "sources": [], + "type": "static_library" + }, + "//system_wrappers:field_trial_api": { +diff -r 53fd96ca5aa4 media/webrtc/trunk/webrtc/system_wrappers/cpu_features_linux_gn/moz.build +--- a/media/webrtc/trunk/webrtc/system_wrappers/cpu_features_linux_gn/moz.build Sun Dec 09 23:42:51 2018 +0200 ++++ b/media/webrtc/trunk/webrtc/system_wrappers/cpu_features_linux_gn/moz.build Mon Dec 10 10:40:13 2018 +0100 +@@ -31,10 +31,6 @@ + "/media/webrtc/trunk/webrtc/" + ] + +-UNIFIED_SOURCES += [ +- "/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c" +-] +- + if not CONFIG["MOZ_DEBUG"]: + + DEFINES["DYNAMIC_ANNOTATIONS_ENABLED"] = "0" +@@ -53,20 +49,36 @@ + DEFINES["WEBRTC_ARCH_ARM64"] = True + DEFINES["WEBRTC_HAS_NEON"] = True + +-if CONFIG["CPU_ARCH"] == "arm": ++ UNIFIED_SOURCES += [ ++ "/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c" ++ ] + +- CFLAGS += [ +- "-mfpu=neon" +- ] ++if CONFIG["CPU_ARCH"] == "arm": + + DEFINES["WEBRTC_ARCH_ARM"] = True + DEFINES["WEBRTC_ARCH_ARM_V7"] = True + DEFINES["WEBRTC_HAS_NEON"] = True + ++if CONFIG["CPU_ARCH"] == "ppc64": ++ ++ UNIFIED_SOURCES += [ ++ "/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c" ++ ] ++ + if CONFIG["CPU_ARCH"] == "x86": + + CFLAGS += [ + "-msse2" + ] + ++ UNIFIED_SOURCES += [ ++ "/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c" ++ ] ++ ++if CONFIG["CPU_ARCH"] == "x86_64": ++ ++ UNIFIED_SOURCES += [ ++ "/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c" ++ ] ++ + Library("cpu_features_linux_gn") diff --git a/deb_patches/webrtc-fix-compiler-flags-for-armhf.patch b/deb_patches/webrtc-fix-compiler-flags-for-armhf.patch new file mode 100644 index 0000000..5846b21 --- /dev/null +++ b/deb_patches/webrtc-fix-compiler-flags-for-armhf.patch @@ -0,0 +1,35 @@ +# Description: Don't pass -mfloat-abi=softfp on armhf +# Author: Chris Coulson <chris.coulson@canonical.com> +# Forwarded: no + +--- a/build/gyp.mozbuild ++++ b/build/gyp.mozbuild +@@ -107,9 +107,15 @@ if CONFIG['ARM_ARCH']: + gyp_vars['arm_neon'] = 1 + gyp_vars['build_with_neon'] = 1 + else: +- # CPU detection for ARM works on Android only. armv7 always uses CPU +- # detection, so we have to set armv7=0 for non-Android target +- gyp_vars['armv7'] = 0 ++ gyp_vars['armv7'] = 1 ++ # We enable NEON for Ubuntu armhf. Note that these don't really ++ # have any effect here as NEON is hardcoded on in ++ # media/webrtc/trunk/webrtc/build/common.gypi. Disabling these ++ # without fixing that file will result in a link failure, as ++ # targets hidden behind the build_with_neon flag don't get ++ # built but WEBRTC_HAS_NEON is still defined ++ gyp_vars['arm_neon'] = 1 ++ gyp_vars['build_with_neon'] = 1 + # For libyuv + gyp_vars['arm_version'] = int(CONFIG['ARM_ARCH']) + +--- a/media/webrtc/trunk/webrtc/build/config/compiler/BUILD.gn ++++ b/media/webrtc/trunk/webrtc/build/config/compiler/BUILD.gn +@@ -590,7 +590,6 @@ config("compiler_cpu_abi") { + if (!is_nacl) { + cflags += [ + "-march=$arm_arch", +- "-mfloat-abi=$arm_float_abi", + ] + } + if (arm_tune != "") { |