[lld] 75ecb80 - Revert "[lld-macho] Fix min version check"

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 16:07:47 PDT 2021


Author: Jez Ng
Date: 2021-04-22T19:07:41-04:00
New Revision: 75ecb804b11f9efc806310ce7b00cdb45d09e090

URL: https://github.com/llvm/llvm-project/commit/75ecb804b11f9efc806310ce7b00cdb45d09e090
DIFF: https://github.com/llvm/llvm-project/commit/75ecb804b11f9efc806310ce7b00cdb45d09e090.diff

LOG: Revert "[lld-macho] Fix min version check"

This reverts commit aa05439c9cde873ba18ae847ac7c23877178a9ca.

Added: 
    

Modified: 
    lld/MachO/InputFiles.cpp
    lld/test/MachO/invalid/incompatible-arch.s

Removed: 
    


################################################################################
diff  --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp
index b6a776d5ce09a..7c1b3e1cd77d6 100644
--- a/lld/MachO/InputFiles.cpp
+++ b/lld/MachO/InputFiles.cpp
@@ -153,11 +153,11 @@ template <class LP> static bool checkCompatibility(const InputFile *input) {
           getPlatformName(config->platform()));
     return false;
   }
-  if (platformInfo->minimum <= config->platformInfo.minimum)
+  if (platformInfo->minimum >= config->platformInfo.minimum)
     return true;
   error(toString(input) + " has version " +
         platformInfo->minimum.getAsString() +
-        ", which is newer than target minimum of " +
+        ", which is incompatible with target version of " +
         config->platformInfo.minimum.getAsString());
   return false;
 }

diff  --git a/lld/test/MachO/invalid/incompatible-arch.s b/lld/test/MachO/invalid/incompatible-arch.s
index 9a776bf56219d..2bd96cbabf14a 100644
--- a/lld/test/MachO/invalid/incompatible-arch.s
+++ b/lld/test/MachO/invalid/incompatible-arch.s
@@ -6,17 +6,15 @@
 # RUN: not %lld -arch x86_64 -lSystem %t/test.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t/test.o
 # CHECK: error: {{.*}}[[FILE]] has architecture arm64 which is incompatible with target architecture x86_64
 
-# RUN: %lld -dylib -arch arm64 -platform_version macOS 10.14 10.15 -o %t/out.dylib %t/test.o
+# RUN: %lld -dylib  -arch arm64 -platform_version macOS 9.0 11.0 -o %t/out.dylib %t/test.o
 
-# RUN: not %lld -dylib -arch arm64 -platform_version iOS 9.0 11.0 %t/out.dylib \
+# RUN: not %lld -dylib -arch arm64 -platform_version iOS 9.0 11.0  %t/out.dylib  \
 # RUN:  -o /dev/null 2>&1 | FileCheck %s --check-prefix=DYLIB-PLAT
 # DYLIB-PLAT: {{.*}}out.dylib has platform macOS, which is 
diff erent from target platform iOS
 
-# 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: not %lld -dylib -arch arm64 -platform_version macOS 14.0 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: {{.*}}out.dylib has version 9.0.0, which is incompatible with target version of 14.0
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15.0 %s -o %t/test_x86.o
 
@@ -24,11 +22,9 @@
 # RUN:  -o /dev/null 2>&1 | FileCheck %s --check-prefix=OBJ-PLAT
 # OBJ-PLAT: {{.*}}test_x86.o has platform macOS, which is 
diff erent from target platform iOS
 
-# 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: not %lld %t/test_x86.o -lSystem -arch x86_64 -platform_version macOS 14.0 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: {{.*}}test_x86.o has version 10.15.0, which is incompatible with target version of 14.0
 
 .globl _main
 _main:


        


More information about the llvm-commits mailing list