Skip to content

Commit b1c89d2

Browse files
committed
Merging r345470:
------------------------------------------------------------------------ r345470 | brad | 2018-10-27 20:30:18 -0700 (Sat, 27 Oct 2018) | 2 lines Reapply Pass the nopie flag to the linker when linking with -pg. ------------------------------------------------------------------------ llvm-svn: 348405
1 parent d363502 commit b1c89d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/Driver/ToolChains/OpenBSD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
138138

139139
if (Args.hasArg(options::OPT_pie))
140140
CmdArgs.push_back("-pie");
141-
if (Args.hasArg(options::OPT_nopie))
141+
if (Args.hasArg(options::OPT_nopie) || Args.hasArg(options::OPT_pg))
142142
CmdArgs.push_back("-nopie");
143143

144144
if (Output.isFilename()) {

clang/test/Driver/openbsd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pg -pthread %s -### 2>&1 \
1313
// RUN: | FileCheck --check-prefix=CHECK-PG %s
1414
// CHECK-PG: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
15-
// CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lpthread_p" "-lc_p" "-lgcc" "{{.*}}crtend.o"
15+
// CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-nopie" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lpthread_p" "-lc_p" "-lgcc" "{{.*}}crtend.o"
1616

1717
// Check CPU type for MIPS64
1818
// RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \

0 commit comments

Comments
 (0)