File tree 5 files changed +37
-0
lines changed
src/tools/run-make-support/src/external_deps
tests/run-make/staticlib-thin-archive
5 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -271,6 +271,12 @@ impl LlvmAr {
271
271
self
272
272
}
273
273
274
+ /// Like `obj_to_ar` except creating a thin archive.
275
+ pub fn obj_to_thin_ar ( & mut self ) -> & mut Self {
276
+ self . cmd . arg ( "rcus" ) . arg ( "--thin" ) ;
277
+ self
278
+ }
279
+
274
280
/// Extract archive members back to files.
275
281
pub fn extract ( & mut self ) -> & mut Self {
276
282
self . cmd . arg ( "x" ) ;
Original file line number Diff line number Diff line change
1
+ #[ link( name = "rust_archive" , kind = "static" ) ]
2
+ extern "C" {
3
+ fn simple_fn ( ) ;
4
+ }
5
+
6
+ fn main ( ) {
7
+ unsafe {
8
+ simple_fn ( ) ;
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ // Regression test for https://github.com/rust-lang/rust/issues/107407
2
+
3
+ use run_make_support:: { llvm_ar, rustc, static_lib_name} ;
4
+
5
+ fn main ( ) {
6
+ rustc ( ) . input ( "simple_obj.rs" ) . emit ( "obj" ) . run ( ) ;
7
+ llvm_ar ( ) . obj_to_thin_ar ( ) . output_input ( static_lib_name ( "thin_archive" ) , "simple_obj.o" ) . run ( ) ;
8
+ rustc ( ) . input ( "rust_archive.rs" ) . run ( ) ;
9
+ // Disable lld as it ignores the symbol table in the archive file.
10
+ rustc ( )
11
+ . input ( "bin.rs" ) /*.arg("-Zlinker-features=-lld")*/
12
+ . run ( ) ;
13
+ }
Original file line number Diff line number Diff line change
1
+ #![ crate_type = "staticlib" ]
2
+
3
+ #[ link( name = "thin_archive" , kind = "static" ) ]
4
+ extern "C" { }
Original file line number Diff line number Diff line change
1
+ #![ crate_type = "staticlib" ]
2
+
3
+ #[ no_mangle]
4
+ extern "C" fn simple_fn ( ) { }
You can’t perform that action at this time.
0 commit comments