-
Notifications
You must be signed in to change notification settings - Fork 13.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
Always set the deployment target when building std #133092
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
fd382a0
to
dd8ca01
Compare
Okay... So this didn't actually work initially, since bootstrap is for some I've rebased and fixed that in the first and second commits, but it may break more than I think, so this should probably get a try build before merging. |
50812ff
to
2294b05
Compare
2294b05
to
f816d33
Compare
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. This PR modifies cc @jieyouxu |
Not sure if I should? It changes in theory (we pass different flags), but in practice it shouldn't (because those flags were already set by |
r=me modulo comment |
@bors r+ |
…t, r=Mark-Simulacrum Always set the deployment target when building std `cc` has [a bug/feature](rust-lang/cc-rs#1171) (I guess depending on how you look at it) where the default deployment target is taken from the SDK instead of from `rustc`. This causes `compiler-builtins` to build `compiler-rt` with the wrong deployment target on iOS. I've been meaning to change how `cc` works in this regard, but that's a lengthy process, so let's fix it in bootstrap for now. The behaviour be seen locally with `./x build library --set build.optimized-compiler-builtins=true` for various target triples, and then inspecting with `otool -l build/host/stage1/lib/rustlib/*/lib/libcompiler_builtins-*.rlib | rg 'minos|version'`. I have added a rmake test that ensures that we now have the same version everywhere. Fixes rust-lang#128419 Fixes rust-lang/compiler-builtins#650 See also rust-lang/cargo#13115 `@rustbot` label O-apple
Rollup of 7 pull requests Successful merges: - rust-lang#131323 (Support `clobber_abi` in AVR inline assembly) - rust-lang#133092 (Always set the deployment target when building std) - rust-lang#133134 (Don't use a SyntheticProvider for literally every type) - rust-lang#133538 (Better diagnostic for fn items in variadic functions) - rust-lang#133590 (Rename `-Zparse-only`) - rust-lang#133592 (Misc: better instructions for envrc, ignore `/build` instead of `build/`) - rust-lang#133608 (Revert rust-lang#133418 (Store coverage source regions as `Span`) due to regression rust-lang#133606) r? `@ghost` `@rustbot` modify labels: rollup
Could this have caused the failure at #133609 (comment)? |
This looks most likely I agree. |
Yeaaah, I don't think that's spurious. |
Oh fuchsia... If you'd like help w/ that target, we can ping the fuchsia team. |
I'll try to take a look myself first |
Pretty sure I've fixed this now, the issue was that CI scripts were (correctly) setting @rustbot ready |
This comment has been minimized.
This comment has been minimized.
(Tidy moment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with tidy pleased
148ebac
to
ea68a47
Compare
The bootstrap diff LGTM. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (6171d94): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 3.4%, secondary 1.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 785.578s -> 786.626s (0.13%) |
…imulacrum,jieyouxu Always set the deployment target when building std `cc` has [a bug/feature](rust-lang/cc-rs#1171) (I guess depending on how you look at it) where the default deployment target is taken from the SDK instead of from `rustc`. This causes `compiler-builtins` to build `compiler-rt` with the wrong deployment target on iOS. I've been meaning to change how `cc` works in this regard, but that's a lengthy process, so let's fix it in bootstrap for now. The behaviour can be seen locally with `./x build library --set build.optimized-compiler-builtins=true` for various target triples, and then inspecting with `otool -l build/host/stage1/lib/rustlib/*/lib/libcompiler_builtins-*.rlib | rg 'minos|version'`. I have added a rmake test that ensures that we now have the same version everywhere. Fixes rust-lang/rust#128419 Fixes rust-lang/compiler-builtins#650 Fixes rust-lang/rust#136523 See also rust-lang/cargo#13115, rust-lang/cc-rs#1171, rust-lang/rust#136113 See rust-lang/rust#133092 (comment) for a description of how the change works. try-job: i686-gnu-1 try-job: i686-gnu-2 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: dist-apple-various try-job: dist-aarch64-apple try-job: dist-various-2 try-job: x86_64-fuchsia
// Extend `CXXFLAGS_$TARGET` with our extra flags. | ||
let env = format!("CXXFLAGS_{triple_underscored}"); | ||
let mut cxxflags = | ||
builder.cc_unhandled_cflags(target, GitRepo::Rustc, CLang::Cxx).join(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@madsmtm this change here broke our rust build (http://crbug.com/395891130) and extending this with cc_handled_cflags()
fixes the issue. was it intentional to leave out the cc handled flags here (and above)?
(also nit: typo in cc_handled_clags
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see it was intentional based on the comments, but it's dropping flags we're passing via CFLAGS
/CXXFLAGS
/LDFLAGS
/RUSTFLAGS_BOOTSTRAP
/RUSTFLAGS_NOT_BOOTSTRAP
(here) like --sysroot=
in the stage1 build. am I holding it wrong? should I be using some other method to pass flags?
= note: ld.lld: error: undefined reference: __libc_single_threaded
>>> referenced by /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-d74657ee7dc4cb63.so (disallowed by --no-allow-shlib-undefined)
ld.lld: error: undefined reference: std::__throw_bad_array_new_length()
>>> referenced by /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-d74657ee7dc4cb63.so (disallowed by --no-allow-shlib-undefined)
ld.lld: error: undefined reference: std::ios_base_library_init()
>>> referenced by /usr/home/aeubanks/repos/chromium/src/third_party/rust-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-d74657ee7dc4cb63.so (disallowed by --no-allow-shlib-undefined)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: could not compile `rustc-main` (bin "rustc-main") due to 1 previous error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@madsmtm having stared at this change a bit more, it seems like there's no longer a way to pass flags to stage1 links, which seems like a big regression?
…imulacrum,jieyouxu Always set the deployment target when building std `cc` has [a bug/feature](rust-lang/cc-rs#1171) (I guess depending on how you look at it) where the default deployment target is taken from the SDK instead of from `rustc`. This causes `compiler-builtins` to build `compiler-rt` with the wrong deployment target on iOS. I've been meaning to change how `cc` works in this regard, but that's a lengthy process, so let's fix it in bootstrap for now. The behaviour can be seen locally with `./x build library --set build.optimized-compiler-builtins=true` for various target triples, and then inspecting with `otool -l build/host/stage1/lib/rustlib/*/lib/libcompiler_builtins-*.rlib | rg 'minos|version'`. I have added a rmake test that ensures that we now have the same version everywhere. Fixes rust-lang/rust#128419 Fixes rust-lang/compiler-builtins#650 Fixes rust-lang/rust#136523 See also rust-lang/cargo#13115, rust-lang/cc-rs#1171, rust-lang/rust#136113 See rust-lang/rust#133092 (comment) for a description of how the change works. try-job: i686-gnu-1 try-job: i686-gnu-2 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: dist-apple-various try-job: dist-aarch64-apple try-job: dist-various-2 try-job: x86_64-fuchsia
…5-g7b473dfe-1 / d4bdd1ed551fed0c951eb47b4be2c79d7a02d181-1 : 9fcc9cf4a202aadfe1f44722b39c83536eba3dba-2 https://chromium.googlesource.com/external/github.com/llvm/llvm-project/+log/ba476d0b..7b473dfe https://chromium.googlesource.com/external/github.com/rust-lang/rust/+log/d4bdd1ed551f..9fcc9cf4a202 Ran: ./tools/clang/scripts/upload_revision.py 7b473dfe84c17319930d4019ab3f6ca0cfc03416 Revert rust-lang/rust#133092 since it breaks our Linux Rust build. Bug: 395520092, 395891130 Change-Id: I91789dec738622e88746cbdc1ec7f5ffb401cc93 Disable-Rts: True Cq-Include-Trybots: chromium/try:chromeos-amd64-generic-cfi-thin-lto-rel Cq-Include-Trybots: chromium/try:dawn-win10-x86-deps-rel Cq-Include-Trybots: chromium/try:linux-chromeos-dbg Cq-Include-Trybots: chromium/try:linux_chromium_cfi_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_chromeos_msan_rel_ng Cq-Include-Trybots: chromium/try:linux_chromium_msan_rel_ng Cq-Include-Trybots: chromium/try:mac11-arm64-rel,mac_chromium_asan_rel_ng Cq-Include-Trybots: chromium/try:ios-catalyst,win-asan,android-official Cq-Include-Trybots: chromium/try:fuchsia-arm64-cast-receiver-rel Cq-Include-Trybots: chromium/try:mac-official,linux-official Cq-Include-Trybots: chromium/try:win-official,win32-official Cq-Include-Trybots: chromium/try:win-arm64-rel Cq-Include-Trybots: chromium/try:linux-swangle-try-x64,win-swangle-try-x86 Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-arm64-rel Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-riscv64-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-riscv64-rel Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-dbg Cq-Include-Trybots: chromium/try:android-cronet-mainline-clang-x86-rel Cq-Include-Trybots: chromium/try:android-cronet-riscv64-dbg Cq-Include-Trybots: chromium/try:android-cronet-riscv64-rel Cq-Include-Trybots: chrome/try:iphone-device,ipad-device Cq-Include-Trybots: chrome/try:linux-chromeos-chrome Cq-Include-Trybots: chrome/try:win-chrome,win64-chrome,linux-chrome,mac-chrome Cq-Include-Trybots: chrome/try:linux-pgo,mac-pgo,win32-pgo,win64-pgo Cq-Include-Trybots: luci.chromium.try:linux-cast-x64-rel Cq-Include-Trybots: chromium/try:android-rust-arm32-rel Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg Cq-Include-Trybots: chromium/try:android-rust-arm64-rel Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg Cq-Include-Trybots: chromium/try:linux-rust-x64-rel Cq-Include-Trybots: chromium/try:mac-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-dbg Cq-Include-Trybots: chromium/try:win-rust-x64-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6261055 Reviewed-by: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1420430}
cc
has a bug/feature (I guess depending on how you look at it) where the default deployment target is taken from the SDK instead of fromrustc
. This causescompiler-builtins
to buildcompiler-rt
with the wrong deployment target on iOS.I've been meaning to change how
cc
works in this regard, but that's a lengthy process, so let's fix it in bootstrap for now.The behaviour can be seen locally with
./x build library --set build.optimized-compiler-builtins=true
for various target triples, and then inspecting withotool -l build/host/stage1/lib/rustlib/*/lib/libcompiler_builtins-*.rlib | rg 'minos|version'
. I have added a rmake test that ensures that we now have the same version everywhere.Fixes #128419
Fixes rust-lang/compiler-builtins#650
Fixes #136523
See also rust-lang/cargo#13115, rust-lang/cc-rs#1171, #136113
See #133092 (comment) for a description of how the change works.
try-job: i686-gnu-1
try-job: i686-gnu-2
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: dist-apple-various
try-job: dist-aarch64-apple
try-job: dist-various-2
try-job: x86_64-fuchsia