Commit Graph

44 Commits

Author SHA1 Message Date
Chris Denton
7223fd8085
Add system libs when cross compiling for Windows 2024-09-15 12:38:55 +00:00
Kyle Huey
6e9afb8dde Enable zstd for debug compression.
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-08-09 05:55:23 -07:00
Nikita Popov
776b0adaaf Fix incorrect NDEBUG handling in LLVM bindings
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-07-12 22:13:56 +02:00
John Paul Adrian Glaubitz
dc8ac3ec91 rustc_llvm: Link against libatomic on 32-bit SPARC
While at it, order the list of architectures alphabetically.
2024-06-24 16:53:09 +02:00
Scott Mabin
b37a448616 Teach rustc about the Xtensa arch. 2024-05-29 13:47:57 +01:00
Michael Scholten
3c5e88c7d1 Improved the compiler code with clippy 2024-04-24 09:41:44 +02:00
Matthias Krüger
dea28d86b4
Rollup merge of #123294 - Nilstrieb:reuqire-llvm-config, r=clubby789
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.

bf71daedc2/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-06 08:56:33 +02:00
Kai Luo
00f7f57159 Fix build on AIX 2024-04-02 17:25:22 +08:00
Kai Luo
1f2d1420cb Fix linking c++ runtimes on AIX 2024-04-02 17:17:13 +08:00
Nilstrieb
d651baef95 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.
2024-03-31 20:51:14 +02:00
Urgau
9b4fe38903 Use new check-cfg syntax in rustc_llvm build script 2023-12-05 13:25:11 +01:00
Matthias Krüger
03d6e7ade0
Rollup merge of #114224 - inferiorhumanorgans:solaris-llvm-wrapper, r=cuviper
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-13 21:28:54 +01:00
Josh Stone
855388e9a2
Mention LLVM 64186 in a comment 2023-11-13 11:04:53 -08:00
Havard Eidnes
0f04e2dd8f For i586/NetBSD: fix another formatting insistence. 2023-10-27 09:37:25 +00:00
Havard Eidnes
391b472a37 rustc_llvm/build.rs: improve comment for NetBSD/i386 targets
...explaining why we need -latomic (gcc & g++ built for i486,
and LLVM insisting on use of 64-bit atomics).
2023-10-26 17:10:16 +00:00
Havard Eidnes
6642b4b1e2 Add support for i586-unknown-netbsd as target.
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-10-25 15:23:34 +00:00
Matthias Krüger
4e2231803b
Rollup merge of #114349 - inferiorhumanorgans:dragonfly-link-libz, r=cuviper
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-09-02 07:48:21 +02:00
Dirreke
d16409fe22 add a csky-unknown-linux-gnuabiv2 target 2023-08-14 23:02:36 +08:00
Alex Zepeda
6ef7813cf0 rustc_llvm: Link zlib on cross Solaris builds
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-07 17:19:30 -07:00
Alex Zepeda
14dd4e97a8 rustc_llvm: Link to zlib on dragonfly 2023-08-01 15:54:30 -07:00
Alex Zepeda
103b2df63b 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-07-29 14:37:46 -07:00
Jakub Beránek
e95caa7b72 Link to execinfo on NetBSD 2023-07-17 08:30:54 +02:00
zhaixiaojuan
ccf5417799 Enable loongarch64 LLVM target 2023-04-04 17:05:08 +08:00
Kai Luo
3a7977e3ca Link against libc++ on AIX 2023-03-23 16:33:54 +08:00
nils
fd7a159710 Fix uninlined_format_args for some compiler crates
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).
2023-01-05 19:01:12 +01:00
bors
e10201c9bb Auto merge of #104572 - pkubaj:patch-1, r=cuviper
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-09 12:00:58 +00:00
pkubaj
32c777e891 Fix build on powerpc-unknown-freebsd
Probably also fixes build on mips*. Related to https://github.com/rust-lang/rust/issues/104220
2022-12-09 02:11:15 +01:00
bjorn3
be6708428f Rewrite LLVM's archive writer in Rust
This allows it to be used by other codegen backends
2022-11-26 19:35:32 +00:00
Josh Stone
32a3130813 Upgrade dist-x86_64-netbsd to NetBSD 9.0 2022-10-28 18:49:48 -07:00
Sébastien Marie
1de5b22678 add riscv64gc-unknown-openbsd support (target riscv64-unknown-openbsd on OpenBSD)
- add platform-support documentation
- add riscv64gc-unknown-openbsd spec
- do not try to link with -latomic on openbsd
2022-08-28 05:22:21 +00:00
Nikita Popov
1db81713f6 Link libatomic on 32-bit targets
This is needed since https://reviews.llvm.org/D128070.
2022-08-09 12:39:59 +02:00
Urgau
0e82c53028 Add cargo:rustc-check-cfg to rustc_llvm build script 2022-07-03 16:17:17 +02:00
Mateusz Mikuła
60361f2ca3 Add LLVM based mingw-w64 targets 2022-05-13 20:14:15 +02:00
bjorn3
0cfc3e1016 Remove build_helper
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-05 15:31:22 +01:00
Tobias Kortkamp
e24045e587
Explain why libatomic is not needed on FreeBSD riscv64
From Jessica Clarke (jrtc27@)
2021-12-03 18:49:42 +01:00
Tobias Kortkamp
47474f1055
Add riscv64gc-unknown-freebsd 2021-11-27 07:24:18 +01:00
Mateusz Mikuła
a076f2b9b4 Repace use of static_nobundle with native_link_modifiers
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-10-23 15:51:22 +02:00
John Paul Adrian Glaubitz
fa27d50caa compiler/rustc_llvm: Enable M68k LLVM target 2021-09-17 15:07:14 +00:00
Marcus Calhoun-Lopez
956fd10660 Cross compiling rustc_llvm on Darwin requires zlib. 2021-06-26 07:29:57 -07:00
Alessandro Decina
12e70929d6 Add BPF target
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-05-23 18:03:27 +10:00
Josh Stone
b97a33b1cb All supported LLVM versions have MSP430AsmPrinter 2021-03-22 12:44:48 -07:00
Matthias Krüger
5c8de1cf49 use strip_prefix over slicing (clippy::manual_strip) 2020-12-11 23:02:17 +01:00
est31
8b8e706008 Simplify some code in rustc_llvm/build.rs now that LLVM 8 is required
LLVM 8 is required since 8506bb0060
so this is safe to do.
2020-10-08 06:19:06 +02:00
Vadim Petrochenkov
10d3f8a484 Move rustllvm into rustc_llvm 2020-09-09 23:05:43 +03:00