Commit graph

56 commits

Author SHA1 Message Date
Matthias Krüger 873de7e106
Rollup merge of #123642 - onur-ozkan:restrict-llvm-option, r=Mark-Simulacrum
do not allow using local llvm while using rustc from ci

From: https://github.com/rust-lang/rust/issues/123586#issuecomment-2043296578

> Even if `llvm.download-ci-llvm` is set to true, `stage > 0` rustc will always use the prebuilt LLVM library which comes with ci-rustc. So I tried to use locally-built LLVM libraries in the ci-rustc by replacing the existing LLVM libraries with the locally built ones, and it appears that this is indeed a limitation of using `rust.download-rustc=true` as it fails with the following error:
>
> ```
> $ ./build/host/ci-rustc/bin/rustc --version
> ./build/host/ci-rustc/bin/rustc: symbol lookup error: /home/nimda/devspace/.other/rustc-builds/build/x86_64-unknown-linux-gnu/ci-rustc/bin/../lib/librustc_driver-a03ea465d8e03db1.so: undefined symbol: LLVMInitializeARMTargetInfo, version LLVM_18.1
> ```
>
> So, if `rust.download-rustc` is set to true and `llvm.download-ci-llvm` is false, I believe bootstrap should terminate the process (as it always uses prebuilt LLVM libraries from ci-rustc, there is no point to build LLVM locally) while parsing the configuration.

Resolves #123586

r? Mark-Simulacrum
2024-04-13 16:42:04 +02:00
onur-ozkan bd479113d3 correct the handling of bootstrap-cache-path option
This change makes `build.bootstrap-cache-path` option to be configurable with
`./configure` script, so it can be used like `./configure --bootstrap-cache-path=demo`.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-11 14:57:10 +03:00
onur-ozkan a7aa7fdd12 do not allow using local llvm while using rustc from ci
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-04-09 00:09:55 +03:00
Tshepang Mbambo 75a5196490
use more accurate terminology
rustc is just one tool/executable, even if at the center of the toolchain
2024-03-19 20:32:55 +02:00
Tim Neumann 0e354c98a8 [bootstrap] Move the split-debuginfo setting to the per-target section 2024-03-11 20:17:00 +01:00
Kjetil Kjeka 6a50d059a5 Bootstrap: Add argument for building llvm bitcode linker 2024-03-11 13:35:55 +01:00
Alex Crichton dd95cb7106 Add target.*.runner configuration for targets
This commit adds a `runner` field configuration to `config.toml` for
specifying a wrapper executable when executing binaries for a target.
This is pulled out of #122036 where a WebAssembly runtime is used, for
example, to execute tests for `wasm32-wasip1`.

The name "runner" here is chosen to match Cargo's `CARGO_*_RUNNER`
configuration, and to make things a bit more consistent this
additionally renames compiletest's `--runtool` argument to `--runner`.
2024-03-08 07:44:03 -08:00
Matthias Krüger 24a2169a23
Rollup merge of #121976 - lu-zero:bootstrap-cache, r=onur-ozkan
Add an option to have an external download/bootstrap cache

Follow up from #116697 to address https://github.com/rust-lang/rust/pull/116697#pullrequestreview-1677176395
2024-03-06 22:41:53 +01:00
Luca Barbato c98e25bab9 Add a build option to specify the bootstrap cache
Setting the bootstrap cache path to an external location can help to
speed up builds in cases where the build directory is not kept between
builds, e.g. in CI or other automated build systems.
2024-03-05 10:35:43 +01:00
Alex Crichton cb39d6c515 Add a new wasm32-wasip1 target to rustc
This commit adds a new target called `wasm32-wasip1` to rustc.
This new target is explained in these two MCPs:

* https://github.com/rust-lang/compiler-team/issues/607
* https://github.com/rust-lang/compiler-team/issues/695

