Loading...
--- dyld/dyld-1284.13/mach_o/Platform.cpp
+++ dyld/dyld-1235.2/mach_o/Platform.cpp
@@ -92,7 +92,6 @@
//
constinit const Platform::Epoch Platform::Epoch::invalid(0);
-constinit const Platform::Epoch Platform::Epoch::fall2012(2012);
constinit const Platform::Epoch Platform::Epoch::fall2015(2015);
constinit const Platform::Epoch Platform::Epoch::fall2016(2016);
constinit const Platform::Epoch Platform::Epoch::fall2017(2017);
@@ -106,8 +105,6 @@
constinit const Platform::Epoch Platform::Epoch::fall2023(2023);
constinit const Platform::Epoch Platform::Epoch::spring2024(2024, true);
constinit const Platform::Epoch Platform::Epoch::fall2024(2024);
-constinit const Platform::Epoch Platform::Epoch::spring2025(2025, true);
-constinit const Platform::Epoch Platform::Epoch::fall2025(2025);
@@ -124,19 +121,17 @@
class VIS_HIDDEN PlatformInfo
{
public:
- consteval PlatformInfo(uint32_t v, CString nm, bool isSim, bool fp, uint16_t year, const PlatformInfo* info, CString altName = {})
- : basePlatformInfo(info), name(nm), altName(altName), value(v), baseYear(year), isSimulator(isSim), supportsFairPlayEncryption(fp) { }
-
- const PlatformInfo* basePlatformInfo;
+ consteval PlatformInfo(uint32_t v, CString nm, bool isSim, bool fp, uint16_t year, CString altName = {})
+ : value(v), name(nm), altName(altName), isSimulator(isSim),supportsFairPlayEncryption(fp), baseYear(year) { }
+
+ uint32_t value;
CString name;
CString altName;
- uint32_t value;
- uint16_t baseYear; // year 1.0 shipped
bool isSimulator;
bool isExclaveCore=false;
bool isExclaveKit=false;
bool supportsFairPlayEncryption;
-
+ uint16_t baseYear; // year 1.0 shipped
// Epoch is private to Platform and PlatformInfo, so convert to year/spring of use by subclasses
Version32 versionForEpoch(Platform::Epoch e) const {
@@ -213,7 +208,7 @@
class VIS_HIDDEN PlatformInfo_macOS : public PlatformInfo
{
public:
- consteval PlatformInfo_macOS() : PlatformInfo(PLATFORM_MACOS, "macOS", false, false, 2009, &PlatformInfo_macOS::singleton, "macOSX") { }
+ consteval PlatformInfo_macOS() : PlatformInfo(PLATFORM_MACOS, "macOS", false, false, 2009, "macOSX") { }
Version32 versionForYear(uint16_t year, bool spring) const override {
if ( (year > 2020) || ((year ==2020) && !spring) )
@@ -241,8 +236,7 @@
static const PlatformInfo_macOS singleton;
protected:
- consteval PlatformInfo_macOS(uint32_t v, CString nm, bool isSim, const PlatformInfo* info = &PlatformInfo_macOS::singleton)
- : PlatformInfo(v, nm, isSim, false, 2009, info) { }
+ consteval PlatformInfo_macOS(uint32_t v, CString nm, bool isSim) : PlatformInfo(v, nm, isSim, false, 2009) { }
};
const PlatformInfo_macOS PlatformInfo_macOS::singleton;
@@ -250,12 +244,11 @@
class VIS_HIDDEN PlatformInfo_iOS : public PlatformInfo
{
public:
- consteval PlatformInfo_iOS() : PlatformInfo(PLATFORM_IOS, "iOS", false, true, 2006, &PlatformInfo_iOS::singleton) { }
+ consteval PlatformInfo_iOS() : PlatformInfo(PLATFORM_IOS, "iOS", false, true, 2006) { }
static const PlatformInfo_iOS singleton;
protected:
- consteval PlatformInfo_iOS(uint32_t v, CString nm, bool isSim, const PlatformInfo* info = &PlatformInfo_iOS::singleton, CString altName = {})
- : PlatformInfo(v, nm, isSim, !isSim, 2006, info, altName) { }
+ consteval PlatformInfo_iOS(uint32_t v, CString nm, bool isSim, CString altName = {}) : PlatformInfo(v, nm, isSim, !isSim, 2006, altName) { }
};
const PlatformInfo_iOS PlatformInfo_iOS::singleton;
@@ -275,21 +268,20 @@
class VIS_HIDDEN PlatformInfo_tvOS : public PlatformInfo_iOS
{
public:
- consteval PlatformInfo_tvOS() : PlatformInfo_iOS(PLATFORM_TVOS, "tvOS", false, &PlatformInfo_tvOS::singleton) { }
+ consteval PlatformInfo_tvOS() : PlatformInfo_iOS(PLATFORM_TVOS, "tvOS", false) { }
static const PlatformInfo_tvOS singleton;
protected:
- consteval PlatformInfo_tvOS(uint32_t v, CString nm, bool isSim, const PlatformInfo* info = &PlatformInfo_tvOS::singleton)
- : PlatformInfo_iOS(v, nm, isSim, info) { }
+ consteval PlatformInfo_tvOS(uint32_t v, CString nm, bool isSim) : PlatformInfo_iOS(v, nm, isSim) { }
};
const PlatformInfo_tvOS PlatformInfo_tvOS::singleton;
-// tvOS_simulator uses same versioning as tvOS
-class VIS_HIDDEN PlatformInfo_tvOS_simulator : public PlatformInfo_tvOS
-{
-public:
- consteval PlatformInfo_tvOS_simulator() : PlatformInfo_tvOS(PLATFORM_TVOSSIMULATOR, "tvOS-simulator", true) { }
+// tvOS_simulator uses same versioning as iOS
+class VIS_HIDDEN PlatformInfo_tvOS_simulator : public PlatformInfo_iOS
+{
+public:
+ consteval PlatformInfo_tvOS_simulator() : PlatformInfo_iOS(PLATFORM_TVOSSIMULATOR, "tvOS-simulator", true) { }
static const PlatformInfo_tvOS_simulator singleton;
};
@@ -302,7 +294,7 @@
class VIS_HIDDEN PlatformInfo_macCatalyst : public PlatformInfo_iOS
{
public:
- consteval PlatformInfo_macCatalyst() : PlatformInfo_iOS(PLATFORM_MACCATALYST, "macCatalyst", false, &PlatformInfo_iOS::singleton, "Mac Catalyst") {
+ consteval PlatformInfo_macCatalyst() : PlatformInfo_iOS(PLATFORM_MACCATALYST, "macCatalyst", false, "Mac Catalyst") {
supportsFairPlayEncryption = false;
}
@@ -323,12 +315,11 @@
class VIS_HIDDEN PlatformInfo_watchOS : public PlatformInfo
{
public:
- consteval PlatformInfo_watchOS() : PlatformInfo(PLATFORM_WATCHOS, "watchOS", false, true, 2013, &PlatformInfo_watchOS::singleton) { }
+ consteval PlatformInfo_watchOS() : PlatformInfo(PLATFORM_WATCHOS, "watchOS", false, true, 2013) { }
static const PlatformInfo_watchOS singleton;
protected:
- consteval PlatformInfo_watchOS(uint32_t v, CString nm, bool isSim, const PlatformInfo* info = &PlatformInfo_watchOS::singleton)
- : PlatformInfo(v, nm, isSim, !isSim, 2013, info) { }
+ consteval PlatformInfo_watchOS(uint32_t v, CString nm, bool isSim) : PlatformInfo(v, nm, isSim, !isSim, 2013) { }
};
const PlatformInfo_watchOS PlatformInfo_watchOS::singleton;
@@ -347,7 +338,7 @@
class VIS_HIDDEN PlatformInfo_bridgeOS : public PlatformInfo
{
public:
- consteval PlatformInfo_bridgeOS() : PlatformInfo(PLATFORM_BRIDGEOS, "bridgeOS", false, false, 2015, &PlatformInfo_bridgeOS::singleton) { }
+ consteval PlatformInfo_bridgeOS() : PlatformInfo(PLATFORM_BRIDGEOS, "bridgeOS", false, false, 2015) { }
uint16_t minorVersionForSpring(uint16_t major) const override {
// The past 2 releases have been 7.3 and 8.3, so assume that pattern for those releases.
@@ -361,7 +352,7 @@
static const PlatformInfo_bridgeOS singleton;
protected:
- consteval PlatformInfo_bridgeOS(uint32_t v, CString nm) : PlatformInfo(v, nm, false, false, 2015, &PlatformInfo_bridgeOS::singleton) { }
+ consteval PlatformInfo_bridgeOS(uint32_t v, CString nm) : PlatformInfo(v, nm, false, false, 2015) { }
};
const PlatformInfo_bridgeOS PlatformInfo_bridgeOS::singleton;
@@ -370,7 +361,7 @@
class VIS_HIDDEN PlatformInfo_driverKit : public PlatformInfo
{
public:
- consteval PlatformInfo_driverKit() : PlatformInfo(PLATFORM_DRIVERKIT, "driverKit", false, true, 2000, &PlatformInfo_driverKit::singleton) { }
+ consteval PlatformInfo_driverKit() : PlatformInfo(PLATFORM_DRIVERKIT, "driverKit", false, true, 2000) { }
static const PlatformInfo_driverKit singleton;
};
@@ -381,7 +372,7 @@
class VIS_HIDDEN PlatformInfo_firmware : public PlatformInfo
{
public:
- consteval PlatformInfo_firmware() : PlatformInfo(PLATFORM_FIRMWARE, "firmware", false, false, 0, &PlatformInfo_firmware::singleton, "free standing") { }
+ consteval PlatformInfo_firmware() : PlatformInfo(PLATFORM_FIRMWARE, "firmware", false, false, 0, "free standing") { }
Version32 versionForYear(uint16_t year, bool spring) const override {
return Version32(1,0);
@@ -400,7 +391,7 @@
class VIS_HIDDEN PlatformInfo_sepOS : public PlatformInfo
{
public:
- consteval PlatformInfo_sepOS() : PlatformInfo(PLATFORM_SEPOS, "sepOS", false, false, 0, &PlatformInfo_sepOS::singleton) { }
+ consteval PlatformInfo_sepOS() : PlatformInfo(PLATFORM_SEPOS, "sepOS", false, false, 0) { }
Version32 versionForYear(uint16_t year, bool spring) const override {
return Version32(1,0);
@@ -418,7 +409,7 @@
class VIS_HIDDEN PlatformInfo_macOS_exclaveCore : public PlatformInfo_macOS
{
public:
- consteval PlatformInfo_macOS_exclaveCore() : PlatformInfo_macOS(PLATFORM_MACOS_EXCLAVECORE, "macOS-exclaveCore", false, &PlatformInfo_macOS_exclaveCore::singleton)
+ consteval PlatformInfo_macOS_exclaveCore() : PlatformInfo_macOS(PLATFORM_MACOS_EXCLAVECORE, "macOS-exclaveCore", false)
{
isExclaveCore = true;
}
@@ -431,7 +422,7 @@
class VIS_HIDDEN PlatformInfo_macOS_exclaveKit : public PlatformInfo_macOS
{
public:
- consteval PlatformInfo_macOS_exclaveKit() : PlatformInfo_macOS(PLATFORM_MACOS_EXCLAVEKIT, "macOS-exclaveKit", false, &PlatformInfo_macOS_exclaveKit::singleton)
+ consteval PlatformInfo_macOS_exclaveKit() : PlatformInfo_macOS(PLATFORM_MACOS_EXCLAVEKIT, "macOS-exclaveKit", false)
{
isExclaveKit = true;
}
@@ -445,7 +436,7 @@
class VIS_HIDDEN PlatformInfo_iOS_exclaveCore : public PlatformInfo_iOS
{
public:
- consteval PlatformInfo_iOS_exclaveCore() : PlatformInfo_iOS(PLATFORM_IOS_EXCLAVECORE, "iOS-exclaveCore", false, &PlatformInfo_iOS_exclaveCore::singleton)
+ consteval PlatformInfo_iOS_exclaveCore() : PlatformInfo_iOS(PLATFORM_IOS_EXCLAVECORE, "iOS-exclaveCore", false)
{
supportsFairPlayEncryption = false;
isExclaveCore = true;
@@ -459,7 +450,7 @@
class VIS_HIDDEN PlatformInfo_iOS_exclaveKit : public PlatformInfo_iOS
{
public:
- consteval PlatformInfo_iOS_exclaveKit() : PlatformInfo_iOS(PLATFORM_IOS_EXCLAVEKIT, "iOS-exclaveKit", false, &PlatformInfo_iOS_exclaveKit::singleton)
+ consteval PlatformInfo_iOS_exclaveKit() : PlatformInfo_iOS(PLATFORM_IOS_EXCLAVEKIT, "iOS-exclaveKit", false)
{
supportsFairPlayEncryption = false;
isExclaveKit = true;
@@ -474,7 +465,7 @@
class VIS_HIDDEN PlatformInfo_tvOS_exclaveCore : public PlatformInfo_tvOS
{
public:
- consteval PlatformInfo_tvOS_exclaveCore() : PlatformInfo_tvOS(PLATFORM_TVOS_EXCLAVECORE, "tvOS-exclaveCore", false, &PlatformInfo_tvOS_exclaveCore::singleton)
+ consteval PlatformInfo_tvOS_exclaveCore() : PlatformInfo_tvOS(PLATFORM_TVOS_EXCLAVECORE, "tvOS-exclaveCore", false)
{
supportsFairPlayEncryption = false;
isExclaveCore = true;
@@ -488,7 +479,7 @@
class VIS_HIDDEN PlatformInfo_tvOS_exclaveKit : public PlatformInfo_tvOS
{
public:
- consteval PlatformInfo_tvOS_exclaveKit() : PlatformInfo_tvOS(PLATFORM_TVOS_EXCLAVEKIT, "tvOS-exclaveKit", false, &PlatformInfo_tvOS_exclaveKit::singleton)
+ consteval PlatformInfo_tvOS_exclaveKit() : PlatformInfo_tvOS(PLATFORM_TVOS_EXCLAVEKIT, "tvOS-exclaveKit", false)
{
supportsFairPlayEncryption = false;
isExclaveKit = true;
@@ -503,7 +494,7 @@
class VIS_HIDDEN PlatformInfo_watchOS_exclaveCore : public PlatformInfo_watchOS
{
public:
- consteval PlatformInfo_watchOS_exclaveCore() : PlatformInfo_watchOS(PLATFORM_WATCHOS_EXCLAVECORE, "watchOS-exclaveCore", false, &PlatformInfo_watchOS_exclaveCore::singleton)
+ consteval PlatformInfo_watchOS_exclaveCore() : PlatformInfo_watchOS(PLATFORM_WATCHOS_EXCLAVECORE, "watchOS-exclaveCore", false)
{
supportsFairPlayEncryption = false;
isExclaveCore = true;
@@ -517,7 +508,7 @@
class VIS_HIDDEN PlatformInfo_watchOS_exclaveKit : public PlatformInfo_watchOS
{
public:
- consteval PlatformInfo_watchOS_exclaveKit() : PlatformInfo_watchOS(PLATFORM_WATCHOS_EXCLAVEKIT, "watchOS-exclaveKit", false, &PlatformInfo_watchOS_exclaveKit::singleton)
+ consteval PlatformInfo_watchOS_exclaveKit() : PlatformInfo_watchOS(PLATFORM_WATCHOS_EXCLAVEKIT, "watchOS-exclaveKit", false)
{
supportsFairPlayEncryption = false;
isExclaveKit = true;
@@ -530,7 +521,7 @@
class VIS_HIDDEN PlatformInfo_visionOS : public PlatformInfo
{
public:
- consteval PlatformInfo_visionOS() : PlatformInfo(PLATFORM_VISIONOS, "visionOS", false, true, 2022, &PlatformInfo_visionOS::singleton, "xrOS") {}
+ consteval PlatformInfo_visionOS() : PlatformInfo(PLATFORM_VISIONOS, "visionOS", false, true, 2022, "xrOS") {}
uint16_t minorVersionForSpring(uint16_t major) const override {
// The first spring release is 1.1
@@ -544,14 +535,14 @@
static const PlatformInfo_visionOS singleton;
protected:
- consteval PlatformInfo_visionOS(uint32_t v, CString nm, bool isSim, const PlatformInfo* info = &PlatformInfo_visionOS::singleton, CString altName = {}) : PlatformInfo(v, nm, isSim, !isSim, 2022, info, altName) { }
+ consteval PlatformInfo_visionOS(uint32_t v, CString nm, bool isSim, CString altName = {}) : PlatformInfo(v, nm, isSim, !isSim, 2022, altName) { }
};
const PlatformInfo_visionOS PlatformInfo_visionOS::singleton;
class VIS_HIDDEN PlatformInfo_visionOS_simulator : public PlatformInfo_visionOS
{
public:
- consteval PlatformInfo_visionOS_simulator() : PlatformInfo_visionOS(PLATFORM_VISIONOSSIMULATOR, "visionOS-simulator", true, &PlatformInfo_visionOS::singleton, "xrOS-simulator") { }
+ consteval PlatformInfo_visionOS_simulator() : PlatformInfo_visionOS(PLATFORM_VISIONOSSIMULATOR, "visionOS-simulator", true, "xrOS-simulator") { }
static const PlatformInfo_visionOS_simulator singleton;
};
@@ -560,7 +551,7 @@
class VIS_HIDDEN PlatformInfo_visionOS_exclaveCore : public PlatformInfo_visionOS
{
public:
- consteval PlatformInfo_visionOS_exclaveCore() : PlatformInfo_visionOS(PLATFORM_VISIONOS_EXCLAVECORE, "visionOS-exclaveCore", false, &PlatformInfo_visionOS_exclaveCore::singleton, "xrOS-exclaveCore")
+ consteval PlatformInfo_visionOS_exclaveCore() : PlatformInfo_visionOS(PLATFORM_VISIONOS_EXCLAVECORE, "visionOS-exclaveCore", false, "xrOS-exclaveCore")
{
supportsFairPlayEncryption = false;
isExclaveCore = true;
@@ -573,7 +564,7 @@
class VIS_HIDDEN PlatformInfo_visionOS_exclaveKit : public PlatformInfo_visionOS
{
public:
- consteval PlatformInfo_visionOS_exclaveKit() : PlatformInfo_visionOS(PLATFORM_VISIONOS_EXCLAVEKIT, "visionOS-exclaveKit", false, &PlatformInfo_visionOS_exclaveKit::singleton, "xrOS-exclaveKit")
+ consteval PlatformInfo_visionOS_exclaveKit() : PlatformInfo_visionOS(PLATFORM_VISIONOS_EXCLAVEKIT, "visionOS-exclaveKit", false, "xrOS-exclaveKit")
{
supportsFairPlayEncryption = false;
isExclaveKit = true;
@@ -623,8 +614,9 @@
//
-Platform::Platform(uint32_t platformNumber) : _info(nullptr), _value(0)
-{
+Platform::Platform(uint32_t platformNumber)
+{
+ _info = nullptr;
for (const PlatformInfo* p : PlatformInfo::knownPlatformInfos) {
assert(p->value != 0 && "PlatformInfo value uninitialized, this might be a problem with C++ static initializers order");
if ( p->value == platformNumber ) {
@@ -632,7 +624,6 @@
return;
}
}
- _value = platformNumber;
}
Platform Platform::byName(std::string_view name) {
@@ -675,27 +666,14 @@
bool Platform::empty() const
{
- return (_info == nullptr) && _value == 0;
+ return (_info == nullptr);
}
CString Platform::name() const
{
- if ( _info == nullptr ) {
- if ( _value != 0 )
- return "future";
+ if ( _info == nullptr )
return "unknown";
- }
return _info->name;
-}
-
-Platform Platform::basePlatform() const
-{
- if ( _info == nullptr ) {
- if ( _value != 0 )
- return *this;
- return Platform();
- }
- return Platform(*(_info->basePlatformInfo));
}
bool Platform::isSimulator() const
@@ -742,25 +720,9 @@
return false;
}
-CString Platform::libSystemDir() const
-{
- if ( *this == Platform::sepOS )
- return "";
- if ( *this == Platform::firmware )
- return "";
- if ( isExclaveCore() )
- return "";
-
- if ( *this == Platform::driverKit )
- return "/System/DriverKit/usr/lib/system/";
- if ( isExclaveKit() )
- return "/System/ExclaveKit/usr/lib/system/";
- return "/usr/lib/system/";
-}
-
uint32_t Platform::value() const
{
- return _info ? _info->value : _value;
+ return _info ? _info->value : 0;
}
Platform::Epoch Platform::epoch(Version32 v) const
@@ -927,20 +889,6 @@
if ( (vendor == nullptr) || (osVers == nullptr) )
return Error("missing dashes in target triple '%s'", triple.c_str());
-
- // also return architecture from triple
- outArch = Architecture::byName(arch);
- if ( outArch == Architecture() )
- return Error("unknown architecture in target triple '%s'", triple.c_str());
-
- // firmware uses triples like "thumbv7m-apple-unknown-macho"
- if ( strcmp(osVers, "unknown") == 0 ) {
- this->platform = Platform::firmware;
- this->minOS = Version32(0,0);
- this->sdk = Version32(0,0);
- return Error::none();
- }
-
// split osVersion into osName and minOS version
const size_t osVersLen = strlen(osVers);
char osName[triple.size()+1];
@@ -954,10 +902,17 @@
break;
}
}
+ if ( strlen(minOSVers) == 0 )
+ return Error("missing OS version in target triple '%s'", triple.c_str());
// macosx is historical name
if ( strcmp(osName, "macosx") == 0 )
strlcpy(osName, "macos", sizeof(osName));
+
+ // also return architecture from triple
+ outArch = Architecture::byName(arch);
+ if ( outArch == Architecture() )
+ return Error("unknown architecture in target triple '%s'", triple.c_str());
// Apple sub-platforms are fourth part of triple, but need to be added to OS name to make platform name
// e.g. "arm64-apple-tvos16.0-simulator" --> "tvos-simulator"
@@ -968,9 +923,6 @@
this->platform = Platform::byName(osName);
if ( this->platform.empty() )
return Error("unknown OS in target triple '%s'", triple.c_str());
-
- if ( (strlen(minOSVers) == 0) && (this->platform != Platform::firmware) )
- return Error("missing OS version in target triple '%s'", triple.c_str());
// get minOS from version trailing OS name in triple
if (Error err = Version32::fromString(minOSVers, this->minOS))