Commit Graph

57 Commits

Author SHA1 Message Date
Alex Crichton 4bf8cad593
Expand wasm32 testing on CI (#360)
* Expand wasm32 testing on CI

Run the full `run.sh` test script to get full assertions, including that
nothing in the wasm compiler-builtins is panicking. Unfortunately it's
currently panicking, so this is good to weed out!

* Update libm
2020-05-29 14:38:29 -05:00
Alex Crichton cde22bc180
Switch to using `llvm_asm!` instead of `asm!` (#351)
* Switch to using `llvm_asm!` instead of `asm!`

* Run rustfmt

* Fix how LTO is specified on nightly
2020-04-29 15:30:10 -05:00
Alex Crichton aa41e0d25f 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 cf98161da7 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 8521530f49 Fix __divsi3 and __udivsi3 on thumbv6m targets
This commit fixes a bug accidentally introduced in #285 where some
lingering references remained to `#[cfg(thumbv6m)]` but this, since the
historical revert, was renamed to `#[cfg(thumb_1)]`. This caused on the
thumbv6m platform for the intrinsics to be accidentally omitted because
the build script didn't actually compile them but the Rust code thought
the C code was in use.

After correcting the `#[cfg]` statements the CI configuration for the
`thumb*` family of targets was all updated. The support for xargo
testing was removed from `run.sh` since it had long since bitrotted, and
the script was updated to simply build the intrinsics example to attempt
to link for each of these targets. This in turn exposed the bug locally
and allowed to confirm a fix once the `#[cfg]` statements were
corrected.

cc rust-lang/rust#60782
2019-05-14 12:26:09 -07:00
Alex Crichton 752e35a11f Fix duplicate symbol __clzsi2
Looks like our tests weren't quite testing compiler-builtins when it was
compiled with unmangled symbols, so update the tests to catch this and
then fix the compilation of the `__clzsi2` intrinsic to use the C
version if it's compiled.
2019-05-02 13:35:50 -07:00
Alex Crichton c880d1ca06 Try to handle thumb targets and xargo 2019-04-02 11:54:20 -07:00
Alex Crichton 2da5d40e84 Use `nm` on OSX
Looks like it may be fixed now?
2018-11-21 10:48:58 -08:00
Paolo Teti 9e99aa2bbe Remove no_std features
Everything default unconditionally to #![no_std].
2018-02-25 09:19:34 +01:00
Paolo Teti 7b81af044e Keep mangled-names as a default feature 2018-02-25 01:11:49 +01:00
Paolo Teti 7f92a8ee7b Fix CI for thumb* targets
Main fix is inside 'utest' all the rest are minor fixes due to the
new 'testcrate'.

Still allow failures on TravisCI for a while.
2018-02-18 18:15:57 +01:00
Alex Crichton 2a13475197 Simplify how testing is done
All tests are moved to a separate crate in this repository to enable features by
default. Additionally the test generation is moved to a seprate build script and
simplified to reduce the amount of boilerplate needed per test.

Overall this should still be testing everything, just in a different location!
2018-01-31 11:32:20 -08:00
Alex Crichton cc9a70f61c Work around japaric/xargo#186 temporarily 2017-12-26 12:20:17 -08:00
Alex Crichton a076c9aaa7 Disable incremental + LTO
This causes errors in more recent versions of rustc
2017-12-26 10:14:11 -08:00
Alex Crichton 46fbf3a565 Work around OSX on Travis 2017-11-02 11:14:05 -07:00
Alex Crichton 91eaa85902 Don't mangle probes all the time 2017-07-07 20:35:14 -07:00
Jorge Aparicio f3350c5499 enable tests now that #150 has been fixed 2017-06-27 22:48:57 -05:00
Alex Crichton 0ebbcaede4 Enable the `intrinsics` program on thumb 2017-06-25 10:09:50 -07:00
Alex Crichton c193113721 Don't test mangled names on thumb
We are both the "real compiler-rt" and the "to be tested one".
2017-06-24 12:54:35 -07:00
Alex Crichton acaa2f071a Don't check for references to panics with debug assertions 2017-06-24 11:44:50 -07:00
Alex Crichton 91b1291dc5 Don't try to work with `cargo test` 2017-06-24 10:22:49 -07:00
Alex Crichton 5d6d3fde6a Add a FIXME for Windows 2017-06-24 10:12:17 -07:00
Alex Crichton 734ec3d31c Tweak testing and such:
* Don't run `intrinsics` tests on thumb
* Disable `compiler_builtins` attribute on `feature = "gen-tests"`
* Disable mangling on `feature = "gen-tests"` instead of `cfg(test)`
2017-06-24 10:10:04 -07:00
Alex Crichton 5e28b7e2b1 Try to fix run.sh on AppVeyor 2017-06-23 21:36:36 -07:00
Alex Crichton a2bdb4b379 Use the same CI script on AppVeyor 2017-06-23 21:23:52 -07:00
Alex Crichton 7de57cd4f9 Handle aeabi aliasing
Objects in compiler-rt may have two symbols, so this makes sure that we don't
bring in those objects by accident by defining the aliases ourselves.
2017-06-23 15:55:11 -07:00
Alex Crichton a16ebb0dcb Use `nm` to weed out panics 2017-06-23 11:52:22 -07:00
Alex Crichton 560018cc83 Less verbose output on symbol check 2017-06-23 10:44:29 -07:00
Alex Crichton 696b821bb7 Enable `mem` for intrinsics on linux 2017-06-23 09:59:49 -07:00
Alex Crichton 0be8b20cb7 Fix features needed for the intrinsics example 2017-06-23 08:35:24 -07:00
Alex Crichton 4540bd4314 Fix travis intrinsics builds 2017-06-23 08:19:11 -07:00
Alex Crichton f0e58591b3 Build the intrinsics example separately 2017-06-23 07:01:18 -07:00
Alex Crichton a1377878c6 Test with the 'c' feature enabled on CI 2017-06-22 14:32:16 -07:00
Jorge Aparicio 19b2efdf36 move intrinsics test from src/bin to examples
with this change the libc crate is not required when calling `cargo build -p
compiler-builtins`
2017-04-11 17:09:05 -05:00
Jorge Aparicio 55294baf7a put test generation behind a Cargo feature
to reduce build time for the most common case of not running tests
2017-04-10 17:27:25 -05:00
Jorge Aparicio 3f723d1141 modify the CI setup to run tests on the thumb targets 2017-04-10 17:16:13 -05:00
Jorge Aparicio 3992ed1e7a CI: use a recent nightly
- add #[no_mangle] to the panic_fmt lang item to adjust to changes in
the visibility algorithm

- adjust to changes in the layout of Cargo's target directory

- use a newer Xargo to reduce the build time of the sysroot (only core
is compiled as part of the sysroot now)
2016-12-31 10:04:40 -05:00
bors 70009a311c Auto merge of #124 - japaric:rustbuild, r=alexcrichton
by default, mark this crate as the #![compiler_builtins] crate

as this is how most users will want to use this crate

r? @alexcrichton
2016-12-13 00:02:56 +00:00
Jorge Aparicio 3484b2b68e by default, mark this crate as the #![compiler_builtins] crate
as this is how most users will want to use this crate
2016-12-11 16:18:43 -05:00
Jorge Aparicio c1ef69f2a0 fix the test suite for the thumb targets 2016-12-11 11:18:48 -05:00
Jorge Aparicio 5d164a4eda fix the powerpc64le target
by selecting a CPU that's compatible with the instructions that `rustc`
generates
2016-10-14 09:59:21 -05:00
Jorge Aparicio e441058be7 ci/run.sh: remove debug stuff 2016-10-10 20:53:21 -05:00
Jorge Aparicio e05caa1227 fix warnings 2016-10-10 19:45:34 -05:00
Jorge Aparicio 96ddd4ed8d use test::black_box instead of ptr::*_volatile
both prevent LLVM from optimizing away the intrinsics but the former
doesn't produce an `intrinsics` binary that segfaults
2016-10-07 18:26:21 -05:00
Jorge Aparicio c82403551d fix unsafe warnings 2016-10-07 18:19:40 -05:00
Jorge Aparicio fd69beba29 get profile.dev (-debug-assertions) + LTO working 2016-10-07 18:19:40 -05:00
Jorge Aparicio a2ffc799d0 check that we don't have any call to panic in our implementations 2016-10-07 18:19:40 -05:00
Jorge Aparicio 24c2a15f3d fix path to .rlib on OSX 2016-10-07 15:03:22 -05:00
Jorge Aparicio 213d929f86 drop the target files 2016-10-06 23:20:09 -05:00
Jorge Aparicio 8a32bd3424 fix duplicate symbol test 2016-10-03 20:20:23 -05:00