diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp --- a/lld/MachO/InputFiles.cpp +++ b/lld/MachO/InputFiles.cpp @@ -178,13 +178,12 @@ return false; } - if (it->minimum <= config->platformInfo.minimum) - return true; + if (it->minimum > config->platformInfo.minimum) + warn(toString(input) + " has version " + it->minimum.getAsString() + + ", which is newer than target minimum of " + + config->platformInfo.minimum.getAsString()); - error(toString(input) + " has version " + it->minimum.getAsString() + - ", which is newer than target minimum of " + - config->platformInfo.minimum.getAsString()); - return false; + return true; } // Open a given file path and return it as a memory-mapped file. diff --git a/lld/test/MachO/invalid/incompatible-arch.s b/lld/test/MachO/invalid/incompatible-arch.s --- a/lld/test/MachO/invalid/incompatible-arch.s +++ b/lld/test/MachO/invalid/incompatible-arch.s @@ -14,9 +14,9 @@ # RUN: %lld -lSystem -dylib -arch arm64 -platform_version macOS 10.14.0 10.15.0 %t/out.dylib -o /dev/null -# RUN: not %lld -lSystem -dylib -arch arm64 -platform_version macOS 10.13.0 10.15.0 %t/out.dylib \ +# RUN: %no_fatal_warnings_lld -lSystem -dylib -arch arm64 -platform_version macOS 10.13.0 10.15.0 %t/out.dylib \ # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=DYLIB-VERSION -# DYLIB-VERSION: {{.*}}out.dylib has version 10.14.0, which is newer than target minimum of 10.13.0 +# DYLIB-VERSION: warning: {{.*}}out.dylib has version 10.14.0, which is newer than target minimum of 10.13.0 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15.0 %s -o %t/test_x86.o @@ -26,9 +26,9 @@ # RUN: %lld %t/test_x86.o -lSystem -arch x86_64 -platform_version macOS 10.15.0 10.15.0 -o /dev/null -# RUN: not %lld %t/test_x86.o -lSystem -arch x86_64 -platform_version macOS 10.14.0 10.15.0 \ +# RUN: %no_fatal_warnings_lld %t/test_x86.o -lSystem -arch x86_64 -platform_version macOS 10.14.0 10.15.0 \ # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=OBJ-VERSION -# OBJ-VERSION: {{.*}}test_x86.o has version 10.15.0, which is newer than target minimum of 10.14.0 +# OBJ-VERSION: warning: {{.*}}test_x86.o has version 10.15.0, which is newer than target minimum of 10.14.0 ## Test that simulators platforms are compat with their simulatees. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-ios14.0 %s -o %t/test_x86_ios.o