Bug 1516228 - Add a configure check for llvm-objdump. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 24 Jan 2019 15:33:47 +0000
changeset 455828 5f7e5c3ca87dcfdea30bfd83c968e656a0022d2f
parent 455827 780eec2d27c312f824dfa5759d5e4659b72cb46a
child 455829 94dd43dcc7f2e444b8a1b201a84fb082da8b5dcd
push id77004
push userarchaeopteryx@coole-files.de
push dateTue, 29 Jan 2019 11:01:05 +0000
treeherderautoland@0778108e409f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1516228
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 1516228 - Add a configure check for llvm-objdump. r=mshal Differential Revision: https://phabricator.services.mozilla.com/D17462
build/moz.configure/init.configure
moz.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -4,16 +4,19 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 include('util.configure')
 include('checks.configure')
 
 # Make `toolkit` available when toolkit/moz.configure is not included.
 toolkit = dependable(None)
+# Likewise with `bindgen_config_paths` when
+# build/moz.configure/bindgen.configure is not included.
+bindgen_config_paths = dependable(None)
 
 option(env='DIST', nargs=1, help='DIST directory')
 
 
 # Do not allow objdir == srcdir builds.
 # ==============================================================
 @depends('--help', 'DIST')
 @imports(_from='__builtin__', _import='open')
--- a/moz.configure
+++ b/moz.configure
@@ -578,16 +578,39 @@ def nsis_flags(host):
     if host.kernel != 'WINNT':
         return '-nocd'
     return ''
 
 set_config('MAKENSISU_FLAGS', nsis_flags)
 
 check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
 
+
+@depends(c_compiler, bindgen_config_paths)
+def llvm_objdump(c_compiler, bindgen_config_paths):
+    clang = None
+    if c_compiler and c_compiler.type == 'clang':
+        clang = c_compiler.compiler
+    elif c_compiler and c_compiler.type == 'clang-cl':
+        clang = os.path.join(os.path.dirname(c_compiler.compiler), 'clang')
+    elif bindgen_config_paths:
+        clang = bindgen_config_paths.clang_path
+    llvm_objdump = 'llvm-objdump'
+    if clang:
+        out = check_cmd_output(clang, '--print-prog-name=llvm-objdump',
+                               onerror=lambda: None)
+        if out:
+            llvm_objdump = out.rstrip()
+    return (llvm_objdump,)
+
+
+check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump',
+           when='--enable-compile-environment')
+
+
 # Please do not add configure checks from here on.
 
 # Fallthrough to autoconf-based configure
 include('build/moz.configure/old.configure')
 
 # JS Subconfigure.
 include('js/sub.configure', when=compile_environment & toolkit)