On 09/11/2023 23:48, Bruno Haible wrote:
The patch tests MAC_OS_X_VERSION_MIN_REQUIRED in one place and
MAC_OS_X_VERSION_MAX_ALLOWED in the other place. What if someone compiles
for a range that includes both 10.4 and 10.5? That is,
   MAC_OS_X_VERSION_MIN_REQUIRED is MAC_OS_X_VERSION_10_4
and
   MAC_OS_X_VERSION_MAX_ALLOWED is MAC_OS_X_VERSION_10_5 or larger.
Then your patch will not define SIGSEGV_FAULT_STACKPOINTER.

You would be doing that on 10.5 or 10.6 and passing -mmacosx-version-min=10.4.

If I go about it backbackwards with ./configure CFLAGS=-mmacosx-version-min=10.5, on 10.4, build breaks with
sigsegv.c: In function ‘sigsegv_handler’:
sigsegv.c:1044: error: ‘struct mcontext’ has no member named ‘__ss’


On a 10.5 system, if I run ./configure CFLAGS=-mmacosx-version-min=10.4 and attempt the build, everything builds & runs ok.
Copying the resulting binaries to 10.4 system,
test-sigsegv-catch-segv1 & 2 run fine.

test-sigsegv-catch-stackoverflow1 & 2 fail to run though, since sigaltstack variable types were changed in 10.5. I had to sidestep calls to setrlimit in the test .c files as that was the initial breakage, but not relevant to the issue.

test-sigsegv-catch-stackoverflow1:
dyld: lazy symbol binding failed: Symbol not found: _sigaltstack$UNIX2003
  Referenced from: /Users/sevan/./test-sigsegv-catch-stackoverflow2
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _sigaltstack$UNIX2003
  Referenced from: /Users/sevan/./test-sigsegv-catch-stackoverflow2
  Expected in: /usr/lib/libSystem.B.dylib

Trace/BPT trap

test-sigsegv-catch-stackoverflow2:
dyld: lazy symbol binding failed: Symbol not found: _sigaltstack$UNIX2003
  Referenced from: /Users/sevan/./test-sigsegv-catch-stackoverflow1
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _sigaltstack$UNIX2003
  Referenced from: /Users/sevan/./test-sigsegv-catch-stackoverflow1
  Expected in: /usr/lib/libSystem.B.dylib

Trace/BPT trap

Sevan


Reply via email to