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 | 9ff2d7d56ace40c1b2fc15a9ae41e4fda04cbbcb (patch) | |
| tree | c007fbe1b209a52ed00ba615968126b3512ecc0b /clang/lib | |
| parent | c53d36847ebd354c46e335198d03334825eeb7fc (diff) | |
| download | bcm5719-llvm-9ff2d7d56ace40c1b2fc15a9ae41e4fda04cbbcb.tar.gz bcm5719-llvm-9ff2d7d56ace40c1b2fc15a9ae41e4fda04cbbcb.zip | |
[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.
llvm-svn: 339829
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Driver/ToolChains/Darwin.cpp | 19 | ||||
| -rw-r--r-- | clang/lib/Driver/ToolChains/Darwin.h | 6 |
2 files changed, 16 insertions, 9 deletions
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp index 6c8bba57644..5971a0ae447 100644 --- a/clang/lib/Driver/ToolChains/Darwin.cpp +++ b/clang/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"); } diff --git a/clang/lib/Driver/ToolChains/Darwin.h b/clang/lib/Driver/ToolChains/Darwin.h index 98ad7431919..73c4ac6aeca 100644 --- a/clang/lib/Driver/ToolChains/Darwin.h +++ b/clang/lib/Driver/ToolChains/Darwin.h @@ -252,7 +252,9 @@ public: return llvm::ExceptionHandling::None; } - virtual StringRef getOSLibraryNameSuffix() const { return ""; } + virtual StringRef getOSLibraryNameSuffix(bool IgnoreSim = false) const { + return ""; + } /// } }; @@ -420,7 +422,7 @@ protected: Action::OffloadKind DeviceOffloadKind) const override; StringRef getPlatformFamily() const; - StringRef getOSLibraryNameSuffix() const override; + StringRef getOSLibraryNameSuffix(bool IgnoreSim = false) const override; public: static StringRef getSDKName(StringRef isysroot); |

