diff options
author | Brad Smith <brad@comstyle.com> | 2018-10-28 03:30:18 +0000 |
---|---|---|
committer | Brad Smith <brad@comstyle.com> | 2018-10-28 03:30:18 +0000 |
commit | f69e619d8ac2b982265d710362ffb506202bf0f0 (patch) | |
tree | f16fbe95d165be60fc9b37e30a67be72965587b7 | |
parent | fefbba5f08e0f3ece71c00f16478cc2dfcd85521 (diff) |
Reapply Pass the nopie flag to the linker when linking with -pg.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345470 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Driver/ToolChains/OpenBSD.cpp | 2 | ||||
-rw-r--r-- | test/Driver/openbsd.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Driver/ToolChains/OpenBSD.cpp b/lib/Driver/ToolChains/OpenBSD.cpp index 018076ab19..3d35d37b7d 100644 --- a/lib/Driver/ToolChains/OpenBSD.cpp +++ b/lib/Driver/ToolChains/OpenBSD.cpp @@ -138,7 +138,7 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_pie)) CmdArgs.push_back("-pie"); - if (Args.hasArg(options::OPT_nopie)) + if (Args.hasArg(options::OPT_nopie) || Args.hasArg(options::OPT_pg)) CmdArgs.push_back("-nopie"); if (Output.isFilename()) { diff --git a/test/Driver/openbsd.c b/test/Driver/openbsd.c index 1ea1f58dfc..f16d58ae14 100644 --- a/test/Driver/openbsd.c +++ b/test/Driver/openbsd.c @@ -12,7 +12,7 @@ // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pg -pthread %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-PG %s // CHECK-PG: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" -// CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lcompiler_rt" "-lpthread_p" "-lc_p" "-lcompiler_rt" "{{.*}}crtend.o" +// CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-nopie" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lcompiler_rt" "-lpthread_p" "-lc_p" "-lcompiler_rt" "{{.*}}crtend.o" // Check CPU type for MIPS64 // RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \ |