]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Validate -pie if PIE is enabled by default
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 25 Jun 2015 21:31:04 +0000 (21:31 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 25 Jun 2015 21:31:04 +0000 (14:31 -0700)
When PIE is enabled by default, -pie is treated as nop in driver.  We
should simply validate it, instead of issue an error.

* gcc.c (driver_handle_option): Validate -pie if PIE is enabled
by default.

From-SVN: r224987

gcc/ChangeLog
gcc/gcc.c

index 4f65eef75f3dffb976642447288dc2d26c66b24e..2ca60430fc979fd15fc7c53934efcf59888ec8d5 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * gcc.c (driver_handle_option): Validate -pie if PIE is enabled
+       by default.
+
 2015-06-25  Andrew MacLeod  <amacleod@redhat.com>
 
        * function.h (ipa_opt_pass, ipa_opt_pass_d): Move forward declarations.
index d77c6c5692ad883fae862de8e9a9b5a249438626..0f29b7870fb0ca07059a5a905f1e4694121b548e 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3893,6 +3893,11 @@ driver_handle_option (struct gcc_options *opts,
       save_switch ("-o", 1, &arg, validated, true);
       return true;
 
+#ifdef ENABLE_DEFAULT_PIE
+    case OPT_pie:
+      /* -pie is turned on by default.  */
+#endif
+
     case OPT_static_libgcc:
     case OPT_shared_libgcc:
     case OPT_static_libgfortran: