about summary refs log tree commit diff
path: root/compiler/rustc_llvm/build.rs
AgeCommit message (Collapse)AuthorLines
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
2021-10-23Repace use of `static_nobundle` with `native_link_modifiers`Mateusz Mikuła-2/+2
This fixes warning when building Rust and running tests: ``` warning: library kind `static-nobundle` has been superseded by specifying `-bundle` on library kind `static`. Try `static:-bundle` warning: `rustc_llvm` (lib) generated 2 warnings (1 duplicate) ```
2021-09-17compiler/rustc_llvm: Enable M68k LLVM targetJohn Paul Adrian Glaubitz-0/+1
2021-06-26Cross compiling rustc_llvm on Darwin requires zlib.Marcus Calhoun-Lopez-1/+1
2021-05-23Add BPF targetAlessandro Decina-0/+1
This change adds the bpfel-unknown-none and bpfeb-unknown-none targets which can be used to generate little endian and big endian BPF
2021-03-22All supported LLVM versions have MSP430AsmPrinterJosh Stone-14/+0
2020-12-11use strip_prefix over slicing (clippy::manual_strip)Matthias Krüger-18/+18
2020-10-08Simplify some code in rustc_llvm/build.rs now that LLVM 8 is requiredest31-6/+3
LLVM 8 is required since 8506bb006040cf8e8cb004202706c81e62ddacee so this is safe to do.
2020-09-09Move `rustllvm` into `rustc_llvm`Vadim Petrochenkov-0/+322