Bug 1577812 - correctly add the compiler's lib directory to LD_LIBRARY_PATH; r=sfink
authorNathan Froyd <froydnj@mozilla.com>
Fri, 30 Aug 2019 19:38:49 +0000
changeset 554693 a54701dbcc65c71a9d8e55cc7cac09442aaeff8f
parent 554692 aa070cf72750b2bda6fac3591f100d98c75a5f22
child 554694 96842051c994b95da275942a1c2c02494d6d2683
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1577812
milestone70.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 1577812 - correctly add the compiler's lib directory to LD_LIBRARY_PATH; r=sfink The current code only adds the directory if `LD_LIBRARY_PATH` is not already set. We want to always add it so that host binaries--which will be linked against whatever libraries the compiler in use provides--can run correctly. Differential Revision: https://phabricator.services.mozilla.com/D44172
js/src/devtools/automation/autospider.py
--- a/js/src/devtools/automation/autospider.py
+++ b/js/src/devtools/automation/autospider.py
@@ -227,31 +227,32 @@ else:
     compiler = 'gcc'
 
 info("using compiler '{}'".format(compiler))
 
 cxx = {'clang': 'clang++', 'gcc': 'g++', 'cl': 'cl'}.get(compiler)
 
 compiler_dir = env.get('GCCDIR', os.path.join(DIR.fetches, compiler))
 info("looking for compiler under {}/".format(compiler_dir))
+compiler_libdir = None
 if os.path.exists(os.path.join(compiler_dir, 'bin', compiler)):
     env.setdefault('CC', os.path.join(compiler_dir, 'bin', compiler))
     env.setdefault('CXX', os.path.join(compiler_dir, 'bin', cxx))
     if compiler == 'clang':
         platlib = 'lib'
     else:
         platlib = 'lib64' if word_bits == 64 else 'lib'
-    env.setdefault('LD_LIBRARY_PATH', os.path.join(compiler_dir, platlib))
+    compiler_libdir = os.path.join(compiler_dir, platlib)
 else:
     env.setdefault('CC', compiler)
     env.setdefault('CXX', cxx)
 
 bindir = os.path.join(OBJDIR, 'dist', 'bin')
 env['LD_LIBRARY_PATH'] = ':'.join(
-    p for p in (bindir, env.get('LD_LIBRARY_PATH')) if p)
+    p for p in (bindir, compiler_libdir, env.get('LD_LIBRARY_PATH')) if p)
 
 for v in ('CC', 'CXX', 'LD_LIBRARY_PATH'):
     info("default {name} = {value}".format(name=v, value=env[v]))
 
 rust_dir = os.path.join(DIR.fetches, 'rustc')
 if os.path.exists(os.path.join(rust_dir, 'bin', 'rustc')):
     env.setdefault('RUSTC', os.path.join(rust_dir, 'bin', 'rustc'))
     env.setdefault('CARGO', os.path.join(rust_dir, 'bin', 'cargo'))