File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
//! Compile test sources to object files.
2
2
3
+ use std:: env;
4
+
3
5
fn main ( ) {
4
6
let compiler = cc:: Build :: new ( ) . get_compiler ( ) ;
5
7
8
+ println ! (
9
+ "cargo::rustc-env=OBJ_TARGET={}" ,
10
+ env:: var( "TARGET" ) . unwrap( )
11
+ ) ;
12
+
6
13
let objs = cc:: Build :: new ( )
7
14
. file ( "tests/no_gnu_stack.S" )
8
15
. compile_intermediates ( ) ;
Original file line number Diff line number Diff line change @@ -414,7 +414,8 @@ fn check_no_gnu_stack_obj() {
414
414
) ;
415
415
let has_exe_stack = obj_requires_exe_stack ( & obj) ;
416
416
417
- if cfg ! ( target_os = "windows" ) || cfg ! ( target_vendor = "apple" ) {
417
+ let obj_target = env ! ( "OBJ_TARGET" ) ;
418
+ if obj_target. contains ( "-windows-" ) || obj_target. contains ( "-apple-" ) {
418
419
// Non-ELF targets don't have executable stacks marked in the same way
419
420
assert ! ( !has_exe_stack) ;
420
421
} else {
You can’t perform that action at this time.
0 commit comments