about summary refs log tree commit diff
path: root/compiler/rustc_llvm/build.rs
AgeCommit message (Collapse)AuthorLines
2025-09-12remove outdated jsbackend leftoversklensy-1/+0
2025-09-09Rollup merge of #146184 - dpaoliello:llvmbuildarm64, r=cuviperStuart Cook-1/+4
In the rustc_llvm build script, don't consider arm64* to be 32-bit The build script for `rustc_llvm` needs to detect 32-bit targets so that it links against `libatomics`. To do this, it matches the target architecture against `arm`, unfortunately incorrectly matches Arm64EC, Arm64E, etc. This change adds a check that the target arch doesn't match `arm64`.
2025-09-06Update comment for werror on rust-lang/rust CI explaining why we keep MSVC ↵Romain Perier-4/+4
definitively excluded
2025-09-03In the rustc_llvm build script, don't consider arm64* to be 32-bitDaniel Paoliello-1/+4
2025-08-16Remove `LlvmArchiveBuilder` and supporting code/bindingsZalathar-1/+0
2025-08-10Fix typo with paren rustc_llvm/build.rsDaniel Paoliello-1/+1
2025-08-07Pass -Werror when building the LLVM wrapperRomain Perier-0/+10
Enabling warning_into_errors() only whether it's in rust-lang/rust CI, so deprecated uses of LLVM methods can be treated as errors.
2025-07-11Avoid building C++ for rustc_llvm with --compile-time-depsbjorn3-0/+4
This saves about 30s.
2025-05-31rustc_llvm: add Windows system libs only when cross-compiling from WindowsMateusz Mikuła-2/+2
This obviously doesn't work when cross-compiling from Linux. Split out from: https://github.com/rust-lang/rust/pull/140772
2025-05-15Experimental cygwin support in rustc王宇逸-0/+1
Co-authored-by: Ookiineko <chiisaineko@protonmail.com>
2025-03-04promote ohos targets to tier to with host toolsLuuuXXX-1/+2
2025-02-22Fix overcapturing, unsafe extern blocks, and new unsafe opsMichael Goulet-2/+6
2025-02-10move second opt run to lto phase and cleanup codeManuel Drehwald-0/+4
2024-12-27Fix typoschloefeal-1/+1
Signed-off-by: chloefeal <188809157+chloefeal@users.noreply.github.com>
2024-09-15Add system libs when cross compiling for WindowsChris Denton-1/+4
2024-08-09Enable zstd for debug compression.Kyle Huey-3/+26
Set LLVM_ENABLE_ZSTD alongside LLVM_ENABLE_ZLIB so that --compress-debug-sections=zstd is an option. Use static linking to avoid a new runtime dependency. Add an llvm.libzstd bootstrap option for LLVM with zstd. Set it off by default except for the dist builder. Handle llvm-config --system-libs output that contains static libraries.
2024-07-12Fix incorrect NDEBUG handling in LLVM bindingsNikita Popov-2/+1
We currently compile our LLVM bindings using `-DNDEBUG` if debuginfo for LLVM is disabled. However, `NDEBUG` doesn't have any relation to debuginfo, it controls whether assertions are enabled. Rename the environment variable to `LLVM_ASSERTIONS` and drive it using the `llvm_assertions` option. Also drop the explicit `debug(false)` call, as cc already sets this up using the cargo `DEBUG` environment variable.
2024-06-24rustc_llvm: Link against libatomic on 32-bit SPARCJohn Paul Adrian Glaubitz-0/+1
While at it, order the list of architectures alphabetically.
2024-05-29Teach rustc about the Xtensa arch.Scott Mabin-0/+1
2024-04-24Improved the compiler code with clippyMichael Scholten-1/+1
2024-04-06Rollup merge of #123294 - Nilstrieb:reuqire-llvm-config, r=clubby789Matthias Krüger-20/+2
Require LLVM_CONFIG to be set in rustc_llvm/build.rs This environment variable should always be set by bootstrap in `rustc_llvm_env`. The fallback is quite ugly and complicated, so removing it is nice. https://github.com/rust-lang/rust/blob/bf71daedc29e7a240261acd1516378047e311a6f/src/bootstrap/src/core/build_steps/compile.rs#L1166 I tried finding when this was added in git history, but it pointed all the way to "add build scripts" at which point I stopped digging more. This has always been here. cc `@nikic` `@cuviper` in case you happen to be aware of a deeper reason behind this r? bootstrap
2024-04-02Fix build on AIXKai Luo-1/+2
2024-04-02Fix linking c++ runtimes on AIXKai Luo-0/+5
2024-03-31Require LLVM_CONFIG to be set in rustc_llvm/build.rsNilstrieb-20/+2
This environment variable should always be set by bootstrap in `rustc_llvm_env`. The fallback is quite ugly and complicated, so removing it is nice.
2023-12-05Use new check-cfg syntax in rustc_llvm build scriptUrgau-1/+1
2023-11-13Rollup merge of #114224 - inferiorhumanorgans:solaris-llvm-wrapper, r=cuviperMatthias Krüger-0/+6
rustc_llvm: Link to libkstat on Solaris/SPARC getHostCPUName calls into libkstat but as of LLVM 16.0.6 libLLVMTargetParser is not explicitly linked against libkstat causing builds to fail due to undefined symbols. See also: llvm/llvm-project#64186
2023-11-13Mention LLVM 64186 in a commentJosh Stone-0/+1
2023-10-27For i586/NetBSD: fix another formatting insistence.Havard Eidnes-3/+1
2023-10-26rustc_llvm/build.rs: improve comment for NetBSD/i386 targetsHavard Eidnes-1/+3
...explaining why we need -latomic (gcc & g++ built for i486, and LLVM insisting on use of 64-bit atomics).
2023-10-25Add support for i586-unknown-netbsd as target.Havard Eidnes-0/+6
This restricts instructions to those offered by Pentium, to support e.g. AMD Geode. There is already an entry for this target in the NetBSD platform support page at src/doc/rustc/src/platform-support/netbsd.md ...so this should forestall its removal. Additional fixes are needed for some vendored modules, this is the changes in the rust compiler core itself.
2023-09-02Rollup merge of #114349 - inferiorhumanorgans:dragonfly-link-libz, r=cuviperMatthias Krüger-1/+4
rustc_llvm: Link to `zlib` on dragonfly and solaris On native builds `llvm-config` picks up `zlib` and this gets pased into the rust build tools, but on cross builds `llvm-config` is explicitly ignored as it contains information for the host system and cannot be trusted to be accurate for the target system. Both DragonFly and Solaris contain `zlib` in the base system, so this is both a safe assumption and required for a successful cross build unless `zlib` support is disabled in LLVM. This is more or less in the same vein as rust-lang#75713 and rust-lang#75655.
2023-08-14add a csky-unknown-linux-gnuabiv2 targetDirreke-0/+1
2023-08-07rustc_llvm: Link `zlib` on cross Solaris buildsAlex Zepeda-1/+3
On native builds `llvm-config` picks up `zlib` and this gets pased into the rust build tools, but on cross builds `llvm-config` is explicitly ignored as it contains information for the host system and cannot be trusted to be accurate for the target system. Both DragonFly and Solaris contain `zlib` in the base system, so this is both a safe assumption and required for a successful cross build unless `zlib` support is disabled in LLVM. This is more or less in the same vein as #75713 and #75655.
2023-08-01rustc_llvm: Link to `zlib` on dragonflyAlex Zepeda-1/+2
2023-07-29rustc_llvm: Link to libkstat on Solaris/SPARCAlex Zepeda-0/+5
getHostCPUName calls into libkstat but as of LLVM 16.0.6 libLLVMTargetParser is not explicitly linked against libkstat causing builds to fail due to undefined symbols. See also: llvm/llvm-project#64186
2023-07-17Link to `execinfo` on NetBSDJakub Beránek-1/+4
2023-04-04Enable loongarch64 LLVM targetzhaixiaojuan-0/+1
2023-03-23Link against libc++ on AIXKai Luo-0/+1
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-14/+14
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-12-09Auto merge of #104572 - pkubaj:patch-1, r=cuviperbors-6/+8
Fix build on powerpc-unknown-freebsd Probably also fixes build on arm and mips*. Related to https://github.com/rust-lang/rust/issues/104220
2022-12-09Fix build on powerpc-unknown-freebsdpkubaj-6/+8
Probably also fixes build on mips*. Related to https://github.com/rust-lang/rust/issues/104220
2022-11-26Rewrite LLVM's archive writer in Rustbjorn3-0/+1
This allows it to be used by other codegen backends
2022-10-28Upgrade dist-x86_64-netbsd to NetBSD 9.0Josh Stone-1/+1
2022-08-28add riscv64gc-unknown-openbsd support (target riscv64-unknown-openbsd on ↵Sébastien Marie-2/+2
OpenBSD) - add platform-support documentation - add riscv64gc-unknown-openbsd spec - do not try to link with -latomic on openbsd
2022-08-09Link libatomic on 32-bit targetsNikita Popov-0/+7
This is needed since https://reviews.llvm.org/D128070.
2022-07-03Add cargo:rustc-check-cfg to rustc_llvm build scriptUrgau-33/+29
2022-05-13Add LLVM based mingw-w64 targetsMateusz Mikuła-4/+5
2022-03-05Remove build_helperbjorn3-5/+66
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.
2021-12-03Explain why libatomic is not needed on FreeBSD riscv64Tobias Kortkamp-1/+4
From Jessica Clarke (jrtc27@)
2021-11-27Add riscv64gc-unknown-freebsdTobias Kortkamp-1/+1