[PATCH] D19996: New clang option -mpie-copy-relocationss to indicate support for linker copy relocations when linking as PIE

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 19 11:30:07 PDT 2016


rnk added a comment.

In https://reviews.llvm.org/D19996#422906, @rafael wrote:

> Is there a gcc option or they just assume they are targeting the
>  linker that was around when gcc was built?


IIRC there's no GCC option. They base their decision on the configure-time check like you suggested.



================
Comment at: include/clang/Driver/Options.td:1696
+  Flags<[CC1Option]>,
+  HelpText<"Copy Relocations support for PIE builds">;
+def mno_pie_copy_relocations : Flag<["-"], "mno-pie-copy-relocations">, Group<m_Group>,
----------------
I agree with Rafael, this needs a verb, like "Use copy relocations in PIE builds" or something.


================
Comment at: include/clang/Driver/Options.td:1698
+def mno_pie_copy_relocations : Flag<["-"], "mno-pie-copy-relocations">, Group<m_Group>,
+  Flags<[CC1Option]>,
+  HelpText<"No Copy Relocations support for PIE builds">;
----------------
The "no" option variants don't need to be CC1 options.


================
Comment at: include/clang/Driver/Options.td:1699
+  Flags<[CC1Option]>,
+  HelpText<"No Copy Relocations support for PIE builds">;
 def mx87 : Flag<["-"], "mx87">, Group<m_x86_Features_Group>;
----------------
I don't think we need help text for the "no" variant. I think we add help text to "no" flags when the flag is on by default, for example `-fno-exceptions`.


https://reviews.llvm.org/D19996





More information about the cfe-commits mailing list