]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
3 hours agoDon't use -Wfree-labels/-Wmissing-parameter-name if unsupported master
H.J. Lu [Sat, 23 Aug 2025 01:50:35 +0000 (18:50 -0700)] 
Don't use -Wfree-labels/-Wmissing-parameter-name if unsupported

Don't use -Wfree-labels/-Wmissing-parameter-name for "make check" if
they are unsupported by TEST_CC.

This fixes BZ #33310.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
4 hours agoUndef __INT64_C/__UINT64_C for glibc build and test
H.J. Lu [Fri, 22 Aug 2025 22:31:23 +0000 (15:31 -0700)] 
Undef __INT64_C/__UINT64_C for glibc build and test

Since clang 20 defines __INT64_C and __UINT64_C as built-in macros, undef
them for glibc build and test.  This fixes BZ #33311.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
4 hours agoRevert "Don't use -Wfree-labels/-Wmissing-parameter-name if unsupported"
H.J. Lu [Sat, 23 Aug 2025 01:03:46 +0000 (18:03 -0700)] 
Revert "Don't use -Wfree-labels/-Wmissing-parameter-name if unsupported"

This reverts commit ee06d98c5b9161fcaa03c562860d6ec4a8700cd2.

4 hours agoDon't use -Wfree-labels/-Wmissing-parameter-name if unsupported
H.J. Lu [Fri, 22 Aug 2025 22:56:27 +0000 (15:56 -0700)] 
Don't use -Wfree-labels/-Wmissing-parameter-name if unsupported

Don't use -Wfree-labels/-Wmissing-parameter-name for "make check" if
they are unsupported by TEST_CC.

This fixes BZ #33310.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
4 hours agox86: Set have-protected-data to no if unsupported
H.J. Lu [Fri, 22 Aug 2025 22:56:41 +0000 (15:56 -0700)] 
x86: Set have-protected-data to no if unsupported

If the building compiler enables no direct external data access by
default, access to protected data in shared libraries from executables
must be compiled with no direct external data access.  If the testing
compiler doesn't support it, set have-protected-data to no to disable
the tests which requires no direct external data access.

Add LIBC_TRY_CC_COMMAND to test a building compiler option or options
with an input file.

This fixes BZ #33286.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
5 hours agostdio-common: Convert macros across scanf input specifier tests
Maciej W. Rozycki [Sat, 23 Aug 2025 00:02:10 +0000 (01:02 +0100)] 
stdio-common: Convert macros across scanf input specifier tests

Convert 'compare_real', 'read_real', and 'verify_input' macros to
functions so as to improve readability and avoid pitfalls.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 hours agostdio-common: Adjust header inclusion in scanf input specifier tests
Maciej W. Rozycki [Sat, 23 Aug 2025 00:02:10 +0000 (01:02 +0100)] 
stdio-common: Adjust header inclusion in scanf input specifier tests

Move the inclusion of the data class header from the individual tests to
the data-type-specific skeleton, providing for the use of the data type
under test in the data class header and reducing duplication.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 hours agostdio-common: Include correct skeleton in scanf input specifier tests
Maciej W. Rozycki [Sat, 23 Aug 2025 00:02:10 +0000 (01:02 +0100)] 
stdio-common: Include correct skeleton in scanf input specifier tests

