diff options
author | Chris Bieneman <chris.bieneman@me.com> | 2018-08-15 22:50:06 +0000 |
---|---|---|
committer | Chris Bieneman <chris.bieneman@me.com> | 2018-08-15 22:50:06 +0000 |
commit | 0603ce8ab13aa43b7a35f54e4177502fd648c39a (patch) | |
tree | 786462615f08fca00867eca0e348bd46fa3f6ad5 /lib/Driver/ToolChains/Darwin.cpp | |
parent | b8bf4263674baa6b5fa506c28661e429a660d0e2 (diff) |
[Darwin Driver] Fix Simulator builtins and test cases
In r339807, I broke linking the builtins libraries for simulator targets, which itself was bad, but turns out it was all completely untested and marked with FIXME in the test suite.
This fixes all the test cases so they actually work, and fixes the bug I introduced in r339807.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339829 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains/Darwin.cpp')
-rw-r--r-- | lib/Driver/ToolChains/Darwin.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/Driver/ToolChains/Darwin.cpp b/lib/Driver/ToolChains/Darwin.cpp index 6c8bba5764..5971a0ae44 100644 --- a/lib/Driver/ToolChains/Darwin.cpp +++ b/lib/Driver/ToolChains/Darwin.cpp @@ -916,8 +916,10 @@ void MachO::AddLinkRuntimeLib(const ArgList &Args, ArgStringList &CmdArgs, DarwinLibName += Component; if (!(Opts & RLO_IsEmbedded)) DarwinLibName += "_"; - } - DarwinLibName += getOSLibraryNameSuffix(); + DarwinLibName += getOSLibraryNameSuffix(); + } else + DarwinLibName += getOSLibraryNameSuffix(true); + DarwinLibName += IsShared ? "_dynamic.dylib" : ".a"; SmallString<128> Dir(getDriver().ResourceDir); llvm::sys::path::append( @@ -983,16 +985,19 @@ StringRef Darwin::getSDKName(StringRef isysroot) { return ""; } -StringRef Darwin::getOSLibraryNameSuffix() const { - switch(TargetPlatform) { +StringRef Darwin::getOSLibraryNameSuffix(bool IgnoreSim) const { + switch (TargetPlatform) { case DarwinPlatformKind::MacOS: return "osx"; case DarwinPlatformKind::IPhoneOS: - return TargetEnvironment == NativeEnvironment ? "ios" : "iossim"; + return TargetEnvironment == NativeEnvironment || IgnoreSim ? "ios" + : "iossim"; case DarwinPlatformKind::TvOS: - return TargetEnvironment == NativeEnvironment ? "tvos" : "tvossim"; + return TargetEnvironment == NativeEnvironment || IgnoreSim ? "tvos" + : "tvossim"; case DarwinPlatformKind::WatchOS: - return TargetEnvironment == NativeEnvironment ? "watchos" : "watchossim"; + return TargetEnvironment == NativeEnvironment || IgnoreSim ? "watchos" + : "watchossim"; } llvm_unreachable("Unsupported platform"); } |