[PATCH] D16469: Pass --wrap=pthread_create to linker for -fsplit-stack
H.J Lu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 22 10:36:35 PST 2016
hjl.tools created this revision.
hjl.tools added a reviewer: rsmith.
hjl.tools added a subscriber: cfe-commits.
From
https://gcc.gnu.org/ml/gcc-patches/2010-09/msg01807.html
-fsplit-stack should pass --wrap=pthread_create to linker for -fsplit-stack
It is needed to initialize the stack guard. This fixes PR 20148.
http://reviews.llvm.org/D16469
Files:
lib/Driver/Tools.cpp
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -9001,6 +9001,9 @@
if (WantPthread && !isAndroid)
CmdArgs.push_back("-lpthread");
+ if (Args.hasArg(options::OPT_fsplit_stack))
+ CmdArgs.push_back("--wrap=pthread_create");
+
CmdArgs.push_back("-lc");
if (Args.hasArg(options::OPT_static))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16469.45698.patch
Type: text/x-patch
Size: 435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160122/41a9b083/attachment.bin>
More information about the cfe-commits
mailing list