Skip to content

Commit

Permalink
Also add the option -no-pie (like -nopie)
Browse files Browse the repository at this point in the history
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

llvm-svn: 308268
  • Loading branch information
sylvestre committed Jul 18, 2017
1 parent f54a500 commit b78f3b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions clang/include/clang/Driver/Options.td
Expand Up @@ -2119,6 +2119,7 @@ def nofixprebinding : Flag<["-"], "nofixprebinding">;
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">;
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Driver/pic.c
Expand Up @@ -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 \
Expand Down

0 comments on commit b78f3b8

Please sign in to comment.