-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use -target
instead of -arch
in compiling commands in Apple crosstool
#13466
Use -target
instead of -arch
in compiling commands in Apple crosstool
#13466
Conversation
c090df3
to
ae52523
Compare
If we're passing target we can probably drop the arch arg? Also see #13448 which should make this necessary in fewer places |
I'll rebase this after your PR is merged. I've actually never seen the target being rewritten to |
hrm i wonder if that has something to do with the host OS? so maybe that's only a problem with clang on non macOS hosts? |
ae52523
to
da54989
Compare
-target
in addition to -arch
in compiling commands in Apple crosstool-target
instead of -arch
in compiling commands in Apple crosstool
Couldn't reproduce myself. Rebased and removed Also it seems this will fix #11986. |
looks like the failure is related |
There's still some places in this file that can be simplified. I did a cleanup of it a while ago while implementing another toolchain, and the target system name can already be derived from def _target_system_name(cpu):
platform, _, cpu = cpu.partition("_")
if platform == "darwin":
platform = "macosx"
return "{}-apple-{}".format(cpu, platform) |
doing some of that in this #13449 |
I think this is good to go, wdyt? |
ccd22e1
to
2edf407
Compare
I think we should land this. I would prefer the default crosstool to just work in most environments as much as it can. Rebased and updated the target triple to also minimum OS version and target environment. With this, the |
will this usage bazel/tools/osx/crosstool/cc_toolchain_config.bzl Line 3072 in ac48e65
|
It's what returned by |
2edf407
to
cea78ff
Compare
crosstool This allows using this crosstool file for cross-compiling from non-Apple host platforms. On macOS, `-arch <arch>` and `-m<platform>-version-min=<version_min>` will be expanded to `-triple <arch>-apple-<platform><version_min>` in the frontend invocation, but on a Linux host, without `-target`, the expanded triple flags would be `-triple <arch>-pc-linux-gnu`.
cea78ff
to
bdcdfac
Compare
Superseded by #14898. |
This allows using this crosstool file for cross-compiling from non-Apple
host platforms. On macOS,
-arch <arch>
and-m<platform>-version-min=<version_min>
will be expanded to-triple <arch>-apple-<platform><version_min>
in the frontend invocation, but ona Linux host, without
-target
, the expanded triple flags would be-triple <arch>-pc-linux-gnu
.Fixes #11986