From 76da38656f9cfb72deeeff552ebab25ec97fc7fc Mon Sep 17 00:00:00 2001 From: Pascal Stumpf Date: Mon, 5 Sep 2016 11:39:32 +0000 Subject: Link static PIEs with the correct C runtime (rcrt0.o). ok kettenis@ --- gnu/llvm/tools/clang/lib/Driver/Tools.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gnu/llvm/tools') 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"))); -- cgit v1.2.3