Skip to content

Commit

Permalink
Bug 1791480 - Handle the situation when clang doesn't have the same d…
Browse files Browse the repository at this point in the history
…efault C++ standard for host and target. r=firefox-build-system-reviewers,andi

Differential Revision: https://phabricator.services.mozilla.com/D157799
  • Loading branch information
glandium committed Sep 22, 2022
1 parent 5db5ac2 commit 534b95e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build/moz.configure/bindgen.configure
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ def bindgen_clang_compiler(
if sysroot_path:
flags.extend(("--sysroot", sysroot_path))
info = check_compiler([clang_path] + flags, "C++", target)
# Usually, one check_compiler pass would be enough, but when cross-compiling
# and the host and target don't use the same default C++ standard, we don't
# get the --std flag, so try again. This is the same thing as valid_compiler()
# does in toolchain.configure.
if info.flags:
flags += info.flags
info = check_compiler([clang_path] + flags, "C++", target)
return namespace(
path=clang_path,
flags=flags + info.flags,
Expand Down

0 comments on commit 534b95e

Please sign in to comment.