From b78f3b89e171d276d0e05731efdde152585fc240 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Jul 2017 06:54:54 +0000 Subject: [PATCH] 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 llvm-svn: 308268 --- clang/include/clang/Driver/Options.td | 1 + clang/test/Driver/pic.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 861dfbf1916ef..753c178eec6ae 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -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; def noprebind : Flag<["-"], "noprebind">; def noseglinkedit : Flag<["-"], "noseglinkedit">; def nostartfiles : Flag<["-"], "nostartfiles">; diff --git a/clang/test/Driver/pic.c b/clang/test/Driver/pic.c index 61d752094f6e7..6b01c583b8b19 100644 --- a/clang/test/Driver/pic.c +++ b/clang/test/Driver/pic.c @@ -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 \