[PATCH] D59841: [Gnu Driver] If -pie and -static-pie are both passed, let -static-pie win.

Sterling Augustine via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 14:06:26 PDT 2019


saugustine added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:311
   if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) ||
-      Args.hasArg(options::OPT_r))
+      Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie))
     return false;
----------------
It's not clear to me that the command line -static-pie -no-pie should result in static-pie, given the way the rest of that function is coded.

I might make it a ternary enum: "nothing" "pie" "static-pie" with the last one winning. That method seems more consistent with current behavior.

This would allow anyone checking the state of pie to use a single function and just check the result.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59841/new/

https://reviews.llvm.org/D59841





More information about the cfe-commits mailing list