aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2012-05-15 18:57:39 +0000
committerBob Wilson <bob.wilson@apple.com>2012-05-15 18:57:39 +0000
commit63d9f3cddee40a3f3e5579e9004b31ec8663b5d9 (patch)
tree8e3e93d63eec7e8ffdb6ffe3031490bcce676ac8 /lib/Driver/Tools.cpp
parentb4882d50923881d1a01af4d5604b5baaa141cdf9 (diff)
Do not link with Objective-C libraries with -nostdlib or -nodefaultlibs.
<rdar://problem/11433499> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156841 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index e3966694ae..bed29abd82 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -4224,7 +4224,9 @@ void darwin::Link::ConstructJob(Compilation &C, const JobAction &JA,
// This is more complicated in gcc...
CmdArgs.push_back("-lgomp");
- if (isObjCRuntimeLinked(Args)) {
+ if (isObjCRuntimeLinked(Args) &&
+ !Args.hasArg(options::OPT_nostdlib) &&
+ !Args.hasArg(options::OPT_nodefaultlibs)) {
// Avoid linking compatibility stubs on i386 mac.
if (!getDarwinToolChain().isTargetMacOS() ||
getDarwinToolChain().getArchName() != "i386") {