about summary refs log tree commit diff
path: root/src/bootstrap/native.rs
AgeCommit message (Collapse)AuthorLines
2022-05-15Auto merge of #97055 - matthiaskrgr:rollup-1nqwfzx, r=matthiaskrgrbors-2/+2
Rollup of 3 pull requests Successful merges: - #96958 (Improve settings menu display and remove theme menu) - #97032 (Allow the unused_macro_rules lint for now) - #97041 (Fix `download-ci-llvm` NixOS patching for `.so`s.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-15Rollup merge of #97041 - eddyb:nixos-llvm-ci-patchelf, r=Mark-SimulacrumMatthias Krüger-2/+2
Fix `download-ci-llvm` NixOS patching for `.so`s. See https://github.com/rust-lang/rust/pull/95170#discussion_r872960686 - in short, `Path::ends_with` doesn't do the same thing as `str::ends_with`, and can only be used to check for whole file names, not extensions. With this PR, I get the full suite of: ``` extracting /home/eddy/Projects/rust-A/build/cache/llvm-ebb80ec4e90f8622440f3e33562db0d6e6c66555-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm info: you seem to be using Nix. Attempting to patch /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-config /nix/store/r4bzq2xilvv8fmqjg626hzwi22ah3hf4-rust-stage0-dependencies info: you seem to be using Nix. Attempting to patch /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck info: you seem to be using Nix. Attempting to patch /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm/lib/libLLVM-14-rust-1.62.0-nightly.so ``` (that `libLLVM-14-rust-1.62.0-nightly.so` at the end having been missing before) r? `@Mark-Simulacrum` cc `@jyn514`
2022-05-15Auto merge of #96602 - TApplencourt:patch-1, r=Mark-Simulacrumbors-31/+32
boostrap.py use curl by default Fixes #61611
2022-05-14Fix `download-ci-llvm` NixOS patching for `.so`s.Eduard-Mihai Burtescu-2/+2
2022-05-13Add LLVM based mingw-w64 targetsMateusz Mikuła-0/+4
2022-05-01Use curl by defaultThomas Applencourt-31/+32
2022-04-24Use `build/tmp` instead of adding a dependency on `tempfile`.Joshua Nelson-9/+7
2022-04-24Allow quotes around `nixos` in /etc/os-releaseJoshua Nelson-1/+2
2022-04-24Move download-ci-llvm to rustbuildJoshua Nelson-4/+289
This attempts to keep the logic as close to the original python as possible. `probably_large` has been removed, since it was always `True`, and UTF-8 paths are no longer supported when patching files for NixOS. I can readd UTF-8 support if desired. Note that this required making `llvm_link_shared` computed on-demand, since we don't know whether it will be static or dynamic until we download LLVM from CI.
2022-04-16Require all paths passed to `ShouldRun::paths` to exist on diskJoshua Nelson-3/+3
This has two benefits: 1. There is a clearer mental model of how bootstrap works. Steps correspond to paths on disk unless it's strictly impossible for them to do so (e.g. dist components). 2. Bootstrap has better checks for internal consistency. This caught several issues: - `src/sanitizers` doesn't exist; I changed it to just be a `sanitizers` alias. - `src/tools/lld` doesn't exist; I removed it, since `lld` alone already works. - `src/llvm` doesn't exist; removed it since `llvm` and `src/llvm-project` both work. - `src/lldb_batchmode.py` doesn't exist, it was moved to `src/etc`. - `install` was still using `src/librustc` instead of `compiler/rustc`. - None of the tools in `dist` / `install` allowed using `src/tools/X` to build them. This might be intentional - I can change them to aliases if you like.
2022-03-25resolve: Stop passing unused spans and node ids to path resolution functionsVadim Petrochenkov-1/+1
2022-03-10bootstrap: untangle static-libstdcpp & llvm-toolsJon Gjengset-1/+1
Previously, the static-libstdcpp setting was tied to llvm-tools such that enabling the latter always enabled the latter. This seems unfortunate, since it is entirely reasonable for someone to want to _not_ statically link stdc++, but _also_ want to build the llvm-tools. This patch therefore separates the two settings such that neither implies the other. On its own, that would change the default behavior in a way that's likely to surprise users. Specifically, users who build llvm-tools _likely_ want those tools to be statically compiled against libstdc++, since otherwise users with older GLIBCXX will be unable to run the vended tools. So, we also flip the default for the `static-libstdcpp` setting such that builds always link statically against libstdc++ by default, but it's _possible_ to opt out. See also #94719.
2022-03-07Statically compile libstdc++ everywhere if askedJon Gjengset-12/+12
PR #93918 made it so that `-static-libstdc++` was only set in one place, and was only set during linking, but accidentally also made it so that it is no longer passed when building LLD or sanitizers, only when building LLVM itself. This moves the logic for setting `-static-libstdc++` in the linker flags back to `configure_cmake` so that it takes effect for all CMake invocations in `native.rs`. As a side-effect, this also causes libstdc++ to be statically compiled into sanitizers and LLD if `llvm-tools-enabled` is set but `llvm-static-stdcpp` is not, even though previously it was only linked statically if `llvm-static-stdcpp` was set explicitly. But that seems more like the expected behavior anyway.
2022-03-06Rollup merge of #94621 - ridwanabdillahi:lld-rel-dbg, r=Mark-Simulacrumfee1-dead-1/+9
rustbuild: support RelWithDebInfo for lld r? ``@alexcrichton`` LLVM has flags that control the level of debuginfo generated when building via rustbuild. Since LLD is built separately, it currently has no way of generating any debuginfo. This change re-uses the same flags as LLVM for LLD to ensure it has the same level of debuginfo generated as LLVM.
2022-03-05Merge build_helper into utilbjorn3-3/+1
2022-03-05Remove build_helperbjorn3-3/+2
The majority of the code is only used by either rustbuild or rustc_llvm's build script. Rust_build is compiled once for rustbuild and once for every stage. This means that the majority of the code in this crate is needlessly compiled multiple times. By moving only the code actually used by the respective crates to rustbuild and rustc_llvm's build script, this needless duplicate compilation is avoided.
2022-03-04Support RelWithDebInfo for lld.ridwanabdillahi-1/+9
2022-03-03bootstrap: correct reading of flags for llvmJon Gjengset-12/+14
First, this reverts the `CFLAGS`/`CXXFLAGS` of #93918. Those flags are already read by `cc` and populated into `Build` earlier on in the process. We shouldn't be overriding that based on `CFLAGS`, since `cc` also respects overrides like `CFLAGS_{TARGET}` and `HOST_CFLAGS`, which we want to take into account. Second, this adds the same capability to specify target-specific versions of `LDFLAGS` as we have through `cc` for the `C*` flags: https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables Note that this also necessitated an update to compiletest to treat CXXFLAGS separately from CFLAGS.
2022-02-11bootstrap: -static-libstdc++ is a linker flagJon Gjengset-14/+8
Fixes #70468. Closes #89983.
2022-02-11bootstrap: make LLVM build respect *FLAGS envvarsJon Gjengset-22/+63
This tidies up the logic in `src/bootstrap/native.rs` such that: - `CMAKE_*_LINKER_FLAGS` is not overridden if we add to it twice. - `CMAKE_*_FLAGS` also include the standard `*FLAGS` environment variables, which CMake respects when we _don't_ set `CMAKE_*_FLAGS`. - `llvm.ldflags` from `config.toml` appends to the ldflags Rust's bootstrap logic adds, rather than replacing them. Fixes #93880.
2022-02-09Add llvm.build-config optionTyler Mandry-0/+4
2021-12-03Explain why libatomic is not needed on FreeBSD riscv64Tobias Kortkamp-2/+7
From Jessica Clarke (jrtc27@)
2021-11-27Add riscv64gc-unknown-freebsdTobias Kortkamp-1/+1
2021-10-22Update the minimum external LLVM to 12Josh Stone-2/+2
2021-10-22Update the minimum external LLVM to 11Josh Stone-2/+2
2021-10-18config: add the option to enable LLVM testsAugie Fackler-1/+2
I'm working on some LLVM patches in concert with a Rust patch, and it's helping me quite a bit to have this as an option. It doesn't seem that hard, so I figured I'd formalize it in x.py and send it upstream.
2021-09-17bootstrap: Add LLVM target matching for M68kJohn Paul Adrian Glaubitz-1/+1
2021-09-04Auto merge of #88364 - pietroalbini:llvm-install-filecheck, r=Mark-Simulacrumbors-0/+5
Make sure FileCheck is copied in the LLVM output directory The tool, which is needed by parts of our test suite, is built as part of LLVM but is *not* copied to the directory containing the output LLVM binaries. This adds a flag to ensure the binary is copied. This shouldn't add any extra built time, as the flag just installs extra binaries that were already compiled. This is not strictly needed for the test suite to work (as it also checks `build/$target/llvm/build/bin` for the binary), but it allows deleting the `build/$TARGET/llvm/build` directory (which also contains the intermediary build artifacts) without affecting the test suite, saving disk space.
2021-08-30sunos systems add sanitizer supported.David Carlier-0/+2
2021-08-28build llvm libunwind.a in rustbuild12101111-1/+152
2021-08-26make sure FileCheck is copied in the LLVM output directoryPietro Albini-0/+5
The tool, which is needed by parts of our test suite, is built as part of LLVM but is *not* copied to the directory containing the output LLVM binaries. This adds a flag to ensure the binary is copied. This shouldn't add any extra built time, as the flag just installs extra binaries that were already compiled.
2021-08-24PGO for LLVM builds on x86_64-unknown-linux-gnu in CIMark Rousskov-0/+8
This shows up to 5% less instruction counts on multiple benchmarks, and up to 19% wins on the -j1 wall times for rustc self-compilation. We can afford to spend the extra cycles building LLVM essentially once more for the x86_64-unknown-linux-gnu CI build today. The builder finishes in around 50 minutes on average, and this adds just 10 more minutes. Given the sizeable improvements in compiler performance, this is definitely worth it.
2021-08-16Set LLVM_INCLUDE_TESTS=OFF when building LLVMNikita Popov-0/+1
When LLVM_INCLUDE_TESTS is enabled (by default), LLVM requires Python 3.6 for the lit test runner, otherwise only Python 3.0 is required. As we have many docker images using Ubuntu 16.04, which only has Python 3.5, this avoids the need to install a newer Python version for them.
2021-08-02Auto merge of #87297 - ZuseZ4:new_build_flags, r=Mark-Simulacrumbors-0/+6
add two new build flags to build clang and enable llvm plugins Based on the discussion here: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Add.20configure.20flag.20to.20build.20clang/near/246439138 It allows building clang (which already is part of the llvm-project) based on the same llvm version which we use to build rustc. It also allows enabling llvm's plugin interface, which is required for https://enzyme.mit.edu/. There is no further integration beside of this basic build support.
2021-07-31add two new build flags to build clang and enable llvm pluginsManuel Drehwald-0/+6
2021-07-31netbsd x86_64 arch enable supported sanitizers.David Carlier-0/+3
2021-07-22Add support for powerpc-unknown-freebsdPiotr Kubaj-0/+9
2021-07-20Update all submodules that rustbuild doesn't depend on lazilyJoshua Nelson-84/+2
This only updates the submodules the first time they're needed, instead of unconditionally the first time you run x.py. Ideally, this would move *all* submodules and not exclude some tools and backtrace. Unfortunately, cargo requires all `Cargo.toml` files in the whole workspace to be present to build any crate. On my machine, this takes the time for an initial submodule clone (for `x.py --help`) from 55.70 to 15.87 seconds. This uses exactly the same logic as the LLVM update used, modulo some minor cleanups: - Use a local variable for `src.join(relative_path)` - Remove unnecessary arrays for `book!` macro and make the macro simpler to use - Add more comments
2021-07-10Account for `submodules = false` in config.toml when updating LLVM submoduleJoshua Nelson-0/+4
2021-06-26Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkovbors-2/+2
Use HTTPS links where possible While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS. Notes: - I didn't change any to or in licences - Some links don't support HTTPS :( - Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
2021-06-25Auto merge of #86015 - jyn514:revert-revert, r=Mark-Simulacrumbors-1/+80
Move LLVM submodule updates back to native.rs Time to find more bugs! The first commit is a straight revert of https://github.com/rust-lang/rust/pull/85647, the second is a fix for https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/x.2Epy.20always.20updates.20LLVM.20submodule/near/240113320 and https://github.com/rust-lang/rust/pull/82653#issuecomment-846755631. I haven't been able to replicate https://github.com/rust-lang/rust/pull/82653#issuecomment-849013698.
2021-06-23Use HTTPS links where possibleSmitty-2/+2
2021-06-06Auto merge of #79608 - alessandrod:bpf, r=nagisabors-1/+1
BPF target support This adds `bpfel-unknown-none` and `bpfeb-unknown-none`, two new no_std targets that generate little and big endian BPF. The approach taken is very similar to the cuda target, where `TargetOptions::obj_is_bitcode` is enabled and code generation is done by the linker. I added the targets to `dist-various-2`. There are [some tests](https://github.com/alessandrod/bpf-linker/tree/main/tests/assembly) in bpf-linker and I'm planning to add more. Those are currently not ran as part of rust CI.
2021-06-05Simplify commit checkJoshua Nelson-22/+15
2021-06-04Fix commit checkJoshua Nelson-4/+8
2021-06-04Revert "Revert "Move llvm submodule updates to rustbuild""Joshua Nelson-1/+83
This reverts commit ad308264a38531bc8d2179324bac3652a1cda640.
2021-05-31Auto merge of #85395 - 12101111:build-crt, r=petrochenkovbors-0/+66
Build crtbegin.o/crtend.o from source code Build crtbengin.o/crtend.o from source code instead of copying from gcc. The crtbegin and crtend implementation from llvm don't need `crtbeginS.o` for PIC. `crtbegin{,S,T}.o` is unified into one generic `crtbegin.o`. See the comments in https://reviews.llvm.org/D28791#1419436 and https://reviews.llvm.org/D28791#1420914 fix: https://github.com/rust-lang/rust/issues/85310 , fix: https://github.com/rust-lang/rust/issues/47551 , fix: https://github.com/rust-lang/rust/issues/84033
2021-05-31Build crtbengin.o/crtend.o from source code12101111-0/+66
2021-05-29BPF: misc minor review fixesAlessandro Decina-2/+2
2021-05-27Do not try to build LLVM with Zlib on WindowsMateusz Mikuła-1/+1
We do not install Zlib on the CI but recent builds somehow started picking it's shared version. To avoid relying on CI binaries so let's explicitly disable it.