Sevan Janiyan wrote: > On 10/11/2023 02:41, Sevan Janiyan wrote: > > 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 > > How should we proceed?
I can't find the time to think through the detailed results that you listed. I hope you can do that. But in summary, my point was "the patch is odd, because it uses MIN in one place and MAX in the other place" and I guessed "it will not work for a range that includes both 10.4 and 10.5". Your answer is "this will not work anyway", right? Did I understand it right? If so, can you change your patch so that 1) it is symmetric w.r.t. to MIN and MAX, and/or 2) it at least compiles for a range that includes both 10.4 and 10.5, and ideally works on 10.5? I think that would be the best behaviour for MacPorts/Homebrew/Fink/etc. Bruno