File tree 4 files changed +30
-19
lines changed
4 files changed +30
-19
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,6 @@ run-make/lto-dylib-dep/Makefile
129
129
run-make/lto-empty/Makefile
130
130
run-make/lto-linkage-used-attr/Makefile
131
131
run-make/lto-no-link-whole-rlib/Makefile
132
- run-make/lto-readonly-lib/Makefile
133
132
run-make/lto-smoke-c/Makefile
134
133
run-make/macos-deployment-target/Makefile
135
134
run-make/macos-fat-archive/Makefile
Original file line number Diff line number Diff line change 7
7
//@ ignore-cross-compile
8
8
9
9
use run_make_support:: fs_wrapper;
10
- use run_make_support:: { rmake_out_path , rustc} ;
10
+ use run_make_support:: rustc;
11
11
12
12
fn main ( ) {
13
- rustc ( ) . input ( "foo.rs" ) ;
14
- rustc ( ) . arg ( "-Zls=root" ) . input ( rmake_out_path ( "foo" ) ) ;
15
- fs_wrapper:: create_file ( rmake_out_path ( "bar" ) ) ;
16
- rustc ( ) . arg ( "-Zls=root" ) . input ( rmake_out_path ( "bar" ) ) ;
13
+ rustc ( ) . input ( "foo.rs" ) . run ( ) ;
14
+ rustc ( ) . arg ( "-Zls=root" ) . input ( "foo" ) . run ( ) ;
15
+ fs_wrapper:: create_file ( "bar" ) ;
16
+ rustc ( ) . arg ( "-Zls=root" ) . input ( "bar" ) . run ( ) ;
17
17
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // When the compiler is performing link time optimization, it will
2
+ // need to copy the original rlib file, set the copy's permissions to read/write,
3
+ // and modify that copy - even if the original
4
+ // file is read-only. This test creates a read-only rlib, and checks that
5
+ // compilation with LTO succeeds.
6
+ // See https://github.com/rust-lang/rust/pull/17619
7
+
8
+ //@ ignore-cross-compile
9
+
10
+ use run_make_support:: fs_wrapper;
11
+ use run_make_support:: { cwd, run, rustc} ;
12
+
13
+ fn main ( ) {
14
+ rustc ( ) . input ( "lib.rs" ) . run ( ) ;
15
+ let entries = fs_wrapper:: read_dir ( cwd ( ) ) ;
16
+ for entry in entries {
17
+ if entry. path ( ) . extension ( ) . and_then ( |s| s. to_str ( ) ) == Some ( "rlib" ) {
18
+ let mut perms = fs_wrapper:: metadata ( entry. path ( ) ) . permissions ( ) ;
19
+ perms. set_readonly ( true ) ;
20
+ fs_wrapper:: set_permissions ( entry. path ( ) , perms) ;
21
+ }
22
+ }
23
+ rustc ( ) . input ( "main.rs" ) . arg ( "-Clto" ) . run ( ) ;
24
+ run ( "main" ) ;
25
+ }
You can’t perform that action at this time.
0 commit comments