diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -578,20 +578,22 @@ map_iterator(s.end(), toLowerDash)); } -// Has the side-effect of setting Config::platformInfo. -static PlatformType parsePlatformVersion(const ArgList &args) { - const Arg *arg = args.getLastArg(OPT_platform_version); - if (!arg) { - error("must specify -platform_version"); - return PLATFORM_UNKNOWN; - } - +struct PlatformVersion { + PlatformType platform = PLATFORM_UNKNOWN; + llvm::VersionTuple minimum; + llvm::VersionTuple sdk; +}; + +static PlatformVersion parsePlatformVersion(const Arg *arg) { + assert(arg->getOption().getID() == OPT_platform_version); StringRef platformStr = arg->getValue(0); StringRef minVersionStr = arg->getValue(1); StringRef sdkVersionStr = arg->getValue(2); + PlatformVersion platformVersion; + // TODO(compnerd) see if we can generate this case list via XMACROS - PlatformType platform = + platformVersion.platform = StringSwitch(lowerDash(platformStr)) .Cases("macos", "1", PLATFORM_MACOS) .Cases("ios", "2", PLATFORM_IOS) @@ -604,17 +606,52 @@ .Cases("watchos-simulator", "9", PLATFORM_WATCHOSSIMULATOR) .Cases("driverkit", "10", PLATFORM_DRIVERKIT) .Default(PLATFORM_UNKNOWN); - if (platform == PLATFORM_UNKNOWN) + if (platformVersion.platform == PLATFORM_UNKNOWN) error(Twine("malformed platform: ") + platformStr); // TODO: check validity of version strings, which varies by platform // NOTE: ld64 accepts version strings with 5 components // llvm::VersionTuple accepts no more than 4 components // Has Apple ever published version strings with 5 components? - if (config->platformInfo.minimum.tryParse(minVersionStr)) + if (platformVersion.minimum.tryParse(minVersionStr)) error(Twine("malformed minimum version: ") + minVersionStr); - if (config->platformInfo.sdk.tryParse(sdkVersionStr)) + if (platformVersion.sdk.tryParse(sdkVersionStr)) error(Twine("malformed sdk version: ") + sdkVersionStr); - return platform; + return platformVersion; +} + +// Has the side-effect of setting Config::platformInfo. +static PlatformType parsePlatformVersions(const ArgList &args) { + std::map platformVersions; + const PlatformVersion *lastVersionInfo = nullptr; + for (const Arg *arg : args.filtered(OPT_platform_version)) { + PlatformVersion version = parsePlatformVersion(arg); + + // For each platform, the last flag wins: + // `-platform_version macos 2 3 -platform_version macos 4 5` has the same + // effect as just passing `-platform_version macos 4 5`. + // FIXME: ld64 warns on multiple flags for one platform. Should we? + platformVersions[version.platform] = version; + lastVersionInfo = &platformVersions[version.platform]; + } + + if (platformVersions.empty()) { + error("must specify -platform_version"); + return PLATFORM_UNKNOWN; + } + if (platformVersions.size() > 2) { + error("must specify -platform_version at most twice"); + return PLATFORM_UNKNOWN; + } + if (platformVersions.size() == 2) { + // FIXME: If you implement support for this, add a diagnostic if + // outputType is not dylib or bundle -- linkers shouldn't be able to + // write zippered executables. + warn("writing zippered outputs not yet implemented, " + "ignoring all but last -platform_version flag"); + } + config->platformInfo.minimum = lastVersionInfo->minimum; + config->platformInfo.sdk = lastVersionInfo->sdk; + return lastVersionInfo->platform; } // Has the side-effect of setting Config::target. @@ -625,7 +662,7 @@ return nullptr; } - PlatformType platform = parsePlatformVersion(args); + PlatformType platform = parsePlatformVersions(args); config->platformInfo.target = MachO::Target(getArchitectureFromName(archName), platform); diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp --- a/lld/MachO/InputFiles.cpp +++ b/lld/MachO/InputFiles.cpp @@ -116,6 +116,7 @@ const char *hdr = input->mb.getBufferStart(); + // "Zippered" object files can have multiple LC_BUILD_VERSION load commands. std::vector platformInfos; for (auto *cmd : findCommands(hdr, LC_BUILD_VERSION)) { PlatformInfo info; 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 @@ -12,8 +12,8 @@ # RUN: %lld -dylib -arch arm64 -platform_version macOS 10.14 10.15 -o %t/out.dylib %t/test.o -# 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 +# RUN: not %no-arg-lld -dylib -arch arm64 -platform_version iOS 9.0 11.0 \ +# RUN: %t/out.dylib -o /dev/null 2>&1 | FileCheck %s --check-prefix=DYLIB-PLAT # DYLIB-PLAT: {{.*}}out.dylib has platform macOS, which is different 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 @@ -24,7 +24,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15.0 %s -o %t/test_x86.o -# RUN: not %lld %t/test_x86.o -lSystem -arch x86_64 -platform_version iOS 10.0 15.0 \ +# RUN: not %no-arg-lld %t/test_x86.o -lSystem -arch x86_64 -platform_version iOS 10.0 15.0 \ # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=OBJ-PLAT # OBJ-PLAT: {{.*}}test_x86.o has platform macOS, which is different from target platform iOS @@ -38,13 +38,13 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-ios14.0 %s -o %t/test_x86_ios.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-ios14.0-simulator %s -o %t/test_x86_ios_sim.o -# RUN: %lld -dylib -platform_version ios-simulator 14.0.0 14.0.0 %t/test_x86_ios.o -o /dev/null -# RUN: %lld -dylib -platform_version ios 14.0.0 14.0.0 %t/test_x86_ios_sim.o -o /dev/null +# RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 14.0.0 14.0.0 %t/test_x86_ios.o -o /dev/null +# RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios 14.0.0 14.0.0 %t/test_x86_ios_sim.o -o /dev/null -# RUN: not %lld -dylib -platform_version watchos-simulator 14.0.0 14.0.0 %t/test_x86_ios.o \ +# RUN: not %no-arg-lld -dylib -arch x86_64 -platform_version watchos-simulator 14.0.0 14.0.0 %t/test_x86_ios.o \ # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=CROSS-SIM # CROSS-SIM: {{.*}}test_x86_ios.o has platform iOS, which is different from target platform watchOS Simulator -# RUN: not %lld -dylib -platform_version watchos-simulator 14.0.0 14.0.0 %t/test_x86_ios_sim.o \ +# RUN: not %no-arg-lld -dylib -arch x86_64 -platform_version watchos-simulator 14.0.0 14.0.0 %t/test_x86_ios_sim.o \ # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=CROSS-SIM2 # CROSS-SIM2: {{.*}}test_x86_ios_sim.o has platform iOS Simulator, which is different from target platform watchOS Simulator diff --git a/lld/test/MachO/invalid/incompatible-target-tapi.test b/lld/test/MachO/invalid/incompatible-target-tapi.test --- a/lld/test/MachO/invalid/incompatible-target-tapi.test +++ b/lld/test/MachO/invalid/incompatible-target-tapi.test @@ -4,7 +4,7 @@ RUN: echo "" | llvm-mc -filetype=obj -triple=arm64-apple-iossimulator -o %t/arm64-test.o RUN: not %lld -dylib -arch x86_64 %S/Inputs/libincompatible.tbd %t/x86_64-test.o \ RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=ARCH -RUN: not %lld -dylib -arch arm64 -platform_version ios-simulator 14.0 15.0 %t/arm64-test.o \ +RUN: not %no-arg-lld -dylib -arch arm64 -platform_version ios-simulator 14.0 15.0 %t/arm64-test.o \ RUN: %S/Inputs/libincompatible.tbd -o /dev/null 2>&1 | FileCheck %s --check-prefix=PLATFORM ARCH: error: {{.*}}libincompatible.tbd(/usr/lib/libincompatible.dylib) is incompatible with x86_64 (macOS) PLATFORM: error: {{.*}}libincompatible.tbd(/usr/lib/libincompatible.dylib) is incompatible with arm64 (iOS Simulator) diff --git a/lld/test/MachO/lc-build-version.s b/lld/test/MachO/lc-build-version.s --- a/lld/test/MachO/lc-build-version.s +++ b/lld/test/MachO/lc-build-version.s @@ -22,44 +22,44 @@ # MACOS_10_13-NEXT: version 10.13 # MACOS_10_13-NEXT: sdk 10.15 -# RUN: %lld -platform_version ios 12.0 10.15 -o %t.ios_12_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version ios 12.0 10.15 -o %t.ios_12_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.ios_12_0 | FileCheck %s --check-prefix=IOS_12_0 -# RUN: %lld -platform_version ios-simulator 13.0 10.15 -o %t.ios_sim_13_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version ios-simulator 13.0 10.15 -o %t.ios_sim_13_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.ios_sim_13_0 | FileCheck %s --check-prefix=IOS_12_0 # IOS_12_0: cmd LC_BUILD_VERSION -# RUN: %lld -platform_version ios 11.0 10.15 -o %t.ios_11_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version ios 11.0 10.15 -o %t.ios_11_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.ios_11_0 | FileCheck %s --check-prefix=IOS_11_0 -# RUN: %lld -platform_version ios-simulator 12.0 10.15 -o %t.ios_sim_12_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version ios-simulator 12.0 10.15 -o %t.ios_sim_12_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.ios_sim_12_0 | FileCheck %s --check-prefix=IOS_11_0 # IOS_11_0: cmd LC_VERSION_MIN_IPHONEOS -# RUN: %lld -platform_version tvos 12.0 10.15 -o %t.tvos_12_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version tvos 12.0 10.15 -o %t.tvos_12_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.tvos_12_0 | FileCheck %s --check-prefix=TVOS_12_0 -# RUN: %lld -platform_version tvos-simulator 13.0 10.15 -o %t.tvos_sim_13_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version tvos-simulator 13.0 10.15 -o %t.tvos_sim_13_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.tvos_sim_13_0 | FileCheck %s --check-prefix=TVOS_12_0 # TVOS_12_0: cmd LC_BUILD_VERSION -# RUN: %lld -platform_version tvos 11.0 10.15 -o %t.tvos_11_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version tvos 11.0 10.15 -o %t.tvos_11_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.tvos_11_0 | FileCheck %s --check-prefix=TVOS_11_0 -# RUN: %lld -platform_version tvos-simulator 12.0 10.15 -o %t.tvos_sim_12_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version tvos-simulator 12.0 10.15 -o %t.tvos_sim_12_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.tvos_sim_12_0 | FileCheck %s --check-prefix=TVOS_11_0 # TVOS_11_0: cmd LC_VERSION_MIN_TVOS -# RUN: %lld -platform_version watchos 5.0 10.15 -o %t.watchos_5_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version watchos 5.0 10.15 -o %t.watchos_5_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.watchos_5_0 | FileCheck %s --check-prefix=WATCHOS_5_0 -# RUN: %lld -platform_version watchos-simulator 6.0 10.15 -o %t.watchos_sim_6_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version watchos-simulator 6.0 10.15 -o %t.watchos_sim_6_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.watchos_sim_6_0 | FileCheck %s --check-prefix=WATCHOS_5_0 # WATCHOS_5_0: cmd LC_BUILD_VERSION -# RUN: %lld -platform_version watchos 4.0 10.15 -o %t.watchos_4_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version watchos 4.0 10.15 -o %t.watchos_4_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.watchos_4_0 | FileCheck %s --check-prefix=WATCHOS_4_0 -# RUN: %lld -platform_version watchos-simulator 5.0 10.15 -o %t.watchos_sim_5_0 %t.o +# RUN: %no-arg-lld -arch x86_64 -platform_version watchos-simulator 5.0 10.15 -o %t.watchos_sim_5_0 %t.o # RUN: llvm-objdump --macho --all-headers %t.watchos_sim_5_0 | FileCheck %s --check-prefix=WATCHOS_4_0 # WATCHOS_4_0: cmd LC_VERSION_MIN_WATCHOS diff --git a/lld/test/MachO/objc-uses-custom-personality.s b/lld/test/MachO/objc-uses-custom-personality.s --- a/lld/test/MachO/objc-uses-custom-personality.s +++ b/lld/test/MachO/objc-uses-custom-personality.s @@ -5,9 +5,9 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-iossimulator %t/defined.s -o %t/defined.o # RUN: yaml2obj %t/combined.yaml > %t/combined.o # RUN: llvm-ar r %t/pack.a %t/defined.o %t/combined.o -# RUN: %lld -dylib -arch x86_64 -platform_version ios-simulator 12.0.0 15.0 -ObjC %t/pack.a -o %t/a.dylib +# RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 12.0.0 15.0 -ObjC %t/pack.a -o %t/a.dylib # RUN: llvm-objdump --macho --syms %t/a.dylib | FileCheck %s -# RUN: %lld -dylib -arch x86_64 -platform_version ios-simulator 12.0.0 15.0 -ObjC --start-lib %t/defined.o %t/combined.o --end-lib -o %t/a.dylib +# RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 12.0.0 15.0 -ObjC --start-lib %t/defined.o %t/combined.o --end-lib -o %t/a.dylib # RUN: llvm-objdump --macho --syms %t/a.dylib | FileCheck %s # CHECK: SYMBOL TABLE: diff --git a/lld/test/MachO/platform-version.s b/lld/test/MachO/platform-version.s --- a/lld/test/MachO/platform-version.s +++ b/lld/test/MachO/platform-version.s @@ -5,61 +5,74 @@ ### with bad version strings, so we use *-NOT patterns to ensure that ### no "malformed platform" diagnostic appears in those cases. -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version \ # RUN: | FileCheck --check-prefix=FAIL-MISSING %s -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version wtf \ # RUN: | FileCheck --check-prefix=FAIL-MISSING %s -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version lolz 1.2.3.4.5 \ # RUN: | FileCheck --check-prefix=FAIL-MISSING %s # FAIL-MISSING: -platform_version: missing argument # FAIL-MISSING-NOT: malformed platform: {{.*}} # FAIL-MISSING-NOT: malformed {{minimum|sdk}} version: {{.*}} -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version macOS -lfoo 2 \ # RUN: | FileCheck --check-prefix=FAIL-MALFORM %s -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version iOS 1 2.a \ # RUN: | FileCheck --check-prefix=FAIL-MALFORM %s -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version tvOS 1.2.3.4.5 10 \ # RUN: | FileCheck --check-prefix=FAIL-MALFORM %s -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version watchOS 10 1.2.3.4.5 \ # RUN: | FileCheck --check-prefix=FAIL-MALFORM %s # FAIL-MALFORM-NOT: malformed platform: {{.*}} # FAIL-MALFORM: malformed {{minimum|sdk}} version: {{.*}} -# RUN: %lld -o %t %t.o 2>&1 \ +# RUN: %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version bridgeOS 1 5 -# RUN: %lld -o %t %t.o 2>&1 \ +# RUN: %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version "Mac Catalyst" 1.2 5.6 -# RUN: %lld -o %t %t.o 2>&1 \ +# RUN: %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version "iOS Simulator" 1.2.3 5.6.7 -# RUN: %lld -o %t %t.o 2>&1 \ +# RUN: %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version tvOS-Simulator 1.2.3.4 5.6.7.8 -# RUN: %lld -o %t %t.o 2>&1 \ +# RUN: %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version watchOS-Simulator 1 5 -# RUN: %lld -o %t %t.o 2>&1 \ +# RUN: %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version 1 1 5 -# RUN: %lld -o %t %t.o 2>&1 \ +# RUN: %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version 9 1 5 -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version wtf 1 5 \ # RUN: | FileCheck --check-prefix=FAIL-PLATFORM %s -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version 0 1 5 \ # RUN: | FileCheck --check-prefix=FAIL-PLATFORM %s -# RUN: not %lld -o %t %t.o 2>&1 \ +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ # RUN: -platform_version 11 1 5 \ # RUN: | FileCheck --check-prefix=FAIL-PLATFORM %s # FAIL-PLATFORM: malformed platform: {{.*}} # FAIL-PLATFORM-NOT: malformed {{minimum|sdk}} version: {{.*}} +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o -fatal_warnings 2>&1 \ +# RUN: -platform_version 'mac catalyst' 14.0 15.0 \ +# RUN: -platform_version macos 12.0 12.0 \ +# RUN: | FileCheck --check-prefix=FAIL-TODO %s +# FAIL-TODO: writing zippered outputs not yet implemented, ignoring all but last -platform_version flag + +# RUN: not %no-arg-lld -arch x86_64 -o %t %t.o 2>&1 \ +# RUN: -platform_version bridgeOS 1 5 \ +# RUN: -platform_version 'mac catalyst' 14.0 15.0 \ +# RUN: -platform_version macos 12.0 12.0 \ +# RUN: | FileCheck --check-prefix=FAIL-TOOMANY %s +# FAIL-TOOMANY: must specify -platform_version at most twice + .text .global _main _main: diff --git a/lld/test/MachO/tapi-link-by-arch.s b/lld/test/MachO/tapi-link-by-arch.s --- a/lld/test/MachO/tapi-link-by-arch.s +++ b/lld/test/MachO/tapi-link-by-arch.s @@ -2,15 +2,15 @@ # RUN: mkdir -p %t # RUN: llvm-mc -filetype obj -triple arm64-apple-ios14.4 %s -o %t/arm64-ios.o -# RUN: not %lld -dylib -arch arm64 -platform_version ios 14.4 15.0 -o /dev/null \ +# RUN: not %no-arg-lld -dylib -arch arm64 -platform_version ios 14.4 15.0 -o /dev/null \ # RUN: -lSystem %S/Inputs/libStubLink.tbd %t/arm64-ios.o 2>&1 | FileCheck %s # RUN: llvm-mc -filetype obj -triple x86_64-apple-iossimulator14.4 %s -o %t/x86_64-sim.o -# RUN: not %lld -dylib -arch x86_64 -platform_version ios-simulator 14.4 15.0 -o /dev/null \ +# RUN: not %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 14.4 15.0 -o /dev/null \ # RUN: -lSystem %S/Inputs/libStubLink.tbd %t/x86_64-sim.o 2>&1 | FileCheck %s # RUN: llvm-mc -filetype obj -triple arm64-apple-iossimulator14.4 %s -o %t/arm64-sim.o -# RUN: %lld -dylib -arch arm64 -platform_version ios-simulator 14.4 15.0 -o \ +# RUN: %no-arg-lld -dylib -arch arm64 -platform_version ios-simulator 14.4 15.0 -o \ # RUN: /dev/null %S/Inputs/libStubLink.tbd %t/arm64-sim.o # CHECK: error: undefined symbol: _arm64_sim_only diff --git a/lld/test/MachO/zippered.yaml b/lld/test/MachO/zippered.yaml --- a/lld/test/MachO/zippered.yaml +++ b/lld/test/MachO/zippered.yaml @@ -6,9 +6,9 @@ # RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-ios13.15.0 -o %t/test_ios.o # RUN: %lld -lSystem -dylib %t/test.dylib %t/test_macos.o -o /dev/null -# RUN: %lld -lSystem -dylib -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_maccatalyst.o -o /dev/null +# RUN: %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_maccatalyst.o -o /dev/null -# RUN: not %lld -lSystem -dylib -platform_version ios 13.15.0 14.0 %t/test.dylib %t/test_ios.o -o /dev/null 2>&1 | FileCheck %s +# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version ios 13.15.0 14.0 %t/test.dylib %t/test_ios.o -o /dev/null 2>&1 | FileCheck %s # CHECK: test.dylib has platform macOS/macCatalyst, which is different from target platform iOS --- !mach-o