[PATCH] GCC compatibility: pass -z linker options to the linker

Reid Kleckner rnk at google.com
Tue Jul 15 18:03:28 PDT 2014


lgtm with suggested tweaks.

================
Comment at: lib/Driver/Tools.cpp:206
@@ +205,3 @@
+      // Pass -z prefix for gcc linker compatibility.
+      A.claim(); A.render(Args, CmdArgs);
+    } else {
----------------
I was just being terse, I didn't mean to literally put them on the same line.  :)

================
Comment at: lib/Driver/Tools.cpp:7606-7609
@@ -7604,1 +7605,6 @@
+      CmdArgs.push_back(Input.getFilename()); 
+    else if (Input.getInputArg().getOption().matches(options::OPT_z)) {
+      // Pass -z prefix for gcc linker compatibility.
+      Input.getInputArg().claim(); Input.getInputArg().render(Args, CmdArgs);
+    } else {
       Input.getInputArg().renderAsInput(Args, CmdArgs);
----------------
Please revert this part of the change.  There is no reason we should forward -z to the MSVC linker.

http://reviews.llvm.org/D4393






More information about the cfe-commits mailing list