]> granicus.if.org Git - clang/commitdiff
Merging r345470:
authorTom Stellard <tstellar@redhat.com>
Wed, 5 Dec 2018 19:48:58 +0000 (19:48 +0000)
committerTom Stellard <tstellar@redhat.com>
Wed, 5 Dec 2018 19:48:58 +0000 (19:48 +0000)
------------------------------------------------------------------------
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.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_70@348405 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/OpenBSD.cpp
test/Driver/openbsd.c

index 7b98cd62bbfcf8f8c40175339746a40005e6c545..432f6079e387e2a14f4dbd3b85f0bdf6376929fc 100644 (file)
@@ -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()) {
index 4aafa2f1f50c45083757a90b5134b01818dea163..16621b040759203fd3e6440e18deff66ca662878 100644 (file)
@@ -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" "-lgcc" "-lpthread_p" "-lc_p" "-lgcc" "{{.*}}crtend.o"
+// 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"
 
 // Check CPU type for MIPS64
 // RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \