File tree Expand file tree Collapse file tree 3 files changed +46
-19
lines changed
tests/run-make/static-pie Expand file tree Collapse file tree 3 files changed +46
-19
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,6 @@ run-make/split-debuginfo/Makefile
176176run-make/stable-symbol-names/Makefile
177177run-make/static-dylib-by-default/Makefile
178178run-make/static-extern-type/Makefile
179- run-make/static-pie/Makefile
180179run-make/staticlib-blank-lib/Makefile
181180run-make/staticlib-dylib-linkage/Makefile
182181run-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, run_with_args, target} ;
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+ rustc ( )
26+ . input ( "test-aslr.rs" )
27+ . target ( & target ( ) )
28+ . linker ( compiler)
29+ . arg ( "-Clinker-flavor=gcc" )
30+ . arg ( "-Ctarget-feature=+crt-static" )
31+ . run ( ) ;
32+
33+ llvm_readobj ( )
34+ . symbols ( )
35+ . input ( "test-aslr" )
36+ . run ( )
37+ . assert_stdout_not_contains ( "INTERP" )
38+ . assert_stdout_contains ( "DYNAMIC" ) ;
39+
40+ run_with_args ( "test-aslr" , & [ "--test-aslr" ] ) ;
41+ }
42+
43+ fn main ( ) {
44+ test ( "clang" ) ;
45+ test ( "gcc" ) ;
46+ }
You can’t perform that action at this time.
0 commit comments