summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Drissman <avi@chromium.org>2023-01-24 14:59:30 -0500
committerAvi Drissman <avi@chromium.org>2023-01-24 14:59:30 -0500
commitbc848980247d61c9fd60ff9560f718ca01d45ea2 (patch)
tree172ab9ed10c2d1b9f20ef930dae245f24772fec0
parentea62cfa6f326c2770108fa091d99f4306949c088 (diff)
downloadnasm-bc848980247d61c9fd60ff9560f718ca01d45ea2.tar.gz
Update version requirements for the Mac
Only require major + minor for the Mac pre macOS 11, otherwise only a major version is fine. Bug: chromium:1409095 Change-Id: Iafe0d19d567bd8dcf846b1d9cdcd6b5e324dbb1a
-rw-r--r--output/outmacho.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/output/outmacho.c b/output/outmacho.c
index d1568a71..1a185ae5 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -2469,8 +2469,13 @@ bool macho_set_min_os(const char *str) {
unsigned short major = 0, minor = 0, subminor = 0;
int count = sscanf(version, "%hu.%hu.%hu", &major, &minor, &subminor);
- /* at least major and minor must be given */
- if (count < 2) {
+ if (count < 1) {
+ nasm_free((char *)platform_ver);
+ return false;
+ }
+
+ /* Pre-macOS 11 at least major and minor must be given */
+ if (platform == PLATFORM_MACOS && major < 11 && count < 2) {
nasm_free((char *)platform_ver);
return false;
}