]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin fixup_macho_loadcmds: make build more flexible
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 1 May 2026 09:16:17 +0000 (11:16 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 1 May 2026 09:16:17 +0000 (11:16 +0200)
Part of work for https://bugs.kde.org/show_bug.cgi?id=519604

The value of maxprot for the __UNIXSTACK load command changed
from 7 to 3 during the macOS 10.14 lifecycle. Our code used
the SDK value to decide which to check for. MacPorts buildbot
targets all macOS 10.14 versions which does not work with our
assumption that latest 10.14 SDK => maxprot 3. In order to make
this more flexible we now allow maxprot 3 or 7 on macOS 10.14.

This is just for fixup_macho_commands that just gets used
once for each tool during builds.

coregrind/fixup_macho_loadcmds.c

index a6699baed49b7e3460a2a117de3040424243f328..c267d00d4fd0fc4ab98a98492901700f2f70ff79 100644 (file)
@@ -515,10 +515,13 @@ void modify_macho_loadcmds ( HChar* filename,
          fail("has __UNIXSTACK, but wrong ::vmaddr");
       if (seg->vmsize != expected_stack_size)
          fail("has __UNIXSTACK, but wrong ::vmsize");
-#if SDK_VERS >= SDK_10_14_6
+#if DARIN_VERS >= DARWIN_10_15
       if (seg->maxprot != 3)
          fail("has __UNIXSTACK, but wrong ::maxprot (should be 3)");
-#else
+#elif DARWIN_VERS == DARWIN_10_14
+      if (seg->maxprot != 7 && seg->maxprot != 3)
+         fail("has __UNIXSTACK, but wrong ::maxprot (should be 3 or 7)");
+#else // <= DARWIN_10_13
       if (seg->maxprot != 7)
          fail("has __UNIXSTACK, but wrong ::maxprot (should be 7)");
 #endif