diff --git a/driver/main.cpp b/driver/main.cpp index d94bd1eda98..001a6aa0799 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -741,6 +741,7 @@ static void registerPredefinedTargetVersions() { VersionCondition::addPredefinedGlobalIdent("Posix"); break; case llvm::Triple::Darwin: + case llvm::Triple::MacOSX: VersionCondition::addPredefinedGlobalIdent("OSX"); VersionCondition::addPredefinedGlobalIdent( "darwin"); // For backwards compatibility. diff --git a/driver/targetmachine.cpp b/driver/targetmachine.cpp index 9e55fad87a0..3a0c1ef92c4 100644 --- a/driver/targetmachine.cpp +++ b/driver/targetmachine.cpp @@ -420,6 +420,11 @@ llvm::TargetMachine *createTargetMachine( if (targetTriple.empty()) { triple = llvm::Triple(llvm::sys::getDefaultTargetTriple()); + // We only support OSX, so darwin should really be macosx. + if (triple.getOS() == llvm::Triple::Darwin) { + triple.setOS(llvm::Triple::MacOSX); + } + // Handle -m32/-m64. if (sizeof(void *) == 4 && bitness == ExplicitBitness::M64) { triple = triple.get64BitArchVariant();