File tree Expand file tree Collapse file tree 3 files changed +43
-19
lines changed 
tests/run-make/issue-68794-textrel-on-minimal-lib Expand file tree Collapse file tree 3 files changed +43
-19
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ run-make/issue-37839/Makefile
8282run-make/issue-40535/Makefile
8383run-make/issue-47384/Makefile
8484run-make/issue-47551/Makefile
85- run-make/issue-68794-textrel-on-minimal-lib/Makefile
8685run-make/issue-69368/Makefile
8786run-make/issue-83045/Makefile
8887run-make/issue-83112-incr-test-moved-file/Makefile
  Load Diff This file was deleted. 
Original file line number Diff line number Diff line change 1+ // Regression test for issue #68794 
2+ // 
3+ // Verify that no text relocations are accidentally introduced by linking a 
4+ // minimal rust staticlib. 
5+ // 
6+ // The test links a rust static library into a shared library, and checks that 
7+ // the linker doesn't have to flag the resulting file as containing TEXTRELs. 
8+ 
9+ //@ only-linux 
10+ //@ ignore-cross-compile 
11+ 
12+ use  std:: env; 
13+ 
14+ use  run_make_support:: cc; 
15+ use  run_make_support:: llvm_readobj; 
16+ use  run_make_support:: rustc; 
17+ use  run_make_support:: { dynamic_lib_name,  static_lib_name} ; 
18+ 
19+ fn  main ( )  { 
20+     let  mut  extra_flags = vec ! [ ] ; 
21+     if  let  Ok ( extracflags)  = env:: var ( "EXTRACFLAGS" )  { 
22+         extra_flags. push ( extracflags) ; 
23+     } 
24+     if  let  Ok ( extracxxflags)  = env:: var ( "EXTRACXXFLAGS" )  { 
25+         extra_flags. push ( extracxxflags) ; 
26+     } 
27+ 
28+     rustc ( ) . input ( "foo.rs" ) . run ( ) ; 
29+ 
30+     cc ( ) . input ( "bar.c" ) 
31+         . arg ( static_lib_name ( "foo" ) ) 
32+         . arg ( "-fPIC" ) 
33+         . arg ( "-shared" ) 
34+         . args ( & extra_flags) 
35+         . output ( dynamic_lib_name ( "bar" ) ) 
36+         . run ( ) ; 
37+ 
38+     llvm_readobj ( ) 
39+         . dynamic_table ( ) 
40+         . input ( dynamic_lib_name ( "bar" ) ) 
41+         . run ( ) 
42+         . assert_stdout_not_contains ( "TEXTREL" ) ; 
43+ } 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments