File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1997,7 +1997,7 @@ impl Build {
19971997 if self . pic . unwrap_or (
19981998 target. os != "windows"
19991999 && target. os != "none"
2000- && target. env != "uefi"
2000+ && target. os != "uefi"
20012001 && target. os != "wasi" ,
20022002 ) {
20032003 cmd. push_cc_arg ( "-fPIC" . into ( ) ) ;
Original file line number Diff line number Diff line change @@ -283,6 +283,23 @@ fn gnu_aarch64_none_no_pic() {
283283 }
284284}
285285
286+ #[ test]
287+ fn gnu_uefi_no_pic ( ) {
288+ reset_env ( ) ;
289+
290+ for arch in & [ "aarch64" , "i686" , "x86_64" ] {
291+ let target = format ! ( "{}-unknown-uefi" , arch) ;
292+ let test = Test :: gnu ( ) ;
293+ test. gcc ( )
294+ . target ( & target)
295+ . host ( & target)
296+ . file ( "foo.c" )
297+ . compile ( "foo" ) ;
298+
299+ test. cmd ( 0 ) . must_not_have ( "-fPIC" ) ;
300+ }
301+ }
302+
286303#[ test]
287304fn gnu_set_stdlib ( ) {
288305 reset_env ( ) ;
You can’t perform that action at this time.
0 commit comments