File tree 3 files changed +17
-6
lines changed 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ fn main() {
12
12
return ;
13
13
}
14
14
15
+ // Forcibly enable memory intrinsics on wasm32 as we don't have a libc to
16
+ // provide them.
17
+ if target. contains ( "wasm32" ) {
18
+ println ! ( "cargo:rustc-cfg=feature=\" mem\" " ) ;
19
+ }
20
+
15
21
// NOTE we are going to assume that llvm-target, what determines our codegen option, matches the
16
22
// target triple. This is usually correct for our built-in targets but can break in presence of
17
23
// custom targets, which can have arbitrary names.
@@ -25,9 +31,13 @@ fn main() {
25
31
// mangling names though we assume that we're also in test mode so we don't
26
32
// build anything and we rely on the upstream implementation of compiler-rt
27
33
// functions
28
- if !cfg ! ( feature = "mangled-names" ) {
29
- #[ cfg( feature = "c" ) ]
30
- c:: compile ( & llvm_target) ;
34
+ if !cfg ! ( feature = "mangled-names" ) && cfg ! ( feature = "c" ) {
35
+ // no C compiler for wasm
36
+ if !target. contains ( "wasm32" ) {
37
+ #[ cfg( feature = "c" ) ]
38
+ c:: compile ( & llvm_target) ;
39
+ println ! ( "cargo:rustc-cfg=use_c" ) ;
40
+ }
31
41
}
32
42
33
43
// To compile intrinsics.rs for thumb targets, where there is no libc
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ case "$TRAVIS_OS_NAME" in
65
65
# NOTE OSx's nm doesn't accept the `--defined-only` or provide an equivalent.
66
66
# Use GNU nm instead
67
67
NM=gnm
68
+ brew update
68
69
brew install binutils
69
70
;;
70
71
* )
Original file line number Diff line number Diff line change 31
31
/// A quick overview of attributes supported right now are:
32
32
///
33
33
/// * `use_c_shim_if` - takes a #[cfg] directive and falls back to the
34
- /// C-compiled version if `feature = "c" ` is specified.
34
+ /// C-compiled version if `use_c ` is specified.
35
35
/// * `aapcs_on_arm` - forces the ABI of the function to be `"aapcs"` on ARM and
36
36
/// the specified ABI everywhere else.
37
37
/// * `unadjusted_on_win64` - like `aapcs_on_arm` this switches to the
@@ -68,7 +68,7 @@ macro_rules! intrinsics {
68
68
$( $rest: tt) *
69
69
) => (
70
70
71
- #[ cfg( all( feature = "c" , $( $cfg_clause) * ) ) ]
71
+ #[ cfg( all( use_c , $( $cfg_clause) * ) ) ]
72
72
pub extern $abi fn $name( $( $argname: $ty) ,* ) -> $ret {
73
73
extern $abi {
74
74
fn $name( $( $argname: $ty) ,* ) -> $ret;
@@ -78,7 +78,7 @@ macro_rules! intrinsics {
78
78
}
79
79
}
80
80
81
- #[ cfg( not( all( feature = "c" , $( $cfg_clause) * ) ) ) ]
81
+ #[ cfg( not( all( use_c , $( $cfg_clause) * ) ) ) ]
82
82
intrinsics! {
83
83
$( #[ $( $attr) * ] ) *
84
84
pub extern $abi fn $name( $( $argname: $ty) ,* ) -> $ret {
You can’t perform that action at this time.
0 commit comments