File tree Expand file tree Collapse file tree 3 files changed +48
-19
lines changed
tests/run-make/static-pie Expand file tree Collapse file tree 3 files changed +48
-19
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,6 @@ run-make/split-debuginfo/Makefile
191191run-make/stable-symbol-names/Makefile
192192run-make/static-dylib-by-default/Makefile
193193run-make/static-extern-type/Makefile
194- run-make/static-pie/Makefile
195194run-make/staticlib-blank-lib/Makefile
196195run-make/staticlib-dylib-linkage/Makefile
197196run-make/std-core-cycle/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // How to manually run this
2+ // $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] tests/run-make/static-pie
3+
4+ //@ only-x86_64
5+ //@ only-linux
6+ //@ ignore-32bit
7+
8+ use std:: process:: Command ;
9+
10+ use run_make_support:: llvm_readobj;
11+ use run_make_support:: rustc;
12+ use run_make_support:: { cmd, env_var} ;
13+
14+ fn ok_compiler_version ( compiler : & str ) -> bool {
15+ let check_file = format ! ( "check_{compiler}_version.sh" ) ;
16+
17+ Command :: new ( check_file) . status ( ) . is_ok_and ( |status| status. success ( ) )
18+ }
19+
20+ fn test ( compiler : & str ) {
21+ if !ok_compiler_version ( compiler) {
22+ return ;
23+ }
24+
25+ let target = env_var ( "TARGET" ) ;
26+
27+ rustc ( )
28+ . input ( "test-aslr.rs" )
29+ . target ( & target)
30+ . arg ( format ! ( "-Clinker={compiler}" ) )
31+ . arg ( "-Clinker-flavor=gcc" )
32+ . arg ( "-Ctarget-feature=+crt-static" )
33+ . run ( ) ;
34+
35+ llvm_readobj ( )
36+ . symbols ( )
37+ . input ( "test-aslr" )
38+ . run ( )
39+ . assert_stdout_not_contains ( "INTERP" )
40+ . assert_stdout_contains ( "DYNAMIC" ) ;
41+
42+ cmd ( "test-aslr" ) . arg ( "--test-aslr" ) . run ( ) ;
43+ }
44+
45+ fn main ( ) {
46+ test ( "clang" ) ;
47+ test ( "gcc" ) ;
48+ }
You can’t perform that action at this time.
0 commit comments