diff options
author | Eric Christopher <echristo@apple.com> | 2012-09-13 06:32:34 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-09-13 06:32:34 +0000 |
commit | dc6cc87ab68091a714526b391e2a1291d84d485e (patch) | |
tree | 9a407f8c7b32d53d1ddf35a0a240ec6bea9c6ff7 /lib/Driver/Tools.cpp | |
parent | 1696bc28f4460c187ab80f3b20b1507f58a4ef2f (diff) |
Properly link libpthread_p when using profiling on OpenBSD.
Patch by Brad Smith.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index c0ce50437f..c10df6fc63 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -4943,14 +4943,21 @@ void openbsd::Link::ConstructJob(Compilation &C, const JobAction &JA, // the default system libraries. Just mimic this for now. CmdArgs.push_back("-lgcc"); - if (Args.hasArg(options::OPT_pthread)) - CmdArgs.push_back("-lpthread"); + if (Args.hasArg(options::OPT_pthread)) { + if (!Args.hasArg(options::OPT_shared) && + Args.hasArg(options::OPT_pg)) + CmdArgs.push_back("-lpthread_p"); + else + CmdArgs.push_back("-lpthread"); + } + if (!Args.hasArg(options::OPT_shared)) { - if (Args.hasArg(options::OPT_pg)) + if (Args.hasArg(options::OPT_pg)) CmdArgs.push_back("-lc_p"); else CmdArgs.push_back("-lc"); } + CmdArgs.push_back("-lgcc"); } |