@@ -548,20 +548,19 @@ static void handlePlatformVersion(const opt::Arg *arg) {
548
548
549
549
// TODO(compnerd) see if we can generate this case list via XMACROS
550
550
config->platform .kind =
551
- llvm::StringSwitch<llvm::MachO::PlatformKind>(lowerDash (platformStr))
552
- .Cases (" macos" , " 1" , llvm::MachO::PlatformKind::macOS)
553
- .Cases (" ios" , " 2" , llvm::MachO::PlatformKind::iOS)
554
- .Cases (" tvos" , " 3" , llvm::MachO::PlatformKind::tvOS)
555
- .Cases (" watchos" , " 4" , llvm::MachO::PlatformKind::watchOS)
556
- .Cases (" bridgeos" , " 5" , llvm::MachO::PlatformKind::bridgeOS)
557
- .Cases (" mac-catalyst" , " 6" , llvm::MachO::PlatformKind::macCatalyst)
558
- .Cases (" ios-simulator" , " 7" , llvm::MachO::PlatformKind::iOSSimulator)
559
- .Cases (" tvos-simulator" , " 8" ,
560
- llvm::MachO::PlatformKind::tvOSSimulator)
561
- .Cases (" watchos-simulator" , " 9" ,
562
- llvm::MachO::PlatformKind::watchOSSimulator)
563
- .Default (llvm::MachO::PlatformKind::unknown);
564
- if (config->platform .kind == llvm::MachO::PlatformKind::unknown)
551
+ StringSwitch<PlatformKind>(lowerDash (platformStr))
552
+ .Cases (" macos" , " 1" , PlatformKind::macOS)
553
+ .Cases (" ios" , " 2" , PlatformKind::iOS)
554
+ .Cases (" tvos" , " 3" , PlatformKind::tvOS)
555
+ .Cases (" watchos" , " 4" , PlatformKind::watchOS)
556
+ .Cases (" bridgeos" , " 5" , PlatformKind::bridgeOS)
557
+ .Cases (" mac-catalyst" , " 6" , PlatformKind::macCatalyst)
558
+ .Cases (" ios-simulator" , " 7" , PlatformKind::iOSSimulator)
559
+ .Cases (" tvos-simulator" , " 8" , PlatformKind::tvOSSimulator)
560
+ .Cases (" watchos-simulator" , " 9" , PlatformKind::watchOSSimulator)
561
+ .Cases (" driverkit" , " 10" , PlatformKind::driverKit)
562
+ .Default (PlatformKind::unknown);
563
+ if (config->platform .kind == PlatformKind::unknown)
565
564
error (Twine (" malformed platform: " ) + platformStr);
566
565
// TODO: check validity of version strings, which varies by platform
567
566
// NOTE: ld64 accepts version strings with 5 components
@@ -637,10 +636,14 @@ static bool isPie(opt::InputArgList &args) {
637
636
// to PIE from 10.7, arm64 should always be PIE, etc
638
637
assert (config->arch == AK_x86_64 || config->arch == AK_x86_64h);
639
638
640
- if (config->platform .kind == MachO::PlatformKind::macOS &&
639
+ PlatformKind kind = config->platform .kind ;
640
+ if (kind == PlatformKind::macOS &&
641
641
config->platform .minimum >= VersionTuple (10 , 6 ))
642
642
return true ;
643
643
644
+ if (kind == PlatformKind::iOSSimulator || kind == PlatformKind::driverKit)
645
+ return true ;
646
+
644
647
return args.hasArg (OPT_pie);
645
648
}
646
649
0 commit comments