File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,6 @@ fn basic() {
165165 . build_std_isolated ( )
166166 . target_host ( )
167167 . with_stderr_data ( str![ [ r#"
168- [COMPILING] test v0.0.0 ([..])
169168...
170169[COMPILING] foo v0.0.1 ([ROOT]/foo)
171170[FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@@ -211,10 +210,22 @@ fn lto() {
211210 )
212211 . build ( ) ;
213212
214- p. cargo ( "build" )
215- . build_std_arg ( "std" )
216- . env ( "RUSTFLAGS" , "-C linker-features=-lld" )
217- . run ( ) ;
213+ let mut exec = p. cargo ( "build" ) ;
214+ exec. build_std_arg ( "std" ) ;
215+ // Include `-lld` to disable the self-contained linker. This test is
216+ // checking for the behavior when using the system linker (like GNU ld or
217+ // older versions of lld) which have problems with the bitcode sections in
218+ // compiler_builtins.
219+ //
220+ // This option is only available on x86-64-unknown-linux-gnu.
221+ if cfg ! ( all(
222+ target_arch = "x86_64" ,
223+ target_os = "linux" ,
224+ target_env = "gnu"
225+ ) ) {
226+ exec. env ( "RUSTFLAGS" , "-C linker-features=-lld" ) ;
227+ }
228+ exec. run ( ) ;
218229}
219230
220231#[ cargo_test( build_std_real) ]
You can’t perform that action at this time.
0 commit comments