Reland optimized-compiler-builtins config - #102579
Conversation
This comment has been minimized.
This comment has been minimized.
fbb4c86 to
37c21a3
Compare
There was a problem hiding this comment.
We may not be using a pre-built version of LLVM. Specifically the use case I want to support is cd into src/llvm-project, check out a vanilla commit, and set submodules = false, llvm-has-rust-patches = false in config.
There was a problem hiding this comment.
That seems totally bizarre, though. Why would you want that?
There was a problem hiding this comment.
To build against a more recent version of LLVM.
If you separately build and supply your own llvm-config, then you hit the other assumptions in here about not needing to distribute the LLVM libraries because it's probably system installed. So basically this was unsupported before.
Plus it's desirable to have bootstrap manage the configuration of LLVM if all you want to vary is the version.
There was a problem hiding this comment.
You can use compiler-rt without Rust patches. I think the important thing is that compiler-rt is built from the same sources as LLVM. So.. either llvm-config is unset, or llvm_from_ci is active and we're managing submodules?
There was a problem hiding this comment.
Yeah, as I wrote in #101833 (comment) enabling optimized_compiler_builtins is kinda required on some targets, and from my understanding the only requirement is that the sources of compiler-rt has to be the same as the custom LLVM's. We probably need a way to supply the custom sources in those cases.
commented
Oct 18, 2022
|
@rustbot author |
commented
Oct 31, 2022
|
☔ The latest upstream changes (presumably #103797) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@tmandry I am still very confused how
3 defines LLVM_RUSTLLVM, which is eventually used in rust/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp Lines 308 to 311 in 693c631 --system-llvm for an in-tree commit with submodules = false and patches = false. How is llvm_has_rust_patches tested? how is it supposed to work? I ran llvm-config --ldflags --system-llvm locally and it didn't even exit successfully ...
|
37c21a3 to
7945458
Compare
|
ugh I misread, it's a compiletest flag, not an llvm-config flag. so I think what was happening before is that some tests were silently being ignored, which we don't have any sort of checks for: rust/src/tools/compiletest/src/header.rs Lines 1059 to 1061 in d5fd1af I'll fix 1 at the same time as I address your and pietro's comments. |
This comment has been minimized.
This comment has been minimized.
50baed3 to
a8b210d
Compare
commented
Nov 25, 2022
|
Ok, pushed a few changes. @pietroalbini @tmandry let me know if you think this will work better. |
commented
Jan 25, 2023
|
@rustbot author (I think there are some outstanding concerns from Pietro to be addressed) |
commented
Jul 29, 2023
|
☔ The latest upstream changes (presumably #114148) made this pull request unmergeable. Please resolve the merge conflicts. |
commented
Aug 21, 2023
38392fb to
eb945e2
Compare
commented
Dec 25, 2023
|
This PR modifies If appropriate, please update This PR modifies If appropriate, please update |
This comment has been minimized.
This comment has been minimized.
commented
Dec 25, 2023
|
i am going to remove the check that the in-tree llvm matches the llvm we're linking to, actually. i am not sure the difference matters, and it wasn't enforced before. |
in particular, this makes the `c` feature for compiler-builtins an explicit opt-in, rather than silently detected by whether `llvm-project` is checked out on disk. exposing this is necessary because the `cc` crate doesn't support cross-compiling to MSVC, and we want people to be able to run `x check --target foo` regardless of whether they have a c toolchain available. this also uses the new option in CI, where we *do* want to optimize compiler_builtins. the new option is off by default for the `dev` channel and on otherwise.
eb945e2 to
a10b1be
Compare
commented
Dec 25, 2023
|
r? bootstrap |
commented
Dec 25, 2023
|
@rustbot ready |
commented
Dec 29, 2023
|
☔ The latest upstream changes (presumably #119373) made this pull request unmergeable. Please resolve the merge conflicts. |
this is possible now that compiler-builtins contains the fix in rust-lang/compiler-builtins#532.
in particular, this makes the
cfeature for compiler-builtins an explicit opt-in, rather than silently detected by whetherllvm-projectis checked out on disk.exposing this is necessary because the
cccrate doesn't support cross-compiling to MSVC, and we want people to be able to runx check --target fooregardless of whether they have a c toolchain available.this also uses the new option in CI, where we do want to optimize compiler_builtins.
the new option is off by default for the
devchannel and on otherwise.Fixes #102560. Fixes #101172. Helps with #105065 (although there's some weirdness there - it's still broken when
optimized-compiler-builtinsis set totrue).r? @tmandry cc @Mark-Simulacrum