From 7b13ff701067e683a5cf846781638a01284fdc12 Mon Sep 17 00:00:00 2001 From: B Stack Date: Thu, 13 Dec 2018 10:15:53 -0500 Subject: waterfox 56.2.5 like normal, import from chinforpms --- waterfox/mozilla-1336978.patch | 99 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 waterfox/mozilla-1336978.patch (limited to 'waterfox/mozilla-1336978.patch') diff --git a/waterfox/mozilla-1336978.patch b/waterfox/mozilla-1336978.patch new file mode 100644 index 0000000..136eb83 --- /dev/null +++ b/waterfox/mozilla-1336978.patch @@ -0,0 +1,99 @@ + +# HG changeset patch +# User Sylvestre Ledru +# Date 1501074847 -7200 +# Node ID 342812d23eb995a19b391f7bcd48d03db092709a +# Parent 2980183d98fb2513d41209c5a9e08bfc519b68fa +Bug 1336978 - Add support of lld by adding a configure option --enable-linker='bfd', 'gold', 'lld', 'other' r=glandium + +MozReview-Commit-ID: 7LI2lMXO2lG + +diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure +--- a/build/moz.configure/toolchain.configure ++++ b/build/moz.configure/toolchain.configure +@@ -1136,23 +1136,23 @@ def build_not_win_mac(target): + return True + + + option('--enable-gold', + env='MOZ_FORCE_GOLD', + help='Enable GNU Gold Linker when it is not already the default', + when=build_not_win_mac) + ++imply_option('--enable-linker', ++ depends_if('--enable-gold', when=build_not_win_mac)(lambda x: 'gold'), ++ when=build_not_win_mac) + +-@depends('--enable-gold', c_compiler, developer_options, check_build_environment, when=build_not_win_mac) +-@checking('for ld', lambda x: x.KIND) + @imports('os') + @imports('shutil') +-def enable_gold(enable_gold_option, c_compiler, developer_options, build_env): +- linker = None ++def enable_gnu_linker(enable_gold_option, c_compiler, developer_options, build_env, linker_name): + # Used to check the kind of linker + version_check = ['-Wl,--version'] + cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags + + def resolve_gold(): + # Try to force the usage of gold + targetDir = os.path.join(build_env.topobjdir, 'build', 'unix', 'gold') + +@@ -1177,17 +1177,17 @@ def enable_gold(enable_gold_option, c_co + return namespace( + KIND='gold', + LINKER_FLAG=linker, + ) + else: + # The -B trick didn't work, removing the directory + shutil.rmtree(targetDir) + +- if enable_gold_option or developer_options: ++ if (enable_gold_option or developer_options) and linker_name != 'bfd': + result = resolve_gold() + + if result: + return result + # gold is only required if --enable-gold is used. + elif enable_gold_option: + die('Could not find gold') + # Else fallthrough. +@@ -1208,10 +1208,35 @@ def enable_gold(enable_gold_option, c_co + KIND='gold' + ) + + # For other platforms without gold or the GNU linker + return namespace( + KIND='other' + ) + +-set_config('LD_IS_BFD', depends(enable_gold.KIND)(lambda x: x == 'bfd' or None)) +-set_config('LINKER_LDFLAGS', enable_gold.LINKER_FLAG) ++js_option('--enable-linker', nargs=1, ++ choices=('bfd', 'gold', 'lld', 'other'), ++ help='Select the linker', ++ when=build_not_win_mac) ++ ++@depends('--enable-linker', c_compiler, developer_options, check_build_environment, when=build_not_win_mac) ++@checking('for linker', lambda x: x.KIND) ++def select_linker(linker, c_compiler, developer_options, build_env): ++ linker = linker[0] if linker else 'other' ++ if linker in ('gold', 'bfd', 'other'): ++ return enable_gnu_linker(linker == 'gold', c_compiler, developer_options, build_env, linker) ++ if linker == 'lld': ++ version_check = ['-Wl,--version'] ++ cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags ++ lld = "-fuse-ld=" + linker ++ cmd = cmd_base + [lld] + version_check ++ if 'LLD' in check_cmd_output(*cmd).decode('utf-8'): ++ return namespace( ++ KIND='lld', ++ LINKER_FLAG=lld, ++ ) ++ else: ++ die("Could not use lld as linker") ++ ++ ++set_config('LD_IS_BFD', depends(select_linker.KIND)(lambda x: x == 'bfd' or None)) ++set_config('LINKER_LDFLAGS', select_linker.LINKER_FLAG) + -- cgit