summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2016-01-13 01:19:02 +0000
committerBob Wilson <bob.wilson@apple.com>2016-01-13 01:19:02 +0000
commit0a15e6cc36051c901a4b2a92f308ae23f53b671a (patch)
tree92595b9d81600788d3bb27995124d6b0e8c1976a /clang/lib/Driver/Tools.cpp
parent4cc3421a24b567b94265d9a5c77f816fa3afb53b (diff)
downloadbcm5719-llvm-0a15e6cc36051c901a4b2a92f308ae23f53b671a.tar.gz
bcm5719-llvm-0a15e6cc36051c901a4b2a92f308ae23f53b671a.zip
Generalize r256026 to apply to all MachO targets, not just Darwin targets.
The PIC default is set for the MachO toolchain, not just the Darwin toolchain, so this treats those the same. The behavior with -static should be the same for all MachO targets. rdar://24152327 llvm-svn: 257556
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 9a1a9498a90..5a2dbd388fc 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -3263,8 +3263,9 @@ ParsePICArgs(const ToolChain &ToolChain, const llvm::Triple &Triple,
// ToolChain.getTriple() and Triple?
bool PIE = ToolChain.isPIEDefault();
bool PIC = PIE || ToolChain.isPICDefault();
- // The Darwin default to use PIC does not apply when using -static.
- if (ToolChain.getTriple().isOSDarwin() && Args.hasArg(options::OPT_static))
+ // The Darwin/MachO default to use PIC does not apply when using -static.
+ if (ToolChain.getTriple().isOSBinFormatMachO() &&
+ Args.hasArg(options::OPT_static))
PIE = PIC = false;
bool IsPICLevelTwo = PIC;
OpenPOWER on IntegriCloud