In short, the previous `wasm32-wasi` target is going to be renamed to
`wasm32-wasip1` to better live alongside the [new
`wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616).
This new target is added alongside the `wasm32-wasi` target and has the
exact same definition as the previous target. This PR is effectively a
rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that
as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi`
target is not being removed at this time. This change will reach stable
Rust before even a warning about the rename will be printed. At this
time this change is just the start where a new target is introduced and
users can start migrating if they support only Nightly for example.
2024-03-02 09:03:51 -08:00
Nilstrieb 09e6043483 Add rust.frame-pointers config option
This is very helpful for profiling. I've hacked this in many times, so
let's add it properly.
2024-02-18 22:23:09 +01:00
Tshepang Mbambo 6147973082 remove extraneous text from example config 2024-02-18 10:41:31 +02:00
bjorn3 28af00c611 Support configuring the set of codegen backends to build per host triple
This allows building the compiler itself with one backend while using
another backend at runtime. For example this allows compiling rustc to
wasm using LLVM, while using Cranelift at runtime to produce actual
code. Cranelift can't compile to wasm, but is perfectly capable of
running on wasm. LLVM can compile to wasm, but can't run on wasm. [^1]

[^1]: The prototype of this still requires a couple of other patches.
2024-01-25 18:55:27 +00:00
jyn 6a409ddbe4 add a new optimized_compiler_builtins option
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.
2024-01-07 13:04:40 +03:00
onur-ozkan 12190e5dd2 utilize the unused llvm-tools option
This field was not functioning as described in its comment in `config.example.toml`.
Also, updated the default value to `true` to keep the bootstrapping behavior as it was before.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-28 17:27:59 +03:00
jyn 0e88874292 fix ./configure --set change-id 2023-12-25 08:04:00 -05:00
Matthias Krüger c644d00285
Rollup merge of #119124 - onur-ozkan:help-118861, r=Mark-Simulacrum
don't build `rust-analyzer-proc-macro-srv` on def config

Should be very easy to understand when reviewing commit-by-commit.

Blocker for #118861
2023-12-21 16:43:07 +01:00
onur-ozkan bccac41db7 update build.tools in config.example.toml
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-19 18:27:08 +03:00
onur-ozkan ce2eaa6325 Comment out change-id in config.example.toml
This way, we only update CONFIG_CHANGE_HISTORY for major changes, which is
much simpler (and updating example.toml doesn't make much sense)

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-18 15:54:10 +03:00
Jakub Beránek f1c5558edc
Add ChangeInfo record 2023-12-10 20:45:07 +01:00
Jakub Beránek 50865745e1
Update config.example.toml 2023-12-10 11:21:35 +01:00
l00846161 3f8487a099 Add safe compilation options
Add two options when building rust: strip and stack protector.
If set `strip = true`, symbols will be stripped using `-Cstrip=symbols`.
Also can set `stack-protector` and stack protectors will be used.
2023-12-05 14:22:08 +08:00
onur-ozkan 6d881a9946 add change information for PR#117813
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-24 23:14:17 +03:00
Arlie Davis e11d8d147b Add support for generating the EHCont section
In the future Windows will enable Control-flow Enforcement Technology
(CET aka Shadow Stacks). To protect the path where the context is
updated during exception handling, the binary is required to enumerate
valid unwind entrypoints in a dedicated section which is validated when
the context is being set during exception handling.

The required support for EHCONT has already been merged into LLVM,
long ago. This change adds the Rust codegen option to enable it.

Reference:

* https://reviews.llvm.org/D40223

This also adds a new `ehcont-guard` option to the bootstrap config which
enables EHCont Guard when building std.
2023-11-21 13:41:23 -08:00
onur-ozkan 23446427fe merge if-available and if-unchanged for download-ci-llvm
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-11 18:29:11 +03:00
LuuuX 1b8dee19e8 Fix issue #110087
Three tasks have been implemented here.

Add a new `download-ci-llvm = if-unchange` option and enable if by
default for `profile = codegen`.

Include all build artifacts by traversing the llvm-project build output,
Keep the downloadable llvm the same state as if you have just run a full
source build.

After selecting the codegen profile during ./x.py setup, the submodule
will be automatically downloaded.
2023-11-08 09:22:28 +08:00
SparrowLii 248dd14fa5 update config.example.toml 2023-10-31 17:30:41 +08:00
SparrowLii bf5fb7614b update bootstrap change history 2023-10-31 16:52:16 +08:00
Peter Collingbourne aad44b3b54 Improve android-ndk property interface
PR #105716 added support for NDK r25b, and removed support for r15. Since
the switch to r25b would have broken existing r15 users anyway, let's
take the opportunity to make the interface more user friendly.

Firstly move the android-ndk property to [build] instead of the
targets. This is possible now that the NDK has obsoleted the concept of
target-specific toolchains.

Also make the property take the NDK root directory instead of the
"toolchains/llvm/prebuilt/<host tag>" subdirectory.
2023-10-23 12:15:20 -07:00
bors 781ebbec8a Auto merge of #115898 - onur-ozkan:config-change-tracking, r=Mark-Simulacrum
bootstrap major change detection implementation

The use of `changelog-seen` and `bootstrap/CHANGELOG.md` has not been functional in any way for many years. We often do major/breaking changes but never update the changelog file or the `changelog-seen`. This is an alternative method for tracking major or breaking changes and informing developers when such changes occur.

Example output when bootstrap detects a major change:
![image](https://github.com/rust-lang/rust/assets/39852038/ee802dfa-a02b-488b-a433-f853ce079b8a)
2023-10-02 07:41:52 +00:00
onur-ozkan 957de61594 implement major change tracking for the bootstrap configuration
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-01 16:54:52 +03:00
Matthias Krüger 2e38432525
Rollup merge of #115558 - tshepang:patch-4, r=Mark-Simulacrum
issue has since been fixed
2023-09-18 13:02:17 +02:00
Tshepang Mbambo a716c9620f
address review comment
See https://github.com/rust-lang/rust/pull/115558#issuecomment-1722601187
2023-09-18 03:42:35 +02:00
onur-ozkan 685b5c250f update build.extended comments in config.example.toml
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-09-10 23:58:05 +03:00
Tshepang Mbambo 86d32ef92e
issue has since been fixed 2023-09-05 10:53:46 +02:00
Dirreke d16409fe22 add a csky-unknown-linux-gnuabiv2 target 2023-08-14 23:02:36 +08:00
Guillaume Gomez 99144c3f04
Rollup merge of #114069 - cuviper:profiler-path, r=Mark-Simulacrum
Allow using external builds of the compiler-rt profile lib

This changes the bootstrap config `target.*.profiler` from a plain bool
to also allow a string, which will be used as a path to the pre-built
profiling runtime for that target. Then `profiler_builtins/build.rs`
reads that in a `LLVM_PROFILER_RT_LIB` environment variable.
2023-08-13 21:00:45 +02:00
Josh Stone 6e05f596fa
Fix spacing in target.*.profiler docs
Co-authored-by: Joe ST <joe@fbstj.net>
2023-07-26 09:34:39 -07:00
Josh Stone d0b58f40a0 Allow using external builds of the compiler-rt profile lib
This changes the bootstrap config `target.*.profiler` from a plain bool
to also allow a string, which will be used as a path to the pre-built
profiling runtime for that target. Then `profiler_builtins/build.rs`
reads that in a `LLVM_PROFILER_RT_LIB` environment variable.
2023-07-25 13:11:50 -07:00
Mateusz Mikuła cf4fcf82e1 Move MinGW linker dist option to proper section 2023-07-15 15:43:19 +02:00
hi-rustin 92b5d0c4cb Use String or Int to set the opt level
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-07-09 13:53:26 +08:00
klensy af36fbfc33 few fixes to rust rustdoc-gui tests on windows 2023-06-12 18:31:42 +03:00
Wang Qilin 23e443a5fa support enable rpath in each target independently 2023-05-05 17:46:10 +08:00
Michael Goulet e6975455d9
Rollup merge of #110155 - DaniPopes:rest-typos, r=jyn514
Fix typos in librustdoc, tools and config files

I used [`typos`](https://github.com/crate-ci/typos) to fix all typos, minus the ones present in #110153 and in #110154.

Refs #110150
2023-04-11 20:28:49 -07:00
Michael Goulet 4a24aab220
Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiser
Initial support for loongarch64-unknown-linux-gnu

Hi, We hope to add a new port in rust for LoongArch.

LoongArch intro
LoongArch is a RISC style ISA which is independently designed by Loongson
Technology in China. It is divided into two versions, the 32-bit version (LA32)
and the 64-bit version (LA64). LA64 applications have application-level
backward binary compatibility with LA32 applications. LoongArch is composed of
a basic part (Loongson Base) and an expanded part. The expansion part includes
Loongson Binary Translation (LBT), Loongson VirtualiZation (LVZ), Loongson SIMD
EXtension (LSX) and Loongson Advanced SIMD EXtension(LASX).

Currently the LA464 processor core supports LoongArch ISA and the Loongson
3A5000 processor integrates 4 64-bit LA464 cores. LA464 is a four-issue 64-bit
high-performance processor core. It can be used as a single core for high-end
embedded and desktop applications, or as a basic processor core to form an
on-chip multi-core system for server and high-performance machine applications.

Documentations:
ISA:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
ABI:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
More docs can be found at:
https://loongson.github.io/LoongArch-Documentation/README-EN.html

Since last year, we have locally adapted two versions of rust, rust1.41 and rust1.57, and completed the test locally.
I'm not sure if I'm submitting all the patches at once, so I split up the patches and here's one of the commits
2023-04-11 20:28:45 -07:00
DaniPopes f470c29936
Fix remaining typos 2023-04-10 21:02:49 +02:00
Yuki Okushi ec1712f06e
Rollup merge of #110059 - gimbles:git-hash, r=ozkanonur
ignore_git → omit_git_hash

Fixes #110020
2023-04-09 12:35:54 +09:00
Krishna Ramasimha 2b36f5a40f
Fix a typo in config.example.toml 2023-04-08 13:49:00 +05:30
Gimbles c80a69440c s/ignore_git/omit_git_hash 2023-04-08 11:08:01 +05:30
zhaixiaojuan ccf5417799 Enable loongarch64 LLVM target 2023-04-04 17:05:08 +08:00