@@ -48,7 +48,6 @@ const X86: &str = "x86";
48
48
const X86_64 : & str = "x86_64" ;
49
49
const AARCH64 : & str = "aarch64" ;
50
50
const ARM : & str = "arm" ;
51
- const WASM32 : & str = "wasm32" ;
52
51
53
52
#[ rustfmt:: skip]
54
53
const RING_SRCS : & [ ( & [ & str ] , & str ) ] = & [
@@ -300,8 +299,8 @@ fn ring_build_rs_main(c_root_dir: &Path, core_name_and_version: &str) {
300
299
let out_dir = PathBuf :: from ( out_dir) ;
301
300
302
301
let arch = env:: var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) ;
302
+ let vendor = env:: var ( "CARGO_CFG_TARGET_VENDOR" ) . unwrap ( ) ;
303
303
let os = env:: var ( "CARGO_CFG_TARGET_OS" ) . unwrap ( ) ;
304
- let env = env:: var ( "CARGO_CFG_TARGET_ENV" ) . unwrap ( ) ;
305
304
306
305
let is_git = fs:: metadata ( c_root_dir. join ( ".git" ) ) . is_ok ( ) ;
307
306
@@ -316,8 +315,8 @@ fn ring_build_rs_main(c_root_dir: &Path, core_name_and_version: &str) {
316
315
317
316
let target = Target {
318
317
arch,
318
+ vendor,
319
319
os,
320
- env,
321
320
is_debug,
322
321
force_warnings_into_errors,
323
322
} ;
@@ -396,8 +395,8 @@ fn generate_sources_and_preassemble<'a>(
396
395
397
396
struct Target {
398
397
arch : String ,
398
+ vendor : String ,
399
399
os : String ,
400
- env : String ,
401
400
402
401
/// Is this a debug build? This affects whether assertions might be enabled
403
402
/// in the C code. For packaged builds, this should always be `false`.
@@ -576,14 +575,10 @@ fn configure_cc(c: &mut cc::Build, target: &Target, c_root_dir: &Path, include_d
576
575
// Allow cross-compiling without a target sysroot for these targets.
577
576
//
578
577
// poly1305_vec.c requires <emmintrin.h> which requires <stdlib.h>.
579
- if ( target. arch == WASM32 )
580
- || ( target. os == "linux" && target. env == "musl" && target. arch != X86_64 )
581
- {
582
- // TODO: Expand this to non-clang compilers in 0.17.0 if practical.
583
- if compiler. is_like_clang ( ) {
584
- let _ = c. flag ( "-nostdlibinc" ) ;
585
- let _ = c. define ( "RING_CORE_NOSTDLIBINC" , "1" ) ;
586
- }
578
+ // TODO: Expand this to non-clang compilers in 0.17.0 if practical.
579
+ if target. vendor != "apple" && target. arch != X86_64 && compiler. is_like_clang ( ) {
580
+ let _ = c. flag ( "-nostdlibinc" ) ;
581
+ let _ = c. define ( "RING_CORE_NOSTDLIBINC" , "1" ) ;
587
582
}
588
583
589
584
if target. force_warnings_into_errors {
0 commit comments