Bug 1513798 - Expose the linker kind to moz.build. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 13 Dec 2018 16:19:28 +0900
changeset 451074 711a06bf02e5c27f8fa8abe94a406665bc227dab
parent 451073 771cdabf7b5ad4beba6c6ad2e42aee0918eedab7
child 451075 6513765f487f36be0679e4a6eae2ed6c7433d705
push id35225
push usercbrindusan@mozilla.com
push dateTue, 18 Dec 2018 09:51:20 +0000
treeherdermozilla-central@d62e952be812 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1513798
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1513798 - Expose the linker kind to moz.build. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D14383
build/moz.configure/toolchain.configure
toolkit/library/moz.build
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1886,18 +1886,17 @@ def select_linker(linker, c_compiler, de
 
     # If an explicit linker was given, error out if what we found is different.
     if linker and not linker.startswith(result.KIND):
         die("Could not use {} as linker".format(linker))
 
     return result
 
 
-set_config('LD_IS_BFD', depends(select_linker.KIND)
-           (lambda x: x == 'bfd' or None))
+set_config('LINKER_KIND', select_linker.KIND)
 add_old_configure_assignment('LINKER_LDFLAGS', select_linker.LINKER_FLAG)
 
 
 # There's a wrinkle with MinGW: linker configuration is not enabled, so
 # `select_linker` is never invoked.  Hard-code around it.
 @depends(select_linker, target, c_compiler)
 def gcc_use_gnu_ld(select_linker, target, c_compiler):
     if select_linker is not None:
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -60,17 +60,18 @@ def Libxul(name, output_category=None):
 
     # BFD ld doesn't create multiple PT_LOADs as usual when an unknown section
     # exists. Using an implicit linker script to make it fold that section in
     # .data.rel.ro makes it create multiple PT_LOADs. That implicit linker
     # script however makes gold misbehave, first because it doesn't like that
     # the linker script is given after crtbegin.o, and even past that, replaces
     # the default section rules with those from the script instead of
     # supplementing them. Which leads to a lib with a huge load of sections.
-    if CONFIG['OS_TARGET'] not in ('OpenBSD', 'WINNT') and CONFIG['LD_IS_BFD']:
+    if CONFIG['OS_TARGET'] not in ('OpenBSD', 'WINNT') and \
+            CONFIG['LINKER_KIND'] == 'bfd':
         LDFLAGS += [TOPSRCDIR + '/toolkit/library/StaticXULComponents.ld']
 
     Libxul_defines()
 
     if CONFIG['MOZ_NEEDS_LIBATOMIC']:
         OS_LIBS += ['atomic']
 
     # This option should go away in bug 1290972, but we need to wait until