Merge pull request #80 from mstorsjo/sdk-ver

Fix the logic for the default fallback sdk version in ld64
This commit is contained in:
Thomas Pöchtrager 2020-04-13 12:36:54 +02:00 committed by GitHub
commit 8d34d0fbb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5380,14 +5380,12 @@ void Options::reconfigureDefaults()
char kernVersStr[100];
size_t strlen = sizeof(kernVersStr);
if ( sysctl(mib, 2, kernVersStr, &strlen, NULL, 0) != -1 ) {
#else
const char *kernVersStr = "10.5"; // ld64-port: claim we are on 10.5
#endif
uint32_t kernVers = parseVersionNumber32(kernVersStr);
int minor = (kernVers >> 16) - 4; // kernel major version is 4 ahead of x in 10.
fPlatforms.updateSDKVersion(ld::Platform::macOS, (0x000A0000 + (minor << 8)));
#ifdef __APPLE__ // ld64-port
}
#else
fPlatforms.updateSDKVersion(ld::Platform::macOS, parseVersionNumber32("10.6")); // ld64-port: claim we are on 10.6
#endif
}
}