r308268 - Also add the option -no-pie (like -nopie)

Sylvestre Ledru via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 17 23:54:54 PDT 2017


Author: sylvestre
Date: Mon Jul 17 23:54:54 2017
New Revision: 308268

URL: http://llvm.org/viewvc/llvm-project?rev=308268&view=rev
Log:
Also add the option -no-pie (like -nopie)

Summary:
For example, this option is expected by ghc (haskell compiler). Currently, building with ghc will fail with:

```
clang: error: unknown argument: '-no-pie'
`gcc' failed in phase `Linker'. (Exit code: 1)
. /usr/share/haskell-devscripts/Dh_Haskell.sh && \
configure_recipe
```

This won't do anything (but won't fail with an error)


Reviewers: rafael, joerg

Reviewed By: joerg

Subscribers: joerg, cfe-commits

Differential Revision: https://reviews.llvm.org/D35462

Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/test/Driver/pic.c

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=308268&r1=308267&r2=308268&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon Jul 17 23:54:54 2017
@@ -2119,6 +2119,7 @@ def nofixprebinding : Flag<["-"], "nofix
 def nolibc : Flag<["-"], "nolibc">;
 def nomultidefs : Flag<["-"], "nomultidefs">;
 def nopie : Flag<["-"], "nopie">;
+def no_pie : Flag<["-"], "no-pie">, Alias<nopie>;
 def noprebind : Flag<["-"], "noprebind">;
 def noseglinkedit : Flag<["-"], "noseglinkedit">;
 def nostartfiles : Flag<["-"], "nostartfiles">;

Modified: cfe/trunk/test/Driver/pic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/pic.c?rev=308268&r1=308267&r2=308268&view=diff
==============================================================================
--- cfe/trunk/test/Driver/pic.c (original)
+++ cfe/trunk/test/Driver/pic.c Mon Jul 17 23:54:54 2017
@@ -247,6 +247,9 @@
 // On OpenBSD, -nopie needs to be passed through to the linker.
 // RUN: %clang %s -target i386-pc-openbsd -nopie -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-NOPIE-LD
+// Try with the alias
+// RUN: %clang %s -target i386-pc-openbsd -no-pie -### 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-NOPIE-LD
 //
 // On Android PIC is enabled by default
 // RUN: %clang -c %s -target i686-linux-android -### 2>&1 \




More information about the cfe-commits mailing list