Commit Graph

145 Commits

Author SHA1 Message Date
Peter Collingbourne
c491ca7ec5 Build emutls.c on Android.
Android uses emulated TLS so we need a runtime support function
from this source file.
2022-03-24 11:25:47 -07:00
Vladimir Michael Eatwell
50c5587f82 [watch_os] Fix formatting 2022-03-08 10:19:34 +00:00
Vladimir Michael Eatwell
002fc52f00 [watch_os] add watchOS 2022-03-08 10:05:44 +00:00
Daniel Sommermann
554fa533ab Stop emitting duplicate symbols for armv7-linux-androideabi
The change in 186517b3266a7bb2b2310927f7342ea7f41790c3 was intended to
affect only `arm-linux-androideabi` but also affected
`armv7-linux-androideabi` which is not a pre-ARMv6 architecture.
Fixes #449
2022-01-27 12:02:40 -08:00
Ayrton
9124cdc7ec Remove truncdfsf2.c from sources in build.rs and add test for __truncdfsf2vfp
Also fixed the calling convention for truncdfsf2 on ARM
2021-12-12 21:12:42 -05:00
Amanieu d'Antras
4abfecabef Import the asm! macro from core::arch
It is going to be removed from the prelude due to the decision in
https://github.com/rust-lang/rust/issues/87228
2021-12-09 23:57:26 +00:00
Amanieu d'Antras
c750277268 Ensure AArch64 LSE object files have distinct names in an archive
This is needed by libtool which rejects archives that contain object
files with the same name multiple times.

Fixes #443
2021-11-28 13:02:09 +00:00
Alessandro Decina
d96a0a0877 Turn on the mem-unaligned feature for bpf targets
Fixes the following LLVM segfault:

 Error: e: 05:02:06 [ERROR] fatal error: "Cannot select: 0x55e970a357d0: i64,ch = AtomicLoad<(load unordered (s64) from %ir.45)> 0x55e970410be8, 0x55e970a358a0\n  0x55e970a358a0: i64,ch = CopyFromReg 0x55e970410be8, Register:i64 %19\n    0x55e970a35490: i64 = Register %19\nIn function: memcpy"
          PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
          Stack dump:
          0.	Running pass 'Function Pass Manager' on module 'unroll-loop'.
          1.	Running pass 'BPF DAG->DAG Pattern Instruction Selection' on function '@memcpy'
2021-11-21 07:07:14 +00:00
Alex Crichton
b7fb6c594a Adjust some build directives for wasm64
This is still an experimental target but this should get the wasm64
target to behave more like wasm32.
2021-10-28 10:29:37 -07:00
Gary Guo
709bd6e11c Add different misaligned path for archs with unaligned support 2021-08-21 03:48:56 +01:00
Wesley Wiser
ba100707db Don't try to build out-of-line aarch64 atomics with the msvc toolchain
The msvc toolchain does not support building `.s` files, clang only
supports generating out-of-line atomics on Linux and gcc does not
support aarch64 for Windows at all. Therefore, we don't need to compile
`lse.s` on `aarch64-pc-windows-msvc`.
2021-07-28 13:57:03 -04:00
Rich Kadel
6ff8257858 Support long double intrinsics in any aarch64 linux
Expands the support added in #377 from just musl to any linux.

Also checks for and avoids adding duplicate sources.

