Skip to content
Snippets Groups Projects
Commit 2c474c95 authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 1524079 - Try both host and target clang to find llvm-objdump. r=froydnj

When doing android cross builds, the target compiler might be clang,
but it might be the one from the NDK, which doesn't come with all the
tools. So `clang --print-prog-name=llvm-objdump` might not return
anything, when the system has a suffixed llvm-objdump, e.g.
llvm-objdump-6.0.

So it's better to check with the host compiler, which is likely clang
too. We still check with the target compiler, in the odd case where the
host and target compiler would be of different kinds (Windows
cross-builds).

Differential Revision: https://phabricator.services.mozilla.com/D18142

--HG--
extra : moz-landing-system : lando
parent 274e0185
No related branches found
No related tags found
No related merge requests found
......@@ -584,14 +584,18 @@ 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):
@depends(host_c_compiler, c_compiler, bindgen_config_paths)
def llvm_objdump(host_c_compiler, 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:
for compiler in (host_c_compiler, c_compiler):
if compiler and compiler.type == 'clang':
clang = compiler.compiler
break
elif compiler and compiler.type == 'clang-cl':
clang = os.path.join(os.path.dirname(compiler.compiler), 'clang')
break
if not clang and bindgen_config_paths:
clang = bindgen_config_paths.clang_path
llvm_objdump = 'llvm-objdump'
if clang:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment