Re: [PATCH] lib/stdio.in.h: define _POSIX_C_SOURCE on >=Sierra

2023-11-09 Thread Paul Eggert
On 2023-11-09 11:00, Sevan Janiyan wrote: This is wrong, you're applying the change to anything before High Sierra (10.13). You're after Ventura and above (13). # if (defined MAC_OS_X_VERSION_MIN_REQUIRED \   && 13 >= MAC_OS_X_VERSION_MIN_REQUIRED) If the #if should fire when it's 13

Re: Patch: Fix OS X PowerPC support

2023-11-09 Thread Sevan Janiyan
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

Re: sigsegv: Port to CHERI

2023-11-09 Thread Bruno Haible
And a small improvement: 2023-11-09 Bruno Haible sigsegv: Improve port to CHERI. * lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): Define also on CheriBSD. diff --git a/lib/sigsegv.c b/lib/sigsegv.c index 5f9bc08bb9..c683c03ac0 100644 --- a/lib/sigsegv.c +++ b/lib/sigsegv.c @@ -4

sigsegv: Port to CHERI

2023-11-09 Thread Bruno Haible
The patch below fixes the following test failures: FAIL: test-c-stack.sh FAIL: test-c-stack2.sh FAIL: test-sigsegv-catch-segv1 FAIL: test-sigsegv-catch-segv2 FAIL: test-sigsegv-catch-stackoverflow1 FAIL: test-sigsegv-catch-stackoverflow2 2023-11-09 Bruno Haible sigsegv: Port to CHERI

Re: Patch: Fix OS X PowerPC support

2023-11-09 Thread Bruno Haible
Sevan Janiyan wrote: > @@ -676,11 +678,21 @@ int libsigsegv_version = LIBSIGSEGV_VERSION; > > # elif defined __powerpc__ > > +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 > /* See the definitions of > - 'ucontext_t' and 'struct __darwin_ucontext' in , > - 'struct __d

Re: Patch: Fix OS X PowerPC support

2023-11-09 Thread Bruno Haible
Sevan Janiyan wrote: > On 30/11/2021 01:12, Bruno Haible wrote: > > I suspect that it merely compiles, but does not actually work on Mac > > OS X 10.4.x. > > > > You can find out by running "make check", to see whether the unit > > tests pass. > > > Running "make check" results in 2 test failure

Re: test-fenv-* failures on legacy Darwin/powerpc

2023-11-09 Thread Bruno Haible
Sevan Janiyan wrote: > FAIL: test-fenv-except-tracking-2.sh > > > Failed: ./test-fenv-except-tracking-2 f > FAIL test-fenv-except-tracking-2.sh (exit status: 1) > > FAIL: test-fenv-except-tracking-3.sh > > > Failed: ./test

Re: test-float on legacy Darwin/powerpc

2023-11-09 Thread Bruno Haible
Sevan Janiyan wrote: > On 10.4 & 10.5 > FAIL: test-float > > > test-float.c:332: assertion 'x + x == x' failed > FAIL test-float (exit status: 134) To understand the failure, take a look at: - the comment in the unit test: /* Check the value of LDBL_MAX. */ - the existin

Re: Test failures on legacy Darwin/powerpc

2023-11-09 Thread Bruno Haible
Jeffrey Walton wrote: > > If I recall correctly, those old PowerMac use 128-bit floats from > > IEEE754 by default. > > > > I think you should build with `-mlong-double-64` on the old PowerMacs. This advice would work for a program; it does not work for a library or for Gnulib. The reason is that

Re: [PATCH] lib/stdio.in.h: define _POSIX_C_SOURCE on >=Sierra

2023-11-09 Thread Sevan Janiyan
On 09/11/2023 19:00, Sevan Janiyan wrote: # if (defined MAC_OS_X_VERSION_MIN_REQUIRED \   && 101300 <= MAC_OS_X_VERSION_MIN_REQUIRED) This is wrong, you're applying the change to anything before High Sierra (10.13). You're after Ventura and above (13). # if (defined MAC_OS_X_VERSION_MIN_

Re: Test failures on legacy Darwin/powerpc

2023-11-09 Thread Sevan Janiyan
On 09/11/2023 18:28, Jeffrey Walton wrote: If I recall correctly, those old PowerMac use 128-bit floats from IEEE754 by default. I think you should build with `-mlong-double-64` on the old PowerMacs. Thank you for the hint, that did the trick on 10.4 (G5) & 10.5 (G4) PASS test-float (exit sta

Re: [PATCH] lib/stdio.in.h: define _POSIX_C_SOURCE on >=Sierra

2023-11-09 Thread Sevan Janiyan
Hi Paul, On 09/11/2023 18:51, Paul Eggert wrote: Thanks for the reviews. I installed the attached. # if (defined MAC_OS_X_VERSION_MIN_REQUIRED \ && 101300 <= MAC_OS_X_VERSION_MIN_REQUIRED) This is wrong, you're applying the change to anything before High Sierra (10.13). You're after Ve

Re: [PATCH] lib/stdio.in.h: define _POSIX_C_SOURCE on >=Sierra

2023-11-09 Thread Paul Eggert
Thanks for the reviews. I installed the attached.From 2dd1a7984c6b3e6056cef7e3f9933e0039c21634 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 9 Nov 2023 10:50:30 -0800 Subject: [PATCH] stdio: port better to older macOS * lib/stdio.in.h: Do not define _POSIX_C_SOURCE on older macOS, as it

Re: Test failures on legacy Darwin/powerpc

2023-11-09 Thread Jeffrey Walton
On Thu, Nov 9, 2023 at 1:00 PM Sevan Janiyan wrote: > > On 10.4 > FAIL: test-nanosleep > > > test-nanosleep.c:50: assertion 'nanosleep (&ts, NULL) == -1' failed > FAIL test-nanosleep (exit status: 134) > > > On 10.4 & 10.5 > FAIL: test-float > > > test-float.c

Test failures on legacy Darwin/powerpc

2023-11-09 Thread Sevan Janiyan
On 10.4 FAIL: test-nanosleep test-nanosleep.c:50: assertion 'nanosleep (&ts, NULL) == -1' failed FAIL test-nanosleep (exit status: 134) On 10.4 & 10.5 FAIL: test-float test-float.c:332: assertion 'x + x == x' failed FAIL test-float (exit status: 134) On

Re: [PATCH] lib/stdio.in.h: define _POSIX_C_SOURCE on >=Sierra

2023-11-09 Thread Sevan Janiyan
On 08/11/2023 04:34, Sevan Janiyan wrote: __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ is defined in cpp(1). I can't confirm on newer macOS versions but it would be safe to assume AvailabilityMacros.h is available if (defined __APPLE__ && defined __MACH__) since the header covers mobile & desk

Re: Patch: Fix OS X PowerPC support

2023-11-09 Thread Sevan Janiyan
On 06/11/2023 13:54, Sevan Janiyan wrote: Sorry about the noise, I suspect the patch is invalid for Leopard. I will follow up with a new patch which splits the case for 10.5 & older, if that is the case, once I've done more testing. Attached patch splits the powerpc case to Leopard and newer (

Re: generic configure tests

2023-11-09 Thread Sevan Janiyan
On 09/11/2023 14:47, Bruno Haible wrote: That's a good question. Yes, sometimes configure tests can be formulated in a generic way (i.e. "on all platforms where PTHREAD_RWLOCK_INITIALIZER is not defined") or in a specific way (i.e. "on Mac OS X < 10.5") or in an intermediate way (i.e. "on all mac

new module 'rand'

2023-11-09 Thread Bruno Haible
On CheriBSD, I see these test failures: FAIL: test-pthread-tss FAIL: test-thread_local FAIL: test-tls FAIL: test-tss In the debugger I see this: (gdb) where #0 random_r (estate=0x42319000 [rwRW,0x42319000-0x423190d0]) at /local/scratch/jenkins/workspace/CheriBSD-pipeline_releng_22.12@2/che

Re: generic configure tests

2023-11-09 Thread Bruno Haible
Sevan Janiyan wrote: > I've not followed the project for a length of time and unfamiliar with > the coding style but I was wondering why did you opt to add a new case > specifically for Darwin, where the generic catchall could be to utilise > pthread_rwlock_init by calling it with PTHREAD_RWLOCK

Re: Test for pthread_rwlock_init() always passes, regardless

2023-11-09 Thread Bruno Haible
Sevan Janiyan wrote: > > The lack of PTHREAD_RWLOCK_INITIALIZER is the only problem we have > > identified > > so far. But it is severe enough that gnulib better overrides all > > pthread_rwlock_* functions. Done through this patch: > > Thanks for the patch, configure detects things on Tiger corr

Re: Test for pthread_rwlock_init() always passes, regardless

2023-11-09 Thread Sevan Janiyan
On 09/11/2023 02:36, Bruno Haible wrote: The lack of PTHREAD_RWLOCK_INITIALIZER is the only problem we have identified so far. But it is severe enough that gnulib better overrides all pthread_rwlock_* functions. Done through this patch: Thanks for the patch, configure detects things on Tiger co

host-cpu-c-abi: Port to CHERI

2023-11-09 Thread Bruno Haible
On CheriBSD, the original arm64 ABI and the CheriABI are different: When I attempt to link a program with the libc from the other ABI, a runtime error ensues. For example, a program with the original arm64 ABI linked against the libc of the CheriABI: $ clang hello.c -Wl,-rpath,/lib $ ldd a.out a.o