@@ -62,9 +62,29 @@ fn main() {
6262 }
6363 println ! ( "cargo:rustc-link-lib=c" ) ;
6464 println ! ( "cargo:rustc-link-lib=compiler_rt" ) ;
65- }
66- println ! ( "cargo:rustc-env=STD_ENV_ARCH={}" , env:: var( "CARGO_CFG_TARGET_ARCH" ) . unwrap( ) ) ;
67- if target. contains ( "-none" ) || target. contains ( "nvptx" ) {
65+ } else if ( target. contains ( "sgx" ) && target. contains ( "fortanix" ) )
66+ || target. contains ( "hermit" )
67+ || target. contains ( "l4re" )
68+ || target. contains ( "redox" )
69+ || target. contains ( "haiku" )
70+ || target. contains ( "vxworks" )
71+ || target. contains ( "wasm32" )
72+ || target. contains ( "asmjs" )
73+ {
74+ // These platforms don't have any special requirements.
75+ } else {
76+ // This is for Cargo's build-std support, to mark std as unstable for
77+ // typically no_std platforms.
78+ // This covers:
79+ // - os=none ("bare metal" targets)
80+ // - mipsel-sony-psp
81+ // - nvptx64-nvidia-cuda
82+ // - avr-unknown-unknown
83+ // - tvos (aarch64-apple-tvos, x86_64-apple-tvos)
84+ // - uefi (x86_64-unknown-uefi, i686-unknown-uefi)
85+ // - JSON targets
86+ // - Any new targets that have not been explicitly added above.
6887 println ! ( "cargo:rustc-cfg=feature=\" restricted-std\" " ) ;
6988 }
89+ println ! ( "cargo:rustc-env=STD_ENV_ARCH={}" , env:: var( "CARGO_CFG_TARGET_ARCH" ) . unwrap( ) ) ;
7090}
0 commit comments