Author: brad
Date: Fri Oct 26 17:23:28 2018
New Revision: 345439

URL: http://llvm.org/viewvc/llvm-project?rev=345439&view=rev
Log:
Pass the nopie flag to the linker when linking with -pg.

Modified:
    cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp
    cfe/trunk/test/Driver/openbsd.c

Modified: cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp?rev=345439&r1=345438&r2=345439&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp Fri Oct 26 17:23:28 2018
@@ -138,7 +138,7 @@ void openbsd::Linker::ConstructJob(Compi
 
   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()) {

Modified: cfe/trunk/test/Driver/openbsd.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/openbsd.c?rev=345439&r1=345438&r2=345439&view=diff
==============================================================================
--- cfe/trunk/test/Driver/openbsd.c (original)
+++ cfe/trunk/test/Driver/openbsd.c Fri Oct 26 17:23:28 2018
@@ -84,6 +84,8 @@
 // Check linking against correct startup code when (not) using PIE
 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK-PIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pg %s -### 2>&1 
\
+// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s
 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pie %s -### 
2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK-PIE-FLAG %s
 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -fno-pie %s -### 
2>&1 \


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to