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 | 17674ec8c6631c4b5d645ccf3ad1e39b633095c4 (patch) | |
tree | ec5f13f2669d3644c31491c598def089041a4725 /clang/lib/Driver/Tools.cpp | |
parent | 4a7a5610ce72a632b7d8047f81efe00a3b7e4128 (diff) | |
download | bcm5719-llvm-17674ec8c6631c4b5d645ccf3ad1e39b633095c4.tar.gz bcm5719-llvm-17674ec8c6631c4b5d645ccf3ad1e39b633095c4.zip |
Properly link libpthread_p when using profiling on OpenBSD.
Patch by Brad Smith.
llvm-svn: 163777
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index c0ce50437ff..c10df6fc634 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/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"); } |