diff options
author | Pascal Stumpf <pascal@cvs.openbsd.org> | 2016-09-05 11:39:32 +0000 |
---|---|---|
committer | Pascal Stumpf <pascal@cvs.openbsd.org> | 2016-09-05 11:39:32 +0000 |
commit | 76da38656f9cfb72deeeff552ebab25ec97fc7fc (patch) | |
tree | 4f46b7c5257898897a9c7dfec4320d160830a43b /gnu/llvm/tools | |
parent | e057956e6e4735d263eae8cdbe91a10aa829f755 (diff) |
Link static PIEs with the correct C runtime (rcrt0.o).
ok kettenis@
Diffstat (limited to 'gnu/llvm/tools')
-rw-r--r-- | gnu/llvm/tools/clang/lib/Driver/Tools.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gnu/llvm/tools/clang/lib/Driver/Tools.cpp b/gnu/llvm/tools/clang/lib/Driver/Tools.cpp index b7ac24fe674..3c228b1ebe2 100644 --- a/gnu/llvm/tools/clang/lib/Driver/Tools.cpp +++ b/gnu/llvm/tools/clang/lib/Driver/Tools.cpp @@ -7600,6 +7600,10 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_pg)) CmdArgs.push_back( Args.MakeArgString(getToolChain().GetFilePath("gcrt0.o"))); + else if (Args.hasArg(options::OPT_static) && + !Args.hasArg(options::OPT_nopie)) + CmdArgs.push_back( + Args.MakeArgString(getToolChain().GetFilePath("rcrt0.o"))); else CmdArgs.push_back( Args.MakeArgString(getToolChain().GetFilePath("crt0.o"))); |