Skip to content

Commit

Permalink
Bug 1792666 - Use -isysroot instead of --sysroot on mac. r=firefox-bu…
Browse files Browse the repository at this point in the history
…ild-system-reviewers,nalexander

Differential Revision: https://phabricator.services.mozilla.com/D158302
  • Loading branch information
glandium committed Sep 29, 2022
1 parent f0ffbdc commit ff425dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,10 @@ def compiler(
wrapper = list(compiler_wrapper or ())
flags = []
if sysroot.path:
flags.extend(("--sysroot", sysroot.path))
if host_or_target.kernel == "Darwin":
flags.extend(("-isysroot", sysroot.path))
else:
flags.extend(("--sysroot", sysroot.path))
if host_or_target.os == "OSX" and macos_target:
flags.append("-mmacosx-version-min=%s" % macos_target)
if provided_compiler:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ class OSXToolchainTest(BaseToolchainTest):
SYSROOT_FLAGS = {
"flags": PrependFlags(
[
"--sysroot",
"-isysroot",
xcrun("", ("--show-sdk-path",))[1],
"-mmacosx-version-min=10.12",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ def __call__(self, stdin, args):
if arg is None:
break
if arg.startswith("-"):
# Ignore --sysroot and the argument that follows it.
if arg == "--sysroot":
# Ignore -isysroot/--sysroot and the argument that follows it.
if arg in ("-isysroot", "--sysroot"):
next(args, None)
else:
flags.append(arg)
Expand Down

0 comments on commit ff425dd

Please sign in to comment.