diff options
-rw-r--r-- | gnu/llvm/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gnu/llvm/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp b/gnu/llvm/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp index 92623a04364..7615edaa78b 100644 --- a/gnu/llvm/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp +++ b/gnu/llvm/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp @@ -154,10 +154,9 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, const char *crt0 = nullptr; const char *crtbegin = nullptr; if (!Args.hasArg(options::OPT_shared)) { - if (Args.hasArg(options::OPT_pg)) { - CmdArgs.push_back("-nopie"); + if (Args.hasArg(options::OPT_pg)) crt0 = "gcrt0.o"; - } else if (Args.hasArg(options::OPT_static) && + else if (Args.hasArg(options::OPT_static) && !Args.hasArg(options::OPT_nopie)) crt0 = "rcrt0.o"; else |