[PATCH] D35462: Also add the option -no-pie (like -nopie)

Sylvestre Ledru via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 16 08:34:56 PDT 2017


sylvestre.ledru created this revision.

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)


https://reviews.llvm.org/D35462

Files:
  docs/ClangCommandLineReference.rst
  include/clang/Driver/Options.td
  test/Driver/pic.c


Index: test/Driver/pic.c
===================================================================
--- test/Driver/pic.c
+++ test/Driver/pic.c
@@ -30,6 +30,7 @@
 // CHECK-PIE-LD: "crtendS.o" "crtn.o"
 //
 // CHECK-NOPIE-LD: "-nopie"
+// CHECK-NOPIE-LD: "-no-pie"
 //
 // CHECK-DYNAMIC-NO-PIC-32: "-mrelocation-model" "dynamic-no-pic"
 // CHECK-DYNAMIC-NO-PIC-32-NOT: "-pic-level"
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -2119,6 +2119,7 @@
 def nolibc : Flag<["-"], "nolibc">;
 def nomultidefs : Flag<["-"], "nomultidefs">;
 def nopie : Flag<["-"], "nopie">;
+def no_pie : Flag<["-"], "no-pie">;
 def noprebind : Flag<["-"], "noprebind">;
 def noseglinkedit : Flag<["-"], "noseglinkedit">;
 def nostartfiles : Flag<["-"], "nostartfiles">;
Index: docs/ClangCommandLineReference.rst
===================================================================
--- docs/ClangCommandLineReference.rst
+++ docs/ClangCommandLineReference.rst
@@ -294,6 +294,8 @@
 
 .. option:: -nopie
 
+.. option:: -no-pie
+
 .. option:: -noprebind
 
 .. option:: -noseglinkedit


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35462.106807.patch
Type: text/x-patch
Size: 1183 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170716/b127300e/attachment.bin>


More information about the cfe-commits mailing list