Fixes #428
2021-07-14 11:17:27 -07:00
Amanieu d'Antras
77d9a28bbb Fix build on targets with fewer than 3 components in their name 2021-06-03 22:59:34 +01:00
Tilmann Meyer
31e3ae708c
Include Linux atomic emulation on androideabi
The old androideabi uses armv5 and thus also needs the atomic emulation
and because Android is basically Linux it can use the same
implementation.
2021-05-31 16:32:46 +02:00
Amanieu d'Antras
1630c86e07 Don't embed lse_*.a inside another static library 2021-05-13 21:35:34 +01:00
Josh Triplett
79c1e33364 Make the name of the intermediate library more closely match the intrinsic 2021-04-30 12:15:32 -07:00
Josh Triplett
df8e6f179a Require lse.S (now available in current LLVM) 2021-04-30 12:15:32 -07:00
Josh Triplett
b9da06f662 Fix typo in instruction name: s/cwp/swp/ 2021-04-30 12:15:32 -07:00
George Burgess IV
5edaec6c97 add support for building outlined aarch64 intrinsics
llvm/llvm-project@a4ac434c47 saw the
addition of out-of-line aarch64 atomic intrinsics. LLVM will sometimes
emit these, so we need to ensure they're included in Rust's compiler-rt.
2021-04-30 12:15:32 -07:00
messense
6cd2f3ae40 Add compiler-rt fallbacks on mips64-musl 2021-04-03 11:20:09 +08:00
Thomas Vigouroux
29791313f5 add compiler-rt fallbacks on aarch64-musl 2020-08-24 13:28:32 +02:00
Amanieu d'Antras
b6ee34a330
Merge pull request #341 from vfreex/add-mips-compiler-rt-fallback
add mips/mips64 compiler-rt fallbacks so that libgcc is not required
2020-08-23 23:27:05 +01:00
Eric Huss
a2840567da
Add more targets to automatically select mem feature. (#357) 2020-05-22 16:12:06 -05:00
Andre Richter
569b87d602
aarch64: Exclude FP intrinsics on +nofp or +nosimd (#344)
`AArch64` GCCs exit with an error condition when they encounter any kind of
floating point code if the `nofp` and/or `nosimd` compiler flags have been set.

Therefore, evaluate if those flags are present and set a boolean that causes any
compiler-rt intrinsics that contain floating point source to be excluded for
this target.

This patch prepares https://github.com/rust-lang/rust/pull/68334
2020-02-28 13:01:22 -06:00
Yuxiang Zhu
d370d2728b add mips/mips64 compiler-rt fallbacks so that libgcc is not required
This adds compiler-rt fallbacks for mips and mips64 arches.

Solves linking issues like https://github.com/rust-lang/rust/issues/57820.

Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
2020-02-13 03:33:56 +08:00
Lokathor
e796054f9e Update build.rs 2019-09-06 18:02:11 -06:00
Lokathor
e079f2d70d Update build.rs 2019-09-06 15:20:05 -06:00
Joel Galenson
a80233948f Update comment to mention where the __FILE__ macro is used. 2019-08-19 15:12:07 -07:00
Joel Galenson
cefd832d89 Support deterministic builds by remapping the __FILE__ prefix if the compiler supports it. 2019-08-19 09:30:45 -07:00
Alex Crichton
b84b7143e8 Remove compiler-rt submodule from this repository
This commit removes the `compiler-rt` submodule from this repository.
The goal here is to align the `compiler-rt` used for compiling C
intrinsics with the upstream rust-lang/rust's usage of `llvm-project`.
Currently we have both an `llvm-project` repository as well as
`compiler-rt`, but they can naturally get out of sync and it's just one
more submodule to manage.

The thinking here is that the feature `c` for this crate, when
activated, will require the user to configure where the source code for
`compiler-rt` is present. This places the onus on the builder of
`compiler-builtins` to check-out and arrange for the appropriate
`compiler-rt` source code to be placed somewhere. For rust-lang/rust
this is already done with the `llvm-project` submodule, and we can
arrange for it to happen on this crate's CI anyway.

For users of this crate this is a bit of a bummer, but `c` is disabled
by default anyway and it seems unlikely that `c` is explicitly opted in
to all that much. (given the purpose of this crate)

This should allow us to archive the `compiler-rt` repository and simply
use `llvm-project` in the rust-lang/rust repository.
2019-05-16 07:50:20 -07:00
Alex Crichton
f567dbb36b Remove the need for #[cfg] in #[use_c_shim_if]
This commit tweaks the implementation of the synthetic
`#[use_c_shim_if]` attribute, renaming it to
`#[maybe_use_optimized_c_shim]` in the process. This no longer requires
specifying a `#[cfg]` clause indicating when the optimized intrinsic
should be used, but rather this is inferred and printed from the build
script.

The build script will now print out appropriate `#[cfg]` directives for
rustc to indicate what intrinsics it's compiling. This should remove the
need for us to keep the build script and the source in sync, but rather
the build script can simply take care of everything.
2019-05-15 12:59:31 -07:00
Alex Crichton
b2cfc3a4f1 Run rustfmt over everything 2019-05-14 14:40:38 -07:00
Alex Crichton
9886a163b3 Don't compile C code on riscv targets
This fixes a longstanding bug in compiler-builtins where C code was
compiled for the riscv targets but when distributed in rust-lang/rust
all the C code was actually compiled for x86_64 since there is no
configured C compiler for riscv. This was exposed by #286 by accident
but the underlying cause was somewhat unrelated.

For now we forcibly disable C code for riscv targets, and when the C
compiler story is sorted out in rust-lang/rust and with `cc-rs` we can
reenable. For now just use all the Rust definitions.

cc rust-lang/rust#60747
2019-05-14 14:29:29 -07:00
Alex Crichton
98f4618c9a Revert "Use the Rust implementation of udivsi3 on ARM"
This reverts commit 681aaa914dea7cae8252c33023604ce6c91808bd.
2019-05-02 12:49:19 -07:00
Alex Crichton
5a29b6d057
Merge pull request #276 from hug-dev/armv8m-support
Fix compilation errors for Armv8-M Baseline and Mainline with FPU
2019-03-14 09:15:10 -05:00
Hugues de Valon
ae7b057cdb Fix compilation for thumbv8m.main-none-eabihf
Some files were not assembling for the Armv8-M Mainline architecture
profile with FPU extension. Reason being the same as for Armv7-M: the
conversion intrinsics including double precision floating
point variables do not work with single precision FPUs.
Also removes from exclusion files that are assembling without errors for
Armv7-M and Armv8-M Mainline.
2019-03-14 12:58:29 +00:00
Hugues de Valon
e7c41f4a84 Fix Armv8-M Baseline compilation
Armv8-M Baseline, ie thumbv8m.base-none-eabi, is a superset of the
Armv6-M architecture profile. As it shares almost the same instruction
set, this commit copies the configuration for thumbv6m-none-eabi to
enable it.
2019-03-14 12:58:23 +00:00
Alex Crichton
8d0fdce9ca Don't compile memory intrinsics on wasi 2019-03-13 08:23:25 -07:00
MikaelUrankar
55f0ab112a FreeBSD arm needs clear_cache.c 2019-02-02 19:52:41 +01:00
Alex Crichton
d73e6e61cd
Merge pull request #270 from denzp/master
Don't build compiler-rt for NVPTX
2019-01-07 11:11:19 -06:00
Denys Zariaiev
deb1cb51d1 Don't build compiler-rt for NVPTX 2019-01-07 17:16:09 +01:00
Yu Ding
c5dc23d75d Fix SGX target_env collision
Signed-off-by: Yu Ding <dingelish@gmail.com>
2019-01-03 12:53:08 -08:00
Alex Crichton
08db8f31d3 Add metadata for where compiler-rt is located
Compiler crates will need to use this!
2018-11-21 12:57:39 -08:00
Jethro Beekman
3880e404a8 Add SGX target 2018-11-21 14:07:57 +05:30
Alex Crichton
dbdcd66e35 Revert "Conversion from a wider to a narrower IEEE-754 floating-point type"
This reverts commit baab4fd89cdd945e46fed31166e5dcad7224ed87.
2018-10-30 10:51:11 -07:00
Paolo Teti
45a42b5b89 Conversion from a wider to a narrower IEEE-754 floating-point type
Adds generic conversion from a wider to a narrower IEEE-754
floating-point type.

Implement `__truncdfsf2` and `__truncdfsf2vfp` and associated test-cases.
2018-09-17 19:53:04 +02:00
Alex Crichton
84523d81a1
Merge pull request #259 from paoloteti/cc-rs
Remove superfluous cc flags
2018-09-09 10:44:02 -07:00
Paolo Teti
296f04fe63 Remove unused variable target_arch_arm
Previous commit makes this variable unused
2018-09-08 19:04:09 +02:00
Paolo Teti
66d52cf01d Remove superfluous cc flags
Latest `cc-rs` already manage all arm/thumb flags, so We can
safely remove this piece of code.
2018-09-08 17:41:26 +02:00
Alex Crichton
447bb5391f
Merge pull request #256 from jordanrh1/windows-arm
Support windows/arm target
2018-09-07 10:08:01 -07:00