Follow 'scanf' itself and use the system header inclusion variant for
the data-type-specific skeleton consistently across the remaining scanf
family functions so that any sysdeps/ variant takes precedence even in
the presence of a corresponding skeleton in stdio-common/ (though we
have no such arrangement at the moment).

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 hours agostdio-common: Fix NaN input data for scanf input specifier tests [BZ #32857]
Maciej W. Rozycki [Sat, 23 Aug 2025 00:02:10 +0000 (01:02 +0100)] 
stdio-common: Fix NaN input data for scanf input specifier tests [BZ #32857]

Update NaN input data with 'n-char-sequence' in reference data matching
data under test, removing test failures with the M68K host.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 hours agostdio-common: Fix bad NaN crash in scanf input specifier tests [BZ #32857]
Maciej W. Rozycki [Sat, 23 Aug 2025 00:02:10 +0000 (01:02 +0100)] 
stdio-common: Fix bad NaN crash in scanf input specifier tests [BZ #32857]

Fix a null pointer dereference causing a crash in 'read_real' when the
terminating null character is written for use with the subsequent call
to 'nan' for invalid NaN reference input, such as:

%a:nan:1:3:nanny:

by moving all the 'n-char-sequence' handling under the check for the
opening parenthesis.

No test case added as it's a test case issue in the first place.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 hours agostdio-common: Fix a crash in scanf input specifier tests [BZ #32857]
Maciej W. Rozycki [Sat, 23 Aug 2025 00:02:10 +0000 (01:02 +0100)] 
stdio-common: Fix a crash in scanf input specifier tests [BZ #32857]

Fix a null pointer dereference causing a crash in 'read_real' when the
terminating null character is written for use with the subsequent call
to 'nan' for NaN reference input using null 'n-char-sequence', such as:

%a:nan():1:5:nan():

by moving the memory allocation call ahead of the check for the closing
parenthesis.

No test case added as it's a test case issue in the first place.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 hours agostdio-common: Fix error reporting in scanf input specifier tests
Maciej W. Rozycki [Sat, 23 Aug 2025 00:02:10 +0000 (01:02 +0100)] 
stdio-common: Fix error reporting in scanf input specifier tests

Remove buffer contents reporting from the real variant of 'verify_input'
where there has been an input data format error making the contents of
data buffers irrelevant.

For example given invalid float input data:

%a:nan:1:3:nan(:

these messages are produced:

error: ./tst-scanf-format-skeleton.c:240: input buffer: `0000c07f'
error: ./tst-scanf-format-skeleton.c:240: value buffer: `0000c07f'
error: ./tst-scanf-format-skeleton.c:242: input line 1: input data format error

with the two former lines irrelevant.  Remove them from output then,
only leaving:

error: ./tst-scanf-format-skeleton.c:242: input line 1: input data format error

No test case added as it's a test case issue in the first place.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 hours agostdio-common: Reject insufficient character data in scanf [BZ #12701]
Maciej W. Rozycki [Sat, 23 Aug 2025 00:02:10 +0000 (01:02 +0100)] 
stdio-common: Reject insufficient character data in scanf [BZ #12701]

Reject invalid formatted scanf character data with the 'c' conversion
where there is not enough input available to satisfy the field width
requested.  It is required by ISO C that this conversion matches a
sequence of characters of exactly the number specified by the field
width and it is also already documented as such in our own manual:

"It reads precisely the next N characters, and fails if it cannot get
that many."

Currently a matching success is instead incorrectly produced where the
EOF condition is encountered before the required number of characters
has been retrieved, and the characters actually obtained are stored in
the buffer provided.

Add test cases accordingly and remove placeholders from 'c' conversion
input data for the existing scanf tests.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 hours agoDisable -Wimplicit-fallthrough when clang is in use
H.J. Lu [Fri, 22 Aug 2025 22:55:24 +0000 (15:55 -0700)] 
Disable -Wimplicit-fallthrough when clang is in use

Clang's -Wimplicit-fallthrough warning, which flags unannotated
fall-through in switch statements, does not recognize specific comments
like /* FALLTHROUGH */ for suppressing the warning, unlike GCC.  Since
fall through comments are used extensively in glibc, disable
-Wimplicit-fallthrough when clang is in use.

This fixes BZ #33312.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
10 hours agolibio: Properly link in libio functions in static binaries
H.J. Lu [Thu, 21 Aug 2025 23:57:22 +0000 (16:57 -0700)] 
libio: Properly link in libio functions in static binaries

commit 3020f72618e4f1d7338cd42b8bc7b2813e961b5a
Author: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Date:   Tue Dec 27 18:11:43 2022 -0300

    libio: Remove the usage of __libc_IO_vtables

added

 #define libio_static_fn_required(name) __asm (".globl " #name);

to link in libio functions in static binaries.  But there is no relocation
in
.globl _IO_file_open

and "strip --strip-unneeded" will remove such unreferenced symbols which
breaks static binaries.  Redefine libio_static_fn_required to create a
reference to the required function with

static __typeof (name) *const name##_p __attribute__((used)) = name;

This fixes BZ #33300.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Tested-by: Xi Ruoyao <xry111@xry111.site>
15 hours agox86_64: Use __seg_fs qualifiers in NPTL accessors
Uros Bizjak [Fri, 22 Aug 2025 05:33:13 +0000 (07:33 +0200)] 
x86_64: Use __seg_fs qualifiers in NPTL accessors

Use __seg_fs named address space qualifiers to cast NPTL accessors
to %fs: prefixed addresses.  Use volatile access only where
strictly necessary.

Use existing assembly RSEQ_* accessors for x32 to
work around the GCC bug:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121613

because negative value in __rseq_offset is used
as an offset from %fs.

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
27 hours agox86: Remove an extra space before THREAD_SELF
H.J. Lu [Fri, 22 Aug 2025 02:29:58 +0000 (19:29 -0700)] 
x86: Remove an extra space before THREAD_SELF

After

f6dd43d5f7 i386: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF()
b0f0c41a5f x86_64: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF()

removed the unnecessary __GNUC_PREREQ (6, 0) test, remove the extra space
before THREAD_SELF macro name.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2 days agox86_64: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF()
Uros Bizjak [Sun, 17 Aug 2025 15:49:54 +0000 (17:49 +0200)] 
x86_64: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF()

Currenty GCC-12 is required as the minimum supported compiler
version.  Remove stalled __GNUC_PREREQ (6, 0) test for
GCC compiler version in THREAD_SELF() macro definition.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: H.J.Lu <hjl.tools@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 days agoi386: Use __seg_gs qualifiers in NPTL accessors
Uros Bizjak [Sun, 17 Aug 2025 15:50:47 +0000 (17:50 +0200)] 
i386: Use __seg_gs qualifiers in NPTL accessors

Use __seg_gs named address space qualifiers to cast NPTL accessors
to %gs: prefixed addresses.  Use volatile access only where
strictly necessary.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: H.J.Lu <hjl.tools@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 days agoi386: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF()
Uros Bizjak [Sun, 17 Aug 2025 15:50:46 +0000 (17:50 +0200)] 
i386: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF()

Currenty GCC-12 is required as the minimum supported compiler
version.  Remove stalled __GNUC_PREREQ (6, 0) test for
GCC compiler version in THREAD_SELF() macro definition.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: H.J.Lu <hjl.tools@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 days agoi386: Use TESTB instead of TESTL in ____longjmp_chk()
Uros Bizjak [Mon, 18 Aug 2025 09:19:47 +0000 (11:19 +0200)] 
i386: Use TESTB instead of TESTL in ____longjmp_chk()

There is no need to use TESTL when checking the least-significant bit
with a TEST instruction. Use TESTB, which is three bytes shorter:

   f6 44 24 04 01          testb  $0x1,0x4(%esp)

vs:

   f7 44 24 04 01 00 00    testl  $0x1,0x4(%esp)
   00

for the same effect.

No functional changes intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: H.J.Lu <hjl.tools@gmail.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 days agox86_64: Use TESTB instead of TESTL in CHECK_INVALID_LONGJMP
Uros Bizjak [Mon, 18 Aug 2025 09:18:55 +0000 (11:18 +0200)] 
x86_64: Use TESTB instead of TESTL in CHECK_INVALID_LONGJMP

There is no need to use TESTL when checking the least-significant bit
with a TEST instruction. Use TESTB, which is three bytes shorter:

   f6 44 24 f0 01          testb  $0x1,-0x10(%rsp)

vs:

   f7 44 24 f0 01 00 00    testl  $0x1,-0x10(%rsp)
   00

for the same effect.

No functional changes intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: H.J.Lu <hjl.tools@gmail.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 days agoAArch64: Fix SVE powf routine [BZ #33299]
Pierre Blanchard [Wed, 20 Aug 2025 17:41:50 +0000 (17:41 +0000)] 
AArch64: Fix SVE powf routine [BZ #33299]

Fix a bug in predicate logic introduced in last change.
A slight performance improvement from relying on all true
predicates during conversion from single to double.
This fixes BZ #33299.

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
3 days agosupport: Handle FUSE_GETXATTR during FUSE FS mount
Arjun Shankar [Mon, 18 Aug 2025 13:33:13 +0000 (15:33 +0200)] 
support: Handle FUSE_GETXATTR during FUSE FS mount

When testing with some kernel versions, support FUSE infrastructure
encounters a FUSE_GETXATTR request, leading to FUSE tests hanging until
timed out.  Therefore, pass FUSE_GETXATTR requests from
support_fuse_handle_mountpoint to support_fuse_handle_directory, and
adjust support_fuse_handle_directory to return ENOSYS so that tests can
proceed.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 days agomalloc: Fix tst bug in malloc/tst-free-errno-malloc-hugetlb1.
caiyinyu [Thu, 14 Aug 2025 08:28:46 +0000 (16:28 +0800)] 
malloc: Fix tst bug in malloc/tst-free-errno-malloc-hugetlb1.

When transparent hugepages (THP) are configured to 32MB on x86/loongarch
systems, the current big_size value may not be sufficiently large to
guarantee that free(ptr) [1] will call munmap(ptr_aligned, big_size).

Tested on x86_64 and loongarch64.

PS: Without this patch and using 32M THP, there is a about 50% chance
that malloc/tst-free-errno-malloc-hugetlb1 will fail on both x86_64 and
loongarch64.

[1] malloc/tst-free-errno.c:
...
       errno = 1789;
       /* This call to free() is supposed to call
            munmap (ptr_aligned, big_size);
          which increases the number of VMAs by 1, which is supposed
          to fail.  */
->     free (ptr);
       TEST_VERIFY (get_errno () == 1789);
     }
...

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
4 days agoi386: Also add GLIBC_ABI_GNU2_TLS version [BZ #33129]
H.J. Lu [Mon, 18 Aug 2025 16:06:48 +0000 (09:06 -0700)] 
i386: Also add GLIBC_ABI_GNU2_TLS version [BZ #33129]

Since the GNU2 TLS run-time bug:

https://sourceware.org/bugzilla/show_bug.cgi?id=31372

affects both i386 and x86-64, also add GLIBC_ABI_GNU2_TLS version to i386
to indicate the working GNU2 TLS run-time.  For x86-64, the additional
GNU2 TLS run-time bug fix is needed for

https://sourceware.org/bugzilla/show_bug.cgi?id=31501

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
5 days agohtl: move sem_unlink into libc.
gfleury [Sun, 17 Aug 2025 10:40:22 +0000 (12:40 +0200)] 
htl: move sem_unlink into libc.

Message-ID: <20250817104023.91919-8-gfleury@disroot.org>

5 days agohtl: move sem_{clockwait, timedwait, wait, trywait} into libc.
gfleury [Sun, 17 Aug 2025 10:40:21 +0000 (12:40 +0200)] 
htl: move sem_{clockwait, timedwait, wait, trywait} into libc.

Message-ID: <20250817104023.91919-7-gfleury@disroot.org>

5 days agohtl: move sem_post into libc.
gfleury [Sun, 17 Aug 2025 10:40:20 +0000 (12:40 +0200)] 
htl: move sem_post into libc.

Message-ID: <20250817104023.91919-6-gfleury@disroot.org>

5 days agohtl: move sem_open, sem_close into libc.
gfleury [Sun, 17 Aug 2025 10:40:19 +0000 (12:40 +0200)] 
htl: move sem_open, sem_close into libc.

Message-ID: <20250817104023.91919-5-gfleury@disroot.org>

5 days agohtl: move sem_init into libc.
gfleury [Sun, 17 Aug 2025 10:40:18 +0000 (12:40 +0200)] 
htl: move sem_init into libc.

Message-ID: <20250817104023.91919-4-gfleury@disroot.org>

5 days agohtl: move sem_getvalue into libc.
gfleury [Sun, 17 Aug 2025 10:40:17 +0000 (12:40 +0200)] 
htl: move sem_getvalue into libc.

Message-ID: <20250817104023.91919-3-gfleury@disroot.org>

5 days agohtl: move sem_destroy into libc.
gfleury [Sun, 17 Aug 2025 10:40:16 +0000 (12:40 +0200)] 
htl: move sem_destroy into libc.

Message-ID: <20250817104023.91919-2-gfleury@disroot.org>

7 days agohtl: move __pthread_startup into libc.
gfleury [Fri, 15 Aug 2025 18:15:00 +0000 (20:15 +0200)] 
htl: move __pthread_startup into libc.

Message-ID: <20250815181500.107433-20-gfleury@disroot.org>

7 days agohtl: move __pthread_setup into libc.
gfleury [Fri, 15 Aug 2025 18:14:59 +0000 (20:14 +0200)] 
htl: move __pthread_setup into libc.

Message-ID: <20250815181500.107433-19-gfleury@disroot.org>

7 days agohtl: move pthread_{join, clockjoin_np, timedjoin_np, tryjoin_np} into libc.
gfleury [Fri, 15 Aug 2025 18:14:58 +0000 (20:14 +0200)] 
htl: move pthread_{join, clockjoin_np, timedjoin_np, tryjoin_np} into libc.

Message-ID: <20250815181500.107433-18-gfleury@disroot.org>

7 days agohtl: move pthread_exit into libc.
gfleury [Fri, 15 Aug 2025 18:14:57 +0000 (20:14 +0200)] 
htl: move pthread_exit into libc.

Message-ID: <20250815181500.107433-17-gfleury@disroot.org>

7 days agohtl: move pthread_detach into libc.
gfleury [Fri, 15 Aug 2025 18:14:56 +0000 (20:14 +0200)] 
htl: move pthread_detach into libc.

Message-ID: <20250815181500.107433-16-gfleury@disroot.org>

7 days agohtl: move __pthread_sigstate_init into libc.
gfleury [Fri, 15 Aug 2025 18:14:55 +0000 (20:14 +0200)] 
htl: move __pthread_sigstate_init into libc.

Message-ID: <20250815181500.107433-15-gfleury@disroot.org>

7 days agohtl: move pthread_mutex_transfer_np into libc.
gfleury [Fri, 15 Aug 2025 18:14:54 +0000 (20:14 +0200)] 
htl: move pthread_mutex_transfer_np into libc.

Message-ID: <20250815181500.107433-14-gfleury@disroot.org>

7 days agohtl: move pthread_getattr_np into libc.
gfleury [Fri, 15 Aug 2025 18:14:53 +0000 (20:14 +0200)] 
htl: move pthread_getattr_np into libc.

Message-ID: <20250815181500.107433-13-gfleury@disroot.org>

7 days agohtl: move pthread_testcancel into libc.
gfleury [Fri, 15 Aug 2025 18:14:52 +0000 (20:14 +0200)] 
htl: move pthread_testcancel into libc.

Message-ID: <20250815181500.107433-12-gfleury@disroot.org>

7 days agohtl: move pthread_kill into libc.
gfleury [Fri, 15 Aug 2025 18:14:51 +0000 (20:14 +0200)] 
htl: move pthread_kill into libc.

Message-ID: <20250815181500.107433-11-gfleury@disroot.org>

7 days agohtl: move pthread_cancel, __pthread_do_cancel into libc.
gfleury [Fri, 15 Aug 2025 18:14:50 +0000 (20:14 +0200)] 
htl: move pthread_cancel, __pthread_do_cancel into libc.

Message-ID: <20250815181500.107433-10-gfleury@disroot.org>

7 days agohtl: move __thread_set_pcsptp into libc.
gfleury [Fri, 15 Aug 2025 18:14:49 +0000 (20:14 +0200)] 
htl: move __thread_set_pcsptp into libc.

Message-ID: <20250815181500.107433-9-gfleury@disroot.org>

7 days agohtl: move pthread_yield into libc.
gfleury [Fri, 15 Aug 2025 18:14:48 +0000 (20:14 +0200)] 
htl: move pthread_yield into libc.

Message-ID: <20250815181500.107433-8-gfleury@disroot.org>

7 days agohtl: move pthread_getcpuclockid into libc.
gfleury [Fri, 15 Aug 2025 18:14:47 +0000 (20:14 +0200)] 
htl: move pthread_getcpuclockid into libc.

Message-ID: <20250815181500.107433-7-gfleury@disroot.org>

7 days agohtl: move __pthread_thread_{alloc, start, terminate} into libc.
gfleury [Fri, 15 Aug 2025 18:14:46 +0000 (20:14 +0200)] 
htl: move __pthread_thread_{alloc, start, terminate} into libc.

Message-ID: <20250815181500.107433-6-gfleury@disroot.org>

7 days agohtl: move __pthread_stack_alloc into libc.
gfleury [Fri, 15 Aug 2025 18:14:45 +0000 (20:14 +0200)] 
htl: move __pthread_stack_alloc into libc.

Message-ID: <20250815181500.107433-5-gfleury@disroot.org>

7 days agohtl: move __pthread_init_{specific, static_tls}, __pthread_{alloc}, dealloc} into...
gfleury [Fri, 15 Aug 2025 18:14:44 +0000 (20:14 +0200)] 
htl: move __pthread_init_{specific, static_tls}, __pthread_{alloc}, dealloc} into libc.

Message-ID: <20250815181500.107433-4-gfleury@disroot.org>

7 days agohtl: move pthread_get/setconcurrency into libc.
gfleury [Fri, 15 Aug 2025 18:14:43 +0000 (20:14 +0200)] 
htl: move pthread_get/setconcurrency into libc.

Message-ID: <20250815181500.107433-3-gfleury@disroot.org>

7 days agohtl: move pthread_setschedprio into libc.
gfleury [Fri, 15 Aug 2025 18:14:42 +0000 (20:14 +0200)] 
htl: move pthread_setschedprio into libc.

Message-ID: <20250815181500.107433-2-gfleury@disroot.org>

8 days agox86-64: Add GLIBC_ABI_DT_X86_64_PLT [BZ #33212]
H.J. Lu [Thu, 14 Aug 2025 14:03:20 +0000 (07:03 -0700)] 
x86-64: Add GLIBC_ABI_DT_X86_64_PLT [BZ #33212]

When the linker -z mark-plt option is used to add DT_X86_64_PLT,
DT_X86_64_PLTSZ and DT_X86_64_PLTENT, the r_addend field of the
R_X86_64_JUMP_SLOT relocation stores the offset of the indirect
branch instruction.  However, glibc versions without the commit:

commit f8587a61892cbafd98ce599131bf4f103466f084
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri May 20 19:21:48 2022 -0700

    x86-64: Ignore r_addend for R_X86_64_GLOB_DAT/R_X86_64_JUMP_SLOT

    According to x86-64 psABI, r_addend should be ignored for R_X86_64_GLOB_DAT
    and R_X86_64_JUMP_SLOT.  Since linkers always set their r_addends to 0, we
    can ignore their r_addends.

Reviewed-by: Fangrui Song <maskray@google.com>
won't ignore the r_addend value in the R_X86_64_JUMP_SLOT relocation.
Such programs and shared libraries will fail at run-time randomly.

Add GLIBC_ABI_DT_X86_64_PLT version to indicate that glibc is compatible
with DT_X86_64_PLT.

The linker can add the glibc GLIBC_ABI_DT_X86_64_PLT version dependency
whenever -z mark-plt is passed to the linker.  The resulting programs and
shared libraries will fail to load at run-time against libc.so without the
GLIBC_ABI_DT_X86_64_PLT version, instead of fail randomly.

This fixes BZ #33212.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
8 days agoi386: Add GLIBC_ABI_GNU_TLS version [BZ #33221]
H.J. Lu [Mon, 28 Jul 2025 19:16:11 +0000 (12:16 -0700)] 
i386: Add GLIBC_ABI_GNU_TLS version [BZ #33221]

On i386, programs and shared libraries with __thread usage may fail
silently at run-time against glibc without the TLS run-time fix for:

https://sourceware.org/bugzilla/show_bug.cgi?id=32996

Add GLIBC_ABI_GNU_TLS version to indicate that glibc has the working
GNU TLS run-time.  Linker can add the GLIBC_ABI_GNU_TLS version to
binaries which depend on the working TLS run-time so that such programs
and shared libraries will fail to load and run at run-time against
libc.so without the GLIBC_ABI_GNU_TLS version, instead of fail silently
at random.

This fixes BZ #33221.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
8 days agox86-64: Add GLIBC_ABI_GNU2_TLS version [BZ #33129]
H.J. Lu [Mon, 28 Jul 2025 19:18:22 +0000 (12:18 -0700)] 
x86-64: Add GLIBC_ABI_GNU2_TLS version [BZ #33129]

Programs and shared libraries compiled with -mtls-dialect=gnu2 may fail
silently at run-time against glibc without the GNU2 TLS run-time fix
for:

https://sourceware.org/bugzilla/show_bug.cgi?id=31372

Add GLIBC_ABI_GNU2_TLS version to indicate that glibc has the working
GNU2 TLS run-time.  Linker can add the GLIBC_ABI_GNU2_TLS version to
binaries which depend on the working GNU2 TLS run-time:

https://sourceware.org/bugzilla/show_bug.cgi?id=33130

so that such programs and shared libraries will fail to load and run at
run-time against libc.so without the GLIBC_ABI_GNU2_TLS version, instead
of fail silently at random.

This fixes BZ #33129.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
9 days agoLoongArch: Fix build failure for loongarch64-linux-gnusf toolchain. [BZ #32776]
caiyinyu [Wed, 13 Aug 2025 07:08:09 +0000 (15:08 +0800)] 
LoongArch: Fix build failure for loongarch64-linux-gnusf toolchain. [BZ #32776]

GCC parts:

A GCC bug caused the loss of the search path: /usr/lib64/sf, and this
bug has now been fixed in GCC.

See:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9467435253948b83fcb5f7430f6cd571236960d8

10 days agobenchtests: Avoid truncation in random memcpy/memset benchmarks
Wilco Dijkstra [Tue, 12 Aug 2025 11:14:24 +0000 (11:14 +0000)] 
benchtests: Avoid truncation in random memcpy/memset benchmarks

Use uint16_t rather than uint8_t for the size arrays.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
11 days agostdio-common: Fix macro parameter shadowing in scanf input specifier tests
Maciej W. Rozycki [Mon, 11 Aug 2025 16:42:12 +0000 (17:42 +0100)] 
stdio-common: Fix macro parameter shadowing in scanf input specifier tests

The use of the same name for a local variable combined with passing a
pointer to it to a nested macro call causes the wrong 'err' variable to
be updated in 'read_real', because '&err' is only expanded at '*errp'
evaluation.  Consequently the variable defined in 'read_real' is set
rather than one in its 'verify_input' caller as it would be the case
should 'read_real' be a function, leading to invalid input such as:

%a:nan:1:3:nan(:

to be accepted.

Address the issue by renaming the 'err' variable in 'verify_input' to
'errx', causing such input to be correctly rejected:

error: ./tst-scanf-format-skeleton.c:242: input line 1: input data format error

No test case added as it's a test case issue in the first place.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
11 days agostdio-common: Add 'f' conversion tests for . scanf input [BZ #12701]
Maciej W. Rozycki [Mon, 11 Aug 2025 16:42:12 +0000 (17:42 +0100)] 
stdio-common: Add 'f' conversion tests for . scanf input [BZ #12701]

Verify that . input is rejected by 'f' conversion (and its uppercase
counterpart).  Replace 0 input with .0 rather than adding new one,
because the integral part of 0 is already covered by 0.0 data, so
there's no need to keep this duplication.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
11 days agostdio-common: Add 'e' conversion tests for . scanf input [BZ #12701]
Maciej W. Rozycki [Mon, 11 Aug 2025 16:42:12 +0000 (17:42 +0100)] 
stdio-common: Add 'e' conversion tests for . scanf input [BZ #12701]

Verify that . input is rejected by 'e' conversion (and its uppercase
counterpart).  Replace 0e0 input with .0e0 rather than adding new one,
because 0 significand is already covered by 0e+0 data, so there's no
need to keep this duplication.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
11 days agostdio-common: Add 'a', 'g' conversion tests for 0x. scanf input [BZ #12701]
Maciej W. Rozycki [Mon, 11 Aug 2025 16:42:12 +0000 (17:42 +0100)] 
stdio-common: Add 'a', 'g' conversion tests for 0x. scanf input [BZ #12701]

Verify that 0x. input is rejected by 'a' and 'g' conversions (and their
uppercase counterparts).  Replace 0x0p0 input with 0x.0p0 rather than
adding new one, because 0x0 significand is already covered by 0x0p+0
data, so there's no need to keep this duplication.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
11 days agostdio-common: Reject significands w/o digits in scanf [BZ #12701]
Maciej W. Rozycki [Mon, 11 Aug 2025 16:42:12 +0000 (17:42 +0100)] 
stdio-common: Reject significands w/o digits in scanf [BZ #12701]

Reject invalid formatted scanf real input data the significand part of
which is comprised of a hexadecimal prefix followed by a decimal point
only, optionally preceded by a sign.  Such data is a prefix of, but not
a matching input sequence and it is required by ISO C to cause a
matching failure.

Currently a matching success is instead incorrectly produced along with
the conversion result of zero, with data up to and including the decimal
point consumed from input.

Technically this change also causes lone . to be rejected early, though
it doesn't change semantics, because unlike 0x. it's not valid input to
'strtod', etc. so it gets rejected at actual conversion time later on
anyway.

Test cases follow as separate changes.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
11 days agostdio-common: Don't read real input beyond the field width in scanf
Maciej W. Rozycki [Mon, 11 Aug 2025 16:42:12 +0000 (17:42 +0100)] 
stdio-common: Don't read real input beyond the field width in scanf

Fix a code pattern that repeats across '__vfscanf_internal' where the
remaining field width of 0 is incorrectly interpreted as no width limit,
which in turn results in reading input beyond the limit requested.  The
lack of width limit is indicated by the field width of -1 rather than 0,
set earlier on in the function.

The problematic code pattern is used for both integer and floating-point
conversions, but in the former case a corresponding conditional earlier
on prevents the field width from being 0 when executing the pattern.  It
does trigger in the latter case, where the decimal point is a multibyte
character or for multibyte digit characters.

Fix the code pattern by using 'width > 0' comparison, and apply the fix
throughout even to code handling integer conversions so as to interpret
the field width consistently and avoid people's confusion even if width
cannot be 0 at those places.

For multibyte digit characters there is an additional issue that causes
code to push back a partially fetched multibyte character multiple times
as execution proceeds through matching data retrieved against individual
digits that have to be rejected due to the field width limit preventing
the rest of the multibyte character from being retrieved.  It is because
code relies on 'ungetc' ignoring a request to push back EOF, however in
the out-of-limit field width condition the data held is not EOF but the
previously retrieved character byte instead.

Fix this issue by artificially assigning EOF to the character byte
storage variable where the out-of-limit field width condition prevents
further processing, and also apply the fix throughout except for the
decimal point/thousands separator case, which uses different code.

Add test cases accordingly.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
12 days agomalloc: Fix checking for small negative values of tcache_key
Samuel Thibault [Sun, 10 Aug 2025 21:43:37 +0000 (23:43 +0200)] 
malloc: Fix checking for small negative values of tcache_key

tcache_key is unsigned so we should turn it explicitly to signed before
taking its absolute value.

12 days agomalloc: Make sure tcache_key is odd enough
Samuel Thibault [Tue, 29 Jul 2025 23:55:22 +0000 (01:55 +0200)] 
malloc: Make sure tcache_key is odd enough

We want tcache_key not to be a commonly-occurring value in memory, so ensure
a minimum amount of one and zero bits.

And we need it non-zero, otherwise even if tcache_double_free_verify sets
e->key to 0 before calling __libc_free, it gets called again by __libc_free,
thus looping indefinitely.

Fixes: c968fe50628db74b52124d863cd828225a1d305c ("malloc: Use tailcalls in __libc_free")
2 weeks agolocaledata: Add en_SE for ISO8601 dates
Andreas Schneider [Mon, 21 Jul 2025 08:00:27 +0000 (10:00 +0200)] 
localedata: Add en_SE for ISO8601 dates

On a Linux system you have two sources for locales: glibc and ICU.

ICU offeres a lot more languages than glibc. Especially when it comes to
en_*.

If you have an English system and want to use ISO8601 for date and time
format there is only one locale which can be used for that: en_SE

However ICU offers en_SE and glibc doesn't. If you set LC_TIME=en_SE a
lot of application wont start, because the locale is not known to glibc.

https://sourceware.org/bugzilla/show_bug.cgi?id=33190

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Mike FABIAN <mfabian@redhat.com>
2 weeks agomalloc: Fix MALLOC_DEBUG
Wilco Dijkstra [Fri, 8 Aug 2025 14:00:43 +0000 (14:00 +0000)] 
malloc: Fix MALLOC_DEBUG

MALLOC_DEBUG only works on locked arenas, so move the call to
check_inuse_chunk from __libc_free() to _int_free_chunk().
Regress now passes if MALLOC_DEBUG is enabled.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2 weeks agomalloc: Support THP in arenas
Wilco Dijkstra [Fri, 8 Aug 2025 14:00:11 +0000 (14:00 +0000)] 
malloc: Support THP in arenas

Arenas support huge pages but not transparent huge pages.  Add this by
also checking mp_.thp_pagesize when creating a new arena, and use madvise.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2 weeks agomalloc: Remove use of __curbrk
Wilco Dijkstra [Fri, 8 Aug 2025 13:59:31 +0000 (13:59 +0000)] 
malloc: Remove use of __curbrk

Remove an odd use of __curbrk and use MORECORE (0) instead.
This fixes Hurd build since it doesn't define this symbol.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2 weeks agoFilter machine compiler flags into Assembler Flags
Sachin Monga [Fri, 1 Aug 2025 09:35:11 +0000 (04:35 -0500)] 
Filter machine compiler flags into Assembler Flags

Assembler files may want or need to test for predefined macros which are
set via -m* compiler options, so ensure all -m* options in CFLAGS are passed
to ASFLAGS.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 weeks agotst-freopen4: Remove temporary directory from warning message
H.J. Lu [Tue, 5 Aug 2025 23:17:42 +0000 (16:17 -0700)] 
tst-freopen4: Remove temporary directory from warning message

tst-freopen4-main.c issues a warning message:

warning: could not remove temporary file: /tmp/tst-freopen4potgti: No such file or directory

since chroot makes generated temporary directories inaccessible.  Add
special rules for tst-freopen4.out and tst-freopen64-4.out to remove
the temporary directory in warning message from tst-freopen4 and
tst-freopen64-4.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agoRevert "tst-freopen4-main.c: Call support_capture_subprocess with chroot"
H.J. Lu [Tue, 5 Aug 2025 16:16:14 +0000 (09:16 -0700)] 
Revert "tst-freopen4-main.c: Call support_capture_subprocess with chroot"

Revert commit 6463d4a7b28e5ee3891c34a8a1f0a59c24dfa9de to fix

FAIL: stdio-common/tst-freopen4-mem
FAIL: stdio-common/tst-freopen64-4-mem

This fixes BZ #33254.

Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agoiconv: Fix iconv functions not following symlinks [BZ #32339]
Avinal Kumar [Mon, 14 Jul 2025 16:04:27 +0000 (21:34 +0530)] 
iconv: Fix iconv functions not following symlinks [BZ #32339]

On some file systems iconv do not follow symlinks.  This happens because
read_conf_file() function's directory traversal loop reject symbolic
links and then lstat64() call do not follow symlinks.

This commit fixes the directory traversal loop to accept symbolic links
and then follow the link using stat64().

The test works by creating a temporary directory and placing a symbolic
link inside it that points to a configuration file.  It then runs
iconvconfig on this directory.

The test passes if iconvconfig successfully follows the symlink and
generates the cache correctly, confirming that the directory traversal
logic now properly handles symbolic links.

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
Co-authored-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Reviewed-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
2 weeks agoLinux: Add test case for bug 33245
Florian Weimer [Sat, 2 Aug 2025 10:44:51 +0000 (12:44 +0200)] 
Linux: Add test case for bug 33245

The copy_file_range system call seems to be the only one that can
return an off64_t value.  Use FUSE to exercise this, without actually
creating such large files or copying any data.  Due to FUSE protocol
limitations, only sizes up to UINT_MAX can be tested, but this is
sufficient to check for the presence of bug 33245.

The FUSE protocol limitations are raised here:

  copy_file_range return value on FUSE
  <https://lore.kernel.org/all/lhuh5ynl8z5.fsf@oldenburg.str.redhat.com/>

Reviewed-by: Sam James <sam@gentoo.org>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2 weeks agoUse TLS initial-exec model for __libc_tsd_CTYPE_* thread variables [BZ #33234]
Jens Remus [Fri, 25 Jul 2025 13:40:03 +0000 (15:40 +0200)] 
Use TLS initial-exec model for __libc_tsd_CTYPE_* thread variables [BZ #33234]

Commit 10a66a8e421b ("Remove <libc-tsd.h>") removed the TLS initial-exec
(IE) model attribute from the __libc_tsd_CTYPE_* thread variable declarations
and definitions.  Commit a894f04d8776 ("Optimize __libc_tsd_* thread
variable access") restored it on declarations.

Restore the TLS initial-exec model attribute on __libc_tsd_CTYPE_* thread
variable definitions.

This resolves test tst-locale1 failure on s390 32-bit, when using a
GNU linker without the fix from GNU binutils commit aefebe82dc89
("IBM zSystems: Fix offset relative to static TLS").

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 weeks agoiconv: use bswap_32 instead of __builtin_bswap32
Collin Funk [Tue, 5 Aug 2025 08:07:18 +0000 (10:07 +0200)] 
iconv: use bswap_32 instead of __builtin_bswap32

This file uses a mix of both functions, prefer the non-builtin version.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 weeks agotst-env-setuid: Delete LD_DEBUG_OUTPUT output
H.J. Lu [Sat, 19 Jul 2025 14:43:29 +0000 (07:43 -0700)] 
tst-env-setuid: Delete LD_DEBUG_OUTPUT output

Update tst-env-setuid.c to delete LD_DEBUG_OUTPUT output, instead of
leaving it behind.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agotst-freopen4-main.c: Call support_capture_subprocess with chroot
H.J. Lu [Sat, 19 Jul 2025 14:43:28 +0000 (07:43 -0700)] 
tst-freopen4-main.c: Call support_capture_subprocess with chroot

Update tst-freopen4-main.c to call support_capture_subprocess with chroot,
which makes temporary files inaccessible, so that temporary files can be
deleted.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agotst-fopen-threaded.c: Delete temporary file
H.J. Lu [Sat, 19 Jul 2025 14:43:27 +0000 (07:43 -0700)] 
tst-fopen-threaded.c: Delete temporary file

Update tst-fopen-threaded.c to call support_create_temp_directory to
create a temporary directory and open "file" in the temporary directory,
instead of using /tmp/openclosetest and leaving it behind.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agoDelete temporary files in support_subprocess
H.J. Lu [Sat, 19 Jul 2025 14:43:26 +0000 (07:43 -0700)] 
Delete temporary files in support_subprocess

Call support_delete_temp_files to delete temporary files before exit in
support_subprocess.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agoRevert "Remove use of __curbrk."
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:56 +0000 (17:31 +0000)] 
Revert "Remove use of __curbrk."

This reverts commit 1ee0b771a9c0cd2b882fe7acd38deddb7d4fbef2.

2 weeks agoRevert "Improve MALLOC_DEBUG"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:54 +0000 (17:31 +0000)] 
Revert "Improve MALLOC_DEBUG"

This reverts commit 4b3e65682d1895a651653d82f05c66ead8dfcf3b.

2 weeks agoRevert "Enable THP on arenas"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:52 +0000 (17:31 +0000)] 
Revert "Enable THP on arenas"

This reverts commit 77d3e739360ebb49bae6ecfd4181e4e1692f6362.

2 weeks agoRevert "benchtests: Avoid overflow in random memcpy/memset benchmarks"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:51 +0000 (17:31 +0000)] 
Revert "benchtests: Avoid overflow in random memcpy/memset benchmarks"

This reverts commit 09604542d31abf1e35cd00c1db8d9bee9568bdd0.

2 weeks agoRevert "Use _int_free_chunk in tcache_thread_shutdown"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:49 +0000 (17:31 +0000)] 
Revert "Use _int_free_chunk in tcache_thread_shutdown"

This reverts commit 05ef6a49746faedb4262db1476449c1c2c822e95.

2 weeks agoRevert "Remove dumped heap support"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:47 +0000 (17:31 +0000)] 
Revert "Remove dumped heap support"

This reverts commit 8f57caa7fdcb7ab3016897a056ccf386061e7734.

2 weeks agoRevert "malloc: Cleanup libc_realloc"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:45 +0000 (17:31 +0000)] 
Revert "malloc: Cleanup libc_realloc"

This reverts commit dea1e52af38c20eae37ec09727f17ab8fde87f55.

2 weeks agoRevert "Change mmap representation"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:40 +0000 (17:31 +0000)] 
Revert "Change mmap representation"

This reverts commit 4b74591022e88639dcaefb8c4a2e405d301a59e2.

2 weeks agoRemove use of __curbrk.
Wilco Dijkstra [Mon, 4 Aug 2025 12:45:56 +0000 (12:45 +0000)] 
Remove use of __curbrk.

2 weeks agoImprove MALLOC_DEBUG
Wilco Dijkstra [Sat, 2 Aug 2025 17:18:57 +0000 (17:18 +0000)] 
Improve MALLOC_DEBUG

2 weeks agoEnable THP on arenas
Wilco Dijkstra [Wed, 30 Jul 2025 15:04:35 +0000 (15:04 +0000)] 
Enable THP on arenas

2 weeks agobenchtests: Avoid overflow in random memcpy/memset benchmarks
Wilco Dijkstra [Tue, 20 May 2025 15:56:14 +0000 (15:56 +0000)] 
benchtests: Avoid overflow in random memcpy/memset benchmarks

Use uint16_t rather than uint8_t for the size arrays.

2 weeks agoUse _int_free_chunk in tcache_thread_shutdown
Wilco Dijkstra [Thu, 3 Apr 2025 14:24:22 +0000 (14:24 +0000)] 
Use _int_free_chunk in tcache_thread_shutdown

2 weeks agoRemove dumped heap support
Wilco Dijkstra [Fri, 25 Jul 2025 12:16:40 +0000 (12:16 +0000)] 
Remove dumped heap support

2 weeks agomalloc: Cleanup libc_realloc
Wilco Dijkstra [Wed, 28 May 2025 15:17:43 +0000 (15:17 +0000)] 
malloc: Cleanup libc_realloc

Minor cleanup of libc_realloc: remove unnecessary special cases for mmap, move
ar_ptr initialization, first check for oldmem == NULL.

2 weeks agoChange mmap representation
Wilco Dijkstra [Thu, 10 Jul 2025 15:59:37 +0000 (15:59 +0000)] 
Change mmap representation

2 weeks agomanual: Adjust documentation to standardization of select
Collin Funk [Sat, 26 Jul 2025 04:15:12 +0000 (21:15 -0700)] 
manual: Adjust documentation to standardization of select

The select function, fd_set, and FD_* macros were standardized by POSIX
in the sys/select.h header. They are still defined in sys/types.h if
__USE_MISC is defined, but we should recommend the more portable and
standardized sys/select.h.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agomanual: Use sys/select.h instead of sys/time.h for select example.
Collin Funk [Fri, 25 Jul 2025 00:44:10 +0000 (17:44 -0700)] 
manual: Use sys/select.h instead of sys/time.h for select example.

The original example works on glibc since sys/time.h includes
sys/select.h. However, since POSIX requires that select is defined in
sys/select.h this change makes the example more portable.

Reported by Gavin Smith <gavinsmith0123@gmail.com> in:
<https://lists.gnu.org/archive/html/bug-texinfo/2025-07/msg00091.html>.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agomanual: document getsubopt standardization.
Collin Funk [Sat, 28 Jun 2025 06:13:48 +0000 (23:13 -0700)] 
manual: document getsubopt standardization.

The getsubopt function was an XSI extension since POSIX issue 4 until it
was added to Base in POSIX Issue 7.  This also adds the 'restrict'
qualifier to the arguments as done in POSIX.1-2024, and has been the
case in glibc.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agoerrlist: add missing entries for MIPS/SPARC
Luca Boccassi [Tue, 29 Jul 2025 12:07:58 +0000 (13:07 +0100)] 
errlist: add missing entries for MIPS/SPARC

These are defined in the kernel headers but missing from the list
of names, so strerrorname_np() returns NULL.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/uapi/asm/errno.h#n95
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/sparc/include/uapi/asm/errno.h#n55

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>