diff --git a/bolt/test/AArch64/asm-func-debug.test b/bolt/test/AArch64/asm-func-debug.test --- a/bolt/test/AArch64/asm-func-debug.test +++ b/bolt/test/AArch64/asm-func-debug.test @@ -3,7 +3,7 @@ # # The input test case foo() contains nops that we remove. -RUN: %clang %cflags -g %p/../Inputs/asm_foo.s %p/../Inputs/asm_main.c -o %t.exe +RUN: %clang %cflags -no-pie -g %p/../Inputs/asm_foo.s %p/../Inputs/asm_main.c -o %t.exe RUN: llvm-bolt %t.exe -o %t -update-debug-sections RUN: llvm-dwarfdump -all %t | FileCheck %s diff --git a/bolt/test/X86/asm-func-debug.test b/bolt/test/X86/asm-func-debug.test --- a/bolt/test/X86/asm-func-debug.test +++ b/bolt/test/X86/asm-func-debug.test @@ -3,7 +3,7 @@ # # The input test case foo() contains nops that we remove. -RUN: %clang -g %cflags %p/../Inputs/asm_foo.s %p/../Inputs/asm_main.c -o %t.exe +RUN: %clang -g %cflags -no-pie %p/../Inputs/asm_foo.s %p/../Inputs/asm_main.c -o %t.exe RUN: llvm-bolt %t.exe -o %t -update-debug-sections RUN: llvm-dwarfdump -all %t | FileCheck %s diff --git a/bolt/test/X86/debug-fission-single.s b/bolt/test/X86/debug-fission-single.s --- a/bolt/test/X86/debug-fission-single.s +++ b/bolt/test/X86/debug-fission-single.s @@ -8,7 +8,7 @@ # RUN: --split-dwarf-file=debug-fission-simple.dwo \ # RUN: %p/Inputs/debug-fission-simple.s \ # RUN: -o %t.o -# RUN: %clangxx %cxxflags -g \ +# RUN: %clangxx %cxxflags -no-pie -g \ # RUN: -Wl,--gc-sections,-q,-nostdlib \ # RUN: -Wl,--undefined=_Z6_startv \ # RUN: -nostartfiles \ diff --git a/bolt/test/X86/exceptions-args.test b/bolt/test/X86/exceptions-args.test --- a/bolt/test/X86/exceptions-args.test +++ b/bolt/test/X86/exceptions-args.test @@ -1,7 +1,7 @@ # Check that we handle GNU_args_size correctly. # It is generated for throwing functions with LP that have parameters on stack. -RUN: %clangxx %cxxflags %p/Inputs/exc_args.s -o %t +RUN: %clangxx %cxxflags -no-pie %p/Inputs/exc_args.s -o %t RUN: llvm-bolt %t -o /dev/null -print-finalized -print-only=main | FileCheck %s CHECK: Binary Function "main" after finalize-functions diff --git a/bolt/test/X86/indirect-goto.test b/bolt/test/X86/indirect-goto.test --- a/bolt/test/X86/indirect-goto.test +++ b/bolt/test/X86/indirect-goto.test @@ -1,5 +1,5 @@ # Check llvm-bolt processes binaries compiled from sources that use indirect goto. -RUN: %clang %cflags %S/Inputs/indirect_goto.c -Wl,-q -o %t +RUN: %clang %cflags -no-pie %S/Inputs/indirect_goto.c -Wl,-q -o %t RUN: llvm-bolt %t -o /dev/null -relocs=1 -print-cfg -print-only=main -strict \ RUN: |& FileCheck %s diff --git a/bolt/test/X86/interprocedural-ref-entry-point.s b/bolt/test/X86/interprocedural-ref-entry-point.s --- a/bolt/test/X86/interprocedural-ref-entry-point.s +++ b/bolt/test/X86/interprocedural-ref-entry-point.s @@ -18,7 +18,7 @@ # REQUIRES: system-linux # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o -# RUN: %clangxx %cxxflags %t.o -o %t.exe -Wl,-q +# RUN: %clangxx %cxxflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -o %t.out -dump-dot-all -funcs=main.* 2>&1 | FileCheck %s # # CHECK-NOT: Assertion `isValid()' failed. diff --git a/bolt/test/X86/issue20.s b/bolt/test/X86/issue20.s --- a/bolt/test/X86/issue20.s +++ b/bolt/test/X86/issue20.s @@ -6,7 +6,7 @@ # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \ # RUN: %s -o %t.o -# RUN: %clang %cflags %t.o -o %t.exe +# RUN: %clang %cflags -no-pie %t.o -o %t.exe # RUN: llvm-bolt %t.exe -relocs=0 -jump-tables=move -print-finalized \ # RUN: -o %t.out | FileCheck %s diff --git a/bolt/test/X86/jump-table-footprint-reduction.test b/bolt/test/X86/jump-table-footprint-reduction.test --- a/bolt/test/X86/jump-table-footprint-reduction.test +++ b/bolt/test/X86/jump-table-footprint-reduction.test @@ -5,7 +5,7 @@ RUN: %S/Inputs/jump_table_footprint_reduction.s -o %t.o RUN: link_fdata %S/Inputs/jump_table_footprint_reduction.s %t.o %t.fdata RUN: llvm-strip --strip-unneeded %t.o -RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q RUN: llvm-bolt %t.exe -data %t.fdata -o /dev/null \ RUN: -jump-tables=move -jt-footprint-reduction -assume-abi -relocs \ RUN: | FileCheck %s diff --git a/bolt/test/X86/jump-table-icp.test b/bolt/test/X86/jump-table-icp.test --- a/bolt/test/X86/jump-table-icp.test +++ b/bolt/test/X86/jump-table-icp.test @@ -2,7 +2,7 @@ RUN: %p/Inputs/jump_table_icp.s -o %t.o RUN: link_fdata %p/Inputs/jump_table_icp.s %t.o %t.fdata RUN: llvm-strip --strip-unneeded %t.o -RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q RUN: (llvm-bolt %t.exe -data %t.fdata -o %t -relocs \ RUN: -reorder-blocks=cache -split-functions=3 -split-all-cold \ diff --git a/bolt/test/X86/jump-table-reference.test b/bolt/test/X86/jump-table-reference.test --- a/bolt/test/X86/jump-table-reference.test +++ b/bolt/test/X86/jump-table-reference.test @@ -1,6 +1,6 @@ # Verifies that BOLT detects fixed destination of indirect jump -RUN: %clang %cflags %S/Inputs/jump_table_reference.s -Wl,-q -o %t +RUN: %clang %cflags -no-pie %S/Inputs/jump_table_reference.s -Wl,-q -o %t RUN: llvm-bolt %t -relocs -o /dev/null 2>&1 | FileCheck %s CHECK: BOLT-INFO: fixed indirect branch detected in main diff --git a/bolt/test/X86/loop-nest.test b/bolt/test/X86/loop-nest.test --- a/bolt/test/X86/loop-nest.test +++ b/bolt/test/X86/loop-nest.test @@ -4,7 +4,7 @@ RUN: %p/Inputs/loop_nest.s -o %t.o RUN: link_fdata %p/Inputs/loop_nest.s %t.o %t.fdata RUN: llvm-strip --strip-unneeded %t.o -RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q RUN: llvm-bolt %t.exe -o %t -data=%t.fdata \ RUN: -print-cfg -print-loops -sequential-disassembly -lite=0 2>&1 | FileCheck %s diff --git a/bolt/test/X86/shrinkwrapping-critedge.s b/bolt/test/X86/shrinkwrapping-critedge.s --- a/bolt/test/X86/shrinkwrapping-critedge.s +++ b/bolt/test/X86/shrinkwrapping-critedge.s @@ -7,7 +7,7 @@ # RUN: %s -o %t.o # RUN: link_fdata %s %t.o %t.fdata # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q -nostdlib # RUN: llvm-bolt %t.exe -relocs -o %t.out -data %t.fdata \ # RUN: -frame-opt=all -simplify-conditional-tail-calls=false \ # RUN: -eliminate-unreachable=false diff --git a/bolt/test/X86/shrinkwrapping.test b/bolt/test/X86/shrinkwrapping.test --- a/bolt/test/X86/shrinkwrapping.test +++ b/bolt/test/X86/shrinkwrapping.test @@ -2,7 +2,7 @@ # shrink-wrapping when optimizing a function without # frame pointers. -RUN: %clangxx %cxxflags %S/Inputs/exc4sw.S -o %t.exe -Wl,-q +RUN: %clangxx %cxxflags -no-pie %S/Inputs/exc4sw.S -o %t.exe -Wl,-q RUN: llvm-bolt %t.exe -o %t -relocs -frame-opt=all \ RUN: -data=%p/Inputs/exc4sw.fdata -reorder-blocks=cache 2>&1 | \ RUN: FileCheck %s --check-prefix=CHECK-BOLT diff --git a/bolt/test/X86/tail-duplication-cacheline.s b/bolt/test/X86/tail-duplication-cacheline.s --- a/bolt/test/X86/tail-duplication-cacheline.s +++ b/bolt/test/X86/tail-duplication-cacheline.s @@ -7,7 +7,7 @@ # RUN: %s -o %t.o # RUN: link_fdata %s %t.o %t.fdata # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q -nostdlib # RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -relocs \ # RUN: -tail-duplication=1 -tail-duplication-aggressive=1 .globl _start diff --git a/bolt/test/X86/tail-duplication-jt.s b/bolt/test/X86/tail-duplication-jt.s --- a/bolt/test/X86/tail-duplication-jt.s +++ b/bolt/test/X86/tail-duplication-jt.s @@ -7,7 +7,7 @@ # RUN: %s -o %t.o # RUN: link_fdata %s %t.o %t.fdata # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clangxx %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clangxx %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -o %t.out -data %t.fdata -relocs \ # RUN: -tail-duplication=1 -tail-duplication-aggressive=1 \ # RUN: -print-cfg | FileCheck %s diff --git a/bolt/test/X86/unreachable.test b/bolt/test/X86/unreachable.test --- a/bolt/test/X86/unreachable.test +++ b/bolt/test/X86/unreachable.test @@ -1,6 +1,6 @@ # Check unreachable code elimination -RUN: %clangxx %cxxflags %p/Inputs/unreachable.s -o %t.exe +RUN: %clangxx %cxxflags -no-pie %p/Inputs/unreachable.s -o %t.exe RUN: llvm-bolt %t.exe -o %t \ RUN: -reorder-blocks=none -split-functions=1 -eliminate-unreachable \ RUN: -funcs=foo -use-gnu-stack -print-cfg -print-finalized \ diff --git a/bolt/test/X86/vararg.test b/bolt/test/X86/vararg.test --- a/bolt/test/X86/vararg.test +++ b/bolt/test/X86/vararg.test @@ -4,7 +4,7 @@ REQUIRES: x86_64-linux -RUN: %clangxx %cxxflags %p/../Inputs/vararg.s -o %t -Wl,-q +RUN: %clangxx %cxxflags -no-pie %p/../Inputs/vararg.s -o %t -Wl,-q RUN: llvm-bolt %t -o /dev/null -print-cfg -print-only=.*printf.* |& FileCheck %s CHECK: IsSimple : 0 diff --git a/bolt/test/X86/zero-sized-object.s b/bolt/test/X86/zero-sized-object.s --- a/bolt/test/X86/zero-sized-object.s +++ b/bolt/test/X86/zero-sized-object.s @@ -5,7 +5,7 @@ # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \ # RUN: %s -o %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -print-cfg \ # RUN: -print-only=main -o %t.out | FileCheck %s diff --git a/bolt/test/lit.cfg.py b/bolt/test/lit.cfg.py --- a/bolt/test/lit.cfg.py +++ b/bolt/test/lit.cfg.py @@ -63,8 +63,8 @@ llvm_config.config.available_features.add('ld.lld') llvm_config.add_tool_substitutions([ToolSubst(r'ld\.lld', command=ld_lld)]) -config.substitutions.append(('%cflags', '-no-pie -gdwarf-4')) -config.substitutions.append(('%cxxflags', '-no-pie -gdwarf-4')) +config.substitutions.append(('%cflags', '-gdwarf-4')) +config.substitutions.append(('%cxxflags', '-gdwarf-4')) link_fdata_cmd = os.path.join(config.test_source_root, 'link_fdata.py') diff --git a/bolt/test/runtime/X86/exceptions-instrumentation.test b/bolt/test/runtime/X86/exceptions-instrumentation.test --- a/bolt/test/runtime/X86/exceptions-instrumentation.test +++ b/bolt/test/runtime/X86/exceptions-instrumentation.test @@ -2,7 +2,7 @@ REQUIRES: system-linux -RUN: %clangxx %cxxflags %p/Inputs/exceptions_split.cpp -Wl,-q -g -o %t_exc_split +RUN: %clangxx %cxxflags -no-pie %p/Inputs/exceptions_split.cpp -Wl,-q -g -o %t_exc_split RUN: llvm-bolt %t_exc_split -o %t.exc -instrument -instrumentation-file=%t.fdata RUN: %t.exc arg1 arg2 arg3 diff --git a/bolt/test/runtime/X86/fix-branches-jrcxz.s b/bolt/test/runtime/X86/fix-branches-jrcxz.s --- a/bolt/test/runtime/X86/fix-branches-jrcxz.s +++ b/bolt/test/runtime/X86/fix-branches-jrcxz.s @@ -6,7 +6,7 @@ # RUN: %s -o %t.o # RUN: link_fdata %s %t.o %t.fdata # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -relocs=1 -reorder-blocks=cache+ -print-finalized \ # RUN: -o %t.out -data %t.fdata | FileCheck %s # RUN: %t.out 1 2 3 diff --git a/bolt/test/runtime/X86/hot-end-symbol.s b/bolt/test/runtime/X86/hot-end-symbol.s --- a/bolt/test/runtime/X86/hot-end-symbol.s +++ b/bolt/test/runtime/X86/hot-end-symbol.s @@ -9,7 +9,7 @@ # RUN: %s -o %t.o # RUN: link_fdata %s %t.o %t.fdata # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -relocs=1 -hot-text -reorder-functions=hfsort \ # RUN: -data %t.fdata -o %t.out | FileCheck %s diff --git a/bolt/test/runtime/X86/instrumentation-dup-jts.s b/bolt/test/runtime/X86/instrumentation-dup-jts.s --- a/bolt/test/runtime/X86/instrumentation-dup-jts.s +++ b/bolt/test/runtime/X86/instrumentation-dup-jts.s @@ -46,7 +46,7 @@ # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \ # RUN: %s -o %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \ # RUN: -o %t.instrumented diff --git a/bolt/test/runtime/X86/instrumentation-ind-calls.s b/bolt/test/runtime/X86/instrumentation-ind-calls.s --- a/bolt/test/runtime/X86/instrumentation-ind-calls.s +++ b/bolt/test/runtime/X86/instrumentation-ind-calls.s @@ -10,7 +10,7 @@ # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \ # RUN: %s -o %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -instrument -instrumentation-file=%t.fdata \ # RUN: -o %t.instrumented diff --git a/bolt/test/runtime/X86/interp-overwrite-bug.s b/bolt/test/runtime/X86/interp-overwrite-bug.s --- a/bolt/test/runtime/X86/interp-overwrite-bug.s +++ b/bolt/test/runtime/X86/interp-overwrite-bug.s @@ -10,7 +10,7 @@ # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clang %cflags -nostartfiles -nostdlib -lc %t.o -o %t.exe +# RUN: %clang %cflags -no-pie -nostartfiles -nostdlib -lc %t.o -o %t.exe # RUN: llvm-bolt %t.exe -o %t.exe.bolt -relocs=0 -lite=0 -reorder-blocks=reverse diff --git a/bolt/test/runtime/X86/section-reloc-with-addend.s b/bolt/test/runtime/X86/section-reloc-with-addend.s --- a/bolt/test/runtime/X86/section-reloc-with-addend.s +++ b/bolt/test/runtime/X86/section-reloc-with-addend.s @@ -11,7 +11,7 @@ # RUN: %s -o %t.o # Delete our BB symbols so BOLT doesn't mark them as entry points # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -relocs=1 -print-finalized -print-only=main -o %t.out diff --git a/bolt/test/runtime/X86/shrinkwrapping-alignment.s b/bolt/test/runtime/X86/shrinkwrapping-alignment.s --- a/bolt/test/runtime/X86/shrinkwrapping-alignment.s +++ b/bolt/test/runtime/X86/shrinkwrapping-alignment.s @@ -11,7 +11,7 @@ # RUN: link_fdata %s %t.o %t.fdata # Delete our BB symbols so BOLT doesn't mark them as entry points # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -relocs=1 -frame-opt=all -print-finalized \ # RUN: -lite=0 -print-only=main -data %t.fdata -o %t.out | FileCheck %s diff --git a/bolt/test/runtime/X86/shrinkwrapping-lock.s b/bolt/test/runtime/X86/shrinkwrapping-lock.s --- a/bolt/test/runtime/X86/shrinkwrapping-lock.s +++ b/bolt/test/runtime/X86/shrinkwrapping-lock.s @@ -9,7 +9,7 @@ # RUN: link_fdata %s %t.o %t.fdata # Delete our BB symbols so BOLT doesn't mark them as entry points # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -relocs=1 -frame-opt=all -print-fop \ # RUN: -print-only=main -data %t.fdata -o %t.out | FileCheck %s diff --git a/bolt/test/runtime/X86/shrinkwrapping-pushpop.s b/bolt/test/runtime/X86/shrinkwrapping-pushpop.s --- a/bolt/test/runtime/X86/shrinkwrapping-pushpop.s +++ b/bolt/test/runtime/X86/shrinkwrapping-pushpop.s @@ -10,7 +10,7 @@ # RUN: link_fdata %s %t.o %t.fdata # Delete our BB symbols so BOLT doesn't mark them as entry points # RUN: llvm-strip --strip-unneeded %t.o -# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q +# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q # RUN: llvm-bolt %t.exe -relocs=1 -frame-opt=all -print-finalized \ # RUN: -print-only=main -data %t.fdata -o %t.out | FileCheck %s diff --git a/bolt/test/runtime/X86/user-func-reorder.c b/bolt/test/runtime/X86/user-func-reorder.c --- a/bolt/test/runtime/X86/user-func-reorder.c +++ b/bolt/test/runtime/X86/user-func-reorder.c @@ -27,7 +27,7 @@ /* REQUIRES: system-linux,bolt-runtime -RUN: %clang %cflags %s -o %t.exe -Wl,-q +RUN: %clang %cflags -no-pie %s -o %t.exe -Wl,-q RUN: llvm-bolt %t.exe -relocs=1 -lite -reorder-functions=user \ RUN: -hugify -function-order=%p/Inputs/user_func_order.txt -o %t diff --git a/bolt/test/runtime/fptr.test b/bolt/test/runtime/fptr.test --- a/bolt/test/runtime/fptr.test +++ b/bolt/test/runtime/fptr.test @@ -1,6 +1,6 @@ # Make sure BOLT correctly updates values based on function pointer. -RUN: %clang %cflags %p/Inputs/fptr.c -Wl,-q -o %t.exe +RUN: %clang %cflags -no-pie %p/Inputs/fptr.c -Wl,-q -o %t.exe RUN: llvm-bolt %t.exe -o %t -lite=0 RUN: %t | FileCheck %s