diff --git a/glibc-nolink-libc.patch b/glibc-nolink-libc.patch new file mode 100644 index 0000000..3626c02 --- /dev/null +++ b/glibc-nolink-libc.patch @@ -0,0 +1,211 @@ +commit 624acf596c5074ffc63ff697850cad4c8ef2e7ff +Author: Florian Weimer +Date: Tue Nov 12 20:09:33 2024 +0100 + + elf: Second ld.so relocation only if libc.so has been loaded + + Commit 8f8dd904c4a2207699bb666f30acceb5209c8d3f (“elf: + rtld_multiple_ref is always true”) removed some code that happened + to enable compatibility with programs that do not link against + libc.so. Such programs cannot call dlopen or any dynamic linker + functions (except __tls_get_addr), so this is not really useful. + Still ld.so should not crash with a null-pointer dereference + or undefined symbol reference in these cases. + + Perform the final relocation for ld.so right before relocating + libc.so (which seems more correct anyway), but only if libc.so + has been loaded. In the main relocation loop, call + _dl_relocate_object unconditionally because it already checks + if the object has been relocated. Only call __rtld_mutex_init + and __rtld_malloc_init_real if libc.so has been loaded. Otherwise, + the full implementations are not available. + + The previous concern regarding GOT updates through self-relocation + no longer applies because function pointers are updated + explicitly through __rtld_mutex_init and __rtld_malloc_init_real, + and not through relocation. + + Fixes commit 8f8dd904c4a2207699bb666f30acceb5209c8d3f (“elf: + rtld_multiple_ref is always true”). + +diff --git a/elf/Makefile b/elf/Makefile +index 3a1cb72955dc0eec..b044a2c2fa974905 100644 +--- a/elf/Makefile ++++ b/elf/Makefile +@@ -3169,3 +3169,20 @@ tst-rtld-no-malloc-audit-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so + + # Any shared object should do. + tst-rtld-no-malloc-preload-ENV = LD_PRELOAD=$(objpfx)tst-auditmod1.so ++ ++# These rules link and run the special elf/tst-nolink-libc-* tests if ++# a port adds them to the tests variables. Neither test variant is ++# linked against libc.so, but tst-nolink-libc-1 is linked against ++# ld.so. The test is always run directly, not under the dynamic ++# linker. ++CFLAGS-tst-nolink-libc.c += $(no-stack-protector) ++$(objpfx)tst-nolink-libc-1: $(objpfx)tst-nolink-libc.o $(objpfx)ld.so ++ $(LINK.o) -nostdlib -nostartfiles -o $@ $< \ ++ -Wl,--dynamic-linker=$(objpfx)ld.so,--no-as-needed $(objpfx)ld.so ++$(objpfx)tst-nolink-libc-1.out: $(objpfx)tst-nolink-libc-1 $(objpfx)ld.so ++ $< > $@ 2>&1; $(evaluate-test) ++$(objpfx)tst-nolink-libc-2: $(objpfx)tst-nolink-libc.o ++ $(LINK.o) -nostdlib -nostartfiles -o $@ $< \ ++ -Wl,--dynamic-linker=$(objpfx)ld.so ++$(objpfx)tst-nolink-libc-2.out: $(objpfx)tst-nolink-libc-2 $(objpfx)ld.so ++ $< > $@ 2>&1; $(evaluate-test) +diff --git a/elf/rtld.c b/elf/rtld.c +index b8cc3f605f9e053c..f54b1829af20881a 100644 +--- a/elf/rtld.c ++++ b/elf/rtld.c +@@ -2243,15 +2243,7 @@ dl_main (const ElfW(Phdr) *phdr, + + _rtld_main_check (main_map, _dl_argv[0]); + +- /* Now we have all the objects loaded. Relocate them all except for +- the dynamic linker itself. We do this in reverse order so that copy +- relocs of earlier objects overwrite the data written by later +- objects. We do not re-relocate the dynamic linker itself in this +- loop because that could result in the GOT entries for functions we +- call being changed, and that would break us. It is safe to relocate +- the dynamic linker out of order because it has no copy relocations. +- Likewise for libc, which is relocated early to ensure that IFUNC +- resolvers in libc work. */ ++ /* Now we have all the objects loaded. */ + + int consider_profiling = GLRO(dl_profile) != NULL; + +@@ -2259,9 +2251,19 @@ dl_main (const ElfW(Phdr) *phdr, + GLRO(dl_lazy) |= consider_profiling; + + if (GL(dl_ns)[LM_ID_BASE].libc_map != NULL) +- _dl_relocate_object (GL(dl_ns)[LM_ID_BASE].libc_map, +- GL(dl_ns)[LM_ID_BASE].libc_map->l_scope, +- GLRO(dl_lazy) ? RTLD_LAZY : 0, consider_profiling); ++ { ++ /* If libc.so has been loaded, relocate it early, after the ++ dynamic loader itself. */ ++ RTLD_TIMING_VAR (start); ++ rtld_timer_start (&start); ++ ++ _dl_relocate_object_no_relro (&GL(dl_rtld_map), main_map->l_scope, 0, 0); ++ _dl_relocate_object (GL(dl_ns)[LM_ID_BASE].libc_map, ++ GL(dl_ns)[LM_ID_BASE].libc_map->l_scope, ++ GLRO(dl_lazy) ? RTLD_LAZY : 0, consider_profiling); ++ ++ rtld_timer_accum (&relocate_time, start); ++ } + + RTLD_TIMING_VAR (start); + rtld_timer_start (&start); +@@ -2284,9 +2286,8 @@ dl_main (const ElfW(Phdr) *phdr, + /* Also allocated with the fake malloc(). */ + l->l_free_initfini = 0; + +- if (l != &GL(dl_rtld_map)) +- _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0, +- consider_profiling); ++ _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0, ++ consider_profiling); + + /* Add object to slot information data if necessasy. */ + if (l->l_tls_blocksize != 0 && __rtld_tls_init_tp_called) +@@ -2324,27 +2325,18 @@ dl_main (const ElfW(Phdr) *phdr, + /* Set up the object lookup structures. */ + _dl_find_object_init (); + +- /* Likewise for the locking implementation. */ +- __rtld_mutex_init (); +- +- /* Re-relocate ourselves with user-controlled symbol definitions. */ +- +- { +- RTLD_TIMING_VAR (start); +- rtld_timer_start (&start); +- +- _dl_relocate_object_no_relro (&GL(dl_rtld_map), main_map->l_scope, 0, 0); +- +- /* The malloc implementation has been relocated, so resolving +- its symbols (and potentially calling IFUNC resolvers) is safe +- at this point. */ +- __rtld_malloc_init_real (main_map); +- +- if (GL(dl_rtld_map).l_relro_size != 0) +- _dl_protect_relro (&GL(dl_rtld_map)); ++ /* If libc.so was loaded, ld.so has been fully relocated along with ++ it. Complete ld.so initialization with mutex symbols from ++ libc.so and malloc symbols from the global scope. */ ++ if (GL(dl_ns)[LM_ID_BASE].libc_map != NULL) ++ { ++ __rtld_mutex_init (); ++ __rtld_malloc_init_real (main_map); ++ } + +- rtld_timer_accum (&relocate_time, start); +- } ++ /* All ld.so initialization is complete. Apply RELRO. */ ++ if (GL(dl_rtld_map).l_relro_size != 0) ++ _dl_protect_relro (&GL(dl_rtld_map)); + + /* Relocation is complete. Perform early libc initialization. This + is the initial libc, even if audit modules have been loaded with +diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile +index 527c7a5ae898acea..a3f7fc4054f5d54d 100644 +--- a/sysdeps/unix/sysv/linux/Makefile ++++ b/sysdeps/unix/sysv/linux/Makefile +@@ -652,7 +652,12 @@ install-bin += \ + # install-bin + + $(objpfx)pldd: $(objpfx)xmalloc.o ++ ++test-internal-extras += tst-nolink-libc ++ifeq ($(run-built-tests),yes) ++tests-special += $(objpfx)tst-nolink-libc-1.out $(objpfx)tst-nolink-libc-2.out + endif ++endif # $(subdir) == elf + + ifeq ($(subdir),rt) + CFLAGS-mq_send.c += -fexceptions +diff --git a/sysdeps/unix/sysv/linux/arm/Makefile b/sysdeps/unix/sysv/linux/arm/Makefile +index a73c897f43c9a206..e73ce4f81114e789 100644 +--- a/sysdeps/unix/sysv/linux/arm/Makefile ++++ b/sysdeps/unix/sysv/linux/arm/Makefile +@@ -1,5 +1,8 @@ + ifeq ($(subdir),elf) + sysdep-rtld-routines += aeabi_read_tp libc-do-syscall ++# The test uses INTERNAL_SYSCALL_CALL. In thumb mode, this uses ++# an undefined reference to __libc_do_syscall. ++CFLAGS-tst-nolink-libc.c += -marm + endif + + ifeq ($(subdir),misc) +diff --git a/sysdeps/unix/sysv/linux/tst-nolink-libc.c b/sysdeps/unix/sysv/linux/tst-nolink-libc.c +new file mode 100644 +index 0000000000000000..817f37784b4080f9 +--- /dev/null ++++ b/sysdeps/unix/sysv/linux/tst-nolink-libc.c +@@ -0,0 +1,25 @@ ++/* Test program not linked against libc.so and not using any glibc functions. ++ Copyright (C) 2024 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++ ++void ++_start (void) ++{ ++ INTERNAL_SYSCALL_CALL (exit_group, 0); ++} diff --git a/glibc-rh2327564-1.patch b/glibc-rh2327564-1.patch new file mode 100644 index 0000000..698bc6b --- /dev/null +++ b/glibc-rh2327564-1.patch @@ -0,0 +1,158 @@ +commit d115e98ad627fae62679bc18e3bf062a898860cb +Author: Florian Weimer +Date: Wed Nov 20 19:21:45 2024 +0100 + + Revert "AArch64: Remove memset-reg.h" + + This reverts commit 8ecb477ea16a387a44ace5bf59d39a7e270b238b. + +diff --git a/sysdeps/aarch64/memset-reg.h b/sysdeps/aarch64/memset-reg.h +new file mode 100644 +index 0000000000000000..6c7f60b37edf3b11 +--- /dev/null ++++ b/sysdeps/aarch64/memset-reg.h +@@ -0,0 +1,30 @@ ++/* Register aliases for memset to be used across implementations. ++ Copyright (C) 2017-2024 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#define dstin x0 ++#define val x1 ++#define valw w1 ++#define count x2 ++#define dst x3 ++#define dstend x4 ++#define tmp1 x5 ++#define tmp1w w5 ++#define tmp2 x6 ++#define tmp2w w6 ++#define zva_len x7 ++#define zva_lenw w7 +diff --git a/sysdeps/aarch64/memset.S b/sysdeps/aarch64/memset.S +index b76dde1557ed8fb1..caafb019e2b6217b 100644 +--- a/sysdeps/aarch64/memset.S ++++ b/sysdeps/aarch64/memset.S +@@ -30,6 +30,7 @@ + */ + + #define dstin x0 ++#define val x1 + #define valw w1 + #define count x2 + #define dst x3 +diff --git a/sysdeps/aarch64/multiarch/memset_a64fx.S b/sysdeps/aarch64/multiarch/memset_a64fx.S +index f665b5a891433c1c..2e6d882fc931a882 100644 +--- a/sysdeps/aarch64/multiarch/memset_a64fx.S ++++ b/sysdeps/aarch64/multiarch/memset_a64fx.S +@@ -18,6 +18,7 @@ + . */ + + #include ++#include + + /* Assumptions: + * +@@ -35,14 +36,6 @@ + + .arch armv8.2-a+sve + +-#define dstin x0 +-#define valw w1 +-#define count x2 +-#define dst x3 +-#define dstend x4 +-#define tmp1 x5 +-#define tmp2 x6 +- + .macro st1b_unroll first=0, last=7 + st1b z0.b, p0, [dst, \first, mul vl] + .if \last-\first +diff --git a/sysdeps/aarch64/multiarch/memset_emag.S b/sysdeps/aarch64/multiarch/memset_emag.S +index cf1b25f2edf64900..6d714ed0e1b396ef 100644 +--- a/sysdeps/aarch64/multiarch/memset_emag.S ++++ b/sysdeps/aarch64/multiarch/memset_emag.S +@@ -18,6 +18,7 @@ + . */ + + #include ++#include "memset-reg.h" + + /* Assumptions: + * +@@ -25,13 +26,6 @@ + * + */ + +-#define dstin x0 +-#define val x1 +-#define valw w1 +-#define count x2 +-#define dst x3 +-#define dstend x4 +- + ENTRY (__memset_emag) + + PTR_ARG (0) +diff --git a/sysdeps/aarch64/multiarch/memset_kunpeng.S b/sysdeps/aarch64/multiarch/memset_kunpeng.S +index f815c20b0383f057..7b215501376cbe03 100644 +--- a/sysdeps/aarch64/multiarch/memset_kunpeng.S ++++ b/sysdeps/aarch64/multiarch/memset_kunpeng.S +@@ -18,6 +18,7 @@ + . */ + + #include ++#include + + /* Assumptions: + * +@@ -25,12 +26,6 @@ + * + */ + +-#define dstin x0 +-#define valw w1 +-#define count x2 +-#define dst x3 +-#define dstend x4 +- + ENTRY (__memset_kunpeng) + + PTR_ARG (0) +diff --git a/sysdeps/aarch64/multiarch/memset_oryon1.S b/sysdeps/aarch64/multiarch/memset_oryon1.S +index 6fa28a9bd030a705..b43a43b54e1b3439 100644 +--- a/sysdeps/aarch64/multiarch/memset_oryon1.S ++++ b/sysdeps/aarch64/multiarch/memset_oryon1.S +@@ -19,18 +19,12 @@ + . */ + + #include ++#include "memset-reg.h" + + /* Assumptions: + ARMv8-a, AArch64, unaligned accesses + */ + +-#define dstin x0 +-#define val x1 +-#define valw w1 +-#define count x2 +-#define dst x3 +-#define dstend x4 +- + ENTRY (__memset_oryon1) + + PTR_ARG (0) diff --git a/glibc-rh2327564-2.patch b/glibc-rh2327564-2.patch new file mode 100644 index 0000000..4afd43b --- /dev/null +++ b/glibc-rh2327564-2.patch @@ -0,0 +1,276 @@ +commit b26c53ecc4dd3bc48b11e09f6ddc7c1441e126c2 +Author: Florian Weimer +Date: Wed Nov 20 19:21:48 2024 +0100 + + Revert "AArch64: Optimize memset" + + This reverts commit cec3aef32412779e207f825db0d057ebb4628ae8. + +diff --git a/sysdeps/aarch64/memset.S b/sysdeps/aarch64/memset.S +index caafb019e2b6217b..7ef77ee8c926de21 100644 +--- a/sysdeps/aarch64/memset.S ++++ b/sysdeps/aarch64/memset.S +@@ -1,5 +1,4 @@ +-/* Generic optimized memset using SIMD. +- Copyright (C) 2012-2024 Free Software Foundation, Inc. ++/* Copyright (C) 2012-2024 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + +@@ -18,6 +17,7 @@ + . */ + + #include ++#include "memset-reg.h" + + #ifndef MEMSET + # define MEMSET memset +@@ -25,132 +25,130 @@ + + /* Assumptions: + * +- * ARMv8-a, AArch64, Advanced SIMD, unaligned accesses. ++ * ARMv8-a, AArch64, unaligned accesses + * + */ + +-#define dstin x0 +-#define val x1 +-#define valw w1 +-#define count x2 +-#define dst x3 +-#define dstend x4 +-#define zva_val x5 +-#define off x3 +-#define dstend2 x5 +- + ENTRY (MEMSET) ++ + PTR_ARG (0) + SIZE_ARG (2) + + dup v0.16B, valw +- cmp count, 16 +- b.lo L(set_small) +- + add dstend, dstin, count +- cmp count, 64 +- b.hs L(set_128) + +- /* Set 16..63 bytes. */ +- mov off, 16 +- and off, off, count, lsr 1 +- sub dstend2, dstend, off +- str q0, [dstin] +- str q0, [dstin, off] +- str q0, [dstend2, -16] +- str q0, [dstend, -16] +- ret ++ cmp count, 96 ++ b.hi L(set_long) ++ cmp count, 16 ++ b.hs L(set_medium) ++ mov val, v0.D[0] + +- .p2align 4 + /* Set 0..15 bytes. */ +-L(set_small): +- add dstend, dstin, count +- cmp count, 4 +- b.lo 2f +- lsr off, count, 3 +- sub dstend2, dstend, off, lsl 2 +- str s0, [dstin] +- str s0, [dstin, off, lsl 2] +- str s0, [dstend2, -4] +- str s0, [dstend, -4] ++ tbz count, 3, 1f ++ str val, [dstin] ++ str val, [dstend, -8] ++ ret ++ nop ++1: tbz count, 2, 2f ++ str valw, [dstin] ++ str valw, [dstend, -4] + ret +- +- /* Set 0..3 bytes. */ + 2: cbz count, 3f +- lsr off, count, 1 + strb valw, [dstin] +- strb valw, [dstin, off] +- strb valw, [dstend, -1] ++ tbz count, 1, 3f ++ strh valw, [dstend, -2] + 3: ret + ++ /* Set 17..96 bytes. */ ++L(set_medium): ++ str q0, [dstin] ++ tbnz count, 6, L(set96) ++ str q0, [dstend, -16] ++ tbz count, 5, 1f ++ str q0, [dstin, 16] ++ str q0, [dstend, -32] ++1: ret ++ + .p2align 4 +-L(set_128): +- bic dst, dstin, 15 +- cmp count, 128 +- b.hi L(set_long) +- stp q0, q0, [dstin] ++ /* Set 64..96 bytes. Write 64 bytes from the start and ++ 32 bytes from the end. */ ++L(set96): ++ str q0, [dstin, 16] + stp q0, q0, [dstin, 32] +- stp q0, q0, [dstend, -64] + stp q0, q0, [dstend, -32] + ret + +- .p2align 4 ++ .p2align 3 ++ nop + L(set_long): ++ and valw, valw, 255 ++ bic dst, dstin, 15 + str q0, [dstin] +- str q0, [dst, 16] +- tst valw, 255 +- b.ne L(no_zva) +-#ifndef ZVA64_ONLY +- mrs zva_val, dczid_el0 +- and zva_val, zva_val, 31 +- cmp zva_val, 4 /* ZVA size is 64 bytes. */ +- b.ne L(zva_128) +-#endif +- stp q0, q0, [dst, 32] +- bic dst, dstin, 63 +- sub count, dstend, dst /* Count is now 64 too large. */ +- sub count, count, 64 + 64 /* Adjust count and bias for loop. */ +- +- /* Write last bytes before ZVA loop. */ +- stp q0, q0, [dstend, -64] +- stp q0, q0, [dstend, -32] +- +- .p2align 4 +-L(zva64_loop): +- add dst, dst, 64 +- dc zva, dst ++ cmp count, 256 ++ ccmp valw, 0, 0, cs ++ b.eq L(try_zva) ++L(no_zva): ++ sub count, dstend, dst /* Count is 16 too large. */ ++ sub dst, dst, 16 /* Dst is biased by -32. */ ++ sub count, count, 64 + 16 /* Adjust count and bias for loop. */ ++1: stp q0, q0, [dst, 32] ++ stp q0, q0, [dst, 64]! ++L(tail64): + subs count, count, 64 +- b.hi L(zva64_loop) ++ b.hi 1b ++2: stp q0, q0, [dstend, -64] ++ stp q0, q0, [dstend, -32] + ret + ++L(try_zva): ++#ifndef ZVA64_ONLY + .p2align 3 +-L(no_zva): +- sub count, dstend, dst /* Count is 32 too large. */ +- sub count, count, 64 + 32 /* Adjust count and bias for loop. */ +-L(no_zva_loop): ++ mrs tmp1, dczid_el0 ++ tbnz tmp1w, 4, L(no_zva) ++ and tmp1w, tmp1w, 15 ++ cmp tmp1w, 4 /* ZVA size is 64 bytes. */ ++ b.ne L(zva_128) ++ nop ++#endif ++ /* Write the first and last 64 byte aligned block using stp rather ++ than using DC ZVA. This is faster on some cores. ++ */ ++ .p2align 4 ++L(zva_64): ++ str q0, [dst, 16] + stp q0, q0, [dst, 32] ++ bic dst, dst, 63 + stp q0, q0, [dst, 64] ++ stp q0, q0, [dst, 96] ++ sub count, dstend, dst /* Count is now 128 too large. */ ++ sub count, count, 128+64+64 /* Adjust count and bias for loop. */ ++ add dst, dst, 128 ++1: dc zva, dst + add dst, dst, 64 + subs count, count, 64 +- b.hi L(no_zva_loop) ++ b.hi 1b ++ stp q0, q0, [dst, 0] ++ stp q0, q0, [dst, 32] + stp q0, q0, [dstend, -64] + stp q0, q0, [dstend, -32] + ret + + #ifndef ZVA64_ONLY +- .p2align 4 ++ .p2align 3 + L(zva_128): +- cmp zva_val, 5 /* ZVA size is 128 bytes. */ +- b.ne L(no_zva) ++ cmp tmp1w, 5 /* ZVA size is 128 bytes. */ ++ b.ne L(zva_other) + ++ str q0, [dst, 16] + stp q0, q0, [dst, 32] + stp q0, q0, [dst, 64] + stp q0, q0, [dst, 96] + bic dst, dst, 127 + sub count, dstend, dst /* Count is now 128 too large. */ +- sub count, count, 128 + 128 /* Adjust count and bias for loop. */ +-1: add dst, dst, 128 +- dc zva, dst ++ sub count, count, 128+128 /* Adjust count and bias for loop. */ ++ add dst, dst, 128 ++1: dc zva, dst ++ add dst, dst, 128 + subs count, count, 128 + b.hi 1b + stp q0, q0, [dstend, -128] +@@ -158,6 +156,35 @@ L(zva_128): + stp q0, q0, [dstend, -64] + stp q0, q0, [dstend, -32] + ret ++ ++L(zva_other): ++ mov tmp2w, 4 ++ lsl zva_lenw, tmp2w, tmp1w ++ add tmp1, zva_len, 64 /* Max alignment bytes written. */ ++ cmp count, tmp1 ++ blo L(no_zva) ++ ++ sub tmp2, zva_len, 1 ++ add tmp1, dst, zva_len ++ add dst, dst, 16 ++ subs count, tmp1, dst /* Actual alignment bytes to write. */ ++ bic tmp1, tmp1, tmp2 /* Aligned dc zva start address. */ ++ beq 2f ++1: stp q0, q0, [dst], 64 ++ stp q0, q0, [dst, -32] ++ subs count, count, 64 ++ b.hi 1b ++2: mov dst, tmp1 ++ sub count, dstend, tmp1 /* Remaining bytes to write. */ ++ subs count, count, zva_len ++ b.lo 4f ++3: dc zva, dst ++ add dst, dst, zva_len ++ subs count, count, zva_len ++ b.hs 3b ++4: add count, count, zva_len ++ sub dst, dst, 32 /* Bias dst for tail loop. */ ++ b L(tail64) + #endif + + END (MEMSET) diff --git a/glibc-rh827510.patch b/glibc-rh827510.patch deleted file mode 100644 index 6115891..0000000 --- a/glibc-rh827510.patch +++ /dev/null @@ -1,37 +0,0 @@ -Short description: Fix newlocale error return. -Author(s): Fedora glibc team -Origin: PATCH -Bug-RHEL: #832516 -Bug-Fedora: #827510 -Bug-Upstream: #14247 -Upstream status: not-submitted - -This needs to go upstream right away to fix the error case for -newlocale not correctly returning an error. - -2012-06-14 Jeff Law - - * locale/loadlocale.c (_nl_load_locale): Delay setting - file->decided until we have successfully loaded the file's - data. - -diff --git a/locale/loadlocale.c b/locale/loadlocale.c -index e3fa187..9fd9216 100644 ---- a/locale/loadlocale.c -+++ b/locale/loadlocale.c -@@ -169,7 +169,6 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) - int save_err; - int alloc = ld_mapped; - -- file->decided = 1; - file->data = NULL; - - fd = __open_nocancel (file->filename, O_RDONLY | O_CLOEXEC); -@@ -278,6 +277,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) - newdata->alloc = alloc; - - file->data = newdata; -+ file->decided = 1; - } - - void diff --git a/glibc.spec b/glibc.spec index 8fb5437..06e1ead 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,5 +1,5 @@ -%global glibcsrcdir glibc-2.38.9000-530-gddf542da94 -%global glibcversion 2.38.9000 +%global glibcsrcdir glibc-2.40.9000-399-ge2436d6f5a +%global glibcversion 2.40.9000 # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -61,6 +61,13 @@ %endif %endif +# Build the POWER10 multilib. +%ifarch ppc64le +%define buildpower10 1 +%else +%define buildpower10 0 +%endif + %if %{with bootstrap} # Disable benchtests, -Werror, docs, and valgrind if we're bootstrapping %undefine with_benchtests @@ -69,43 +76,10 @@ %undefine with_valgrind %endif -# The annobin annotations cause binutils to produce broken ARM EABI -# unwinding information. Symptom is a hang/test failure for -# malloc/tst-malloc-stats-cancellation. See -# . -%ifarch armv7hl -%undefine _annotated_build -%endif - # We do our own build flags management. In particular, see -# rpm_inherit_flags below. +# glibc_shell_* below. %undefine _auto_set_build_flags -############################################################################## -# Any architecture/kernel combination that supports running 32-bit and 64-bit -# code in userspace is considered a biarch arch. -%global biarcharches %{ix86} x86_64 s390 s390x - -# Avoid generating a glibc-headers package on architectures which are -# not biarch. -%ifarch %{biarcharches} -%global need_headers_package 1 -%if 0%{?rhel} > 0 -%global headers_package_name glibc-headers -%else -%ifarch %{ix86} x86_64 -%global headers_package_name glibc-headers-x86 -%endif -%ifarch s390 s390x -%global headers_package_name glibc-headers-s390 -%endif -%dnl !rhel -%endif -%else -%global need_headers_package 0 -%dnl !biarcharches -%endif - ############################################################################## # Utility functions for pre/post scripts. Stick them at the beginning of # any lua %pre, %post, %postun, etc. sections to have them expand into @@ -125,20 +99,27 @@ -- Open-code rpm.execute with error message handling. function post_exec (msg, program, ...) - local pid = posix.fork () - if pid == 0 then - posix.exec (program, ...) - io.stdout:write (msg) - assert (nil) - elseif pid > 0 then - posix.wait (pid) + if rpm.spawn ~= nil then + local status = rpm.spawn ({program, ...}) + if status == nil then + io.stdout:write (msg) + assert (nil) + end + else + local pid = posix.fork () + if pid == 0 then + posix.exec (program, ...) + io.stdout:write (msg) + assert (nil) + elseif pid > 0 then + posix.wait (pid) + end end end --- Note: We use _prefix because Fedora's UsrMove says so. function call_ldconfig () - post_exec("Error: call to %{_prefix}/sbin/ldconfig failed.\n", - "%{_prefix}/sbin/ldconfig") + post_exec("Error: call to ldconfig failed.\n", + "ldconfig") end function update_gconv_modules_cache () @@ -171,35 +152,60 @@ Version: %{glibcversion} # - It allows using the Release number without the %%dist tag in the dependency # generator to make the generated requires interchangeable between Rawhide # and ELN (.elnYY < .fcXX). -%global baserelease 39 -Release: %{baserelease}.0.riscv64%{?dist} +%global baserelease 21 +Release: %{baserelease}%{?dist} -# In general, GPLv2+ is used by programs, LGPLv2+ is used for -# libraries. +# Licenses: # -# LGPLv2+ with exceptions is used for things that are linked directly -# into dynamically linked programs and shared libraries (e.g. crt -# files, lib*_nonshared.a). Historically, this exception also applies -# to parts of libio. +# High level license status of the glibc source tree: # -# GPLv2+ with exceptions is used for parts of the Arm unwinder. +# * In general, GPLv2+ is used by programs, LGPLv2+ is used for +# libraries. # -# GFDL is used for the documentation. +# * LGPLv2+ with exceptions is used for things that are linked directly +# into dynamically linked programs and shared libraries (e.g. crt +# files, lib*_nonshared.a). Historically, this exception also applies +# to parts of libio. # -# Some other licenses are used in various places (BSD, Inner-Net, -# ISC, Public Domain). +# * GPLv2+ with exceptions is used for parts of the Arm unwinder. # -# HSRL and FSFAP are only used in test cases, which currently do not -# ship in binary RPMs, so they are not listed here. MIT is used for -# scripts/install-sh, which does not ship, either. +# * GFDL is used for the documentation. # -# GPLv3+ is used by manual/texinfo.tex, which we do not use. +# * UNICODE v3 is used for the Unicode data files. # -# LGPLv3+ is used by some Hurd code, which we do not build. +# * Some other licenses are used in various places (BSD, Inner-Net, +# ISC, Public Domain, etc.). # -# LGPLv2 is used in one place (time/timespec_get.c, by mistake), but -# it is not actually compiled, so it does not matter for libraries. -License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL +# Licenses that make an appearance in the source tree but are not used: +# +# * HSRL and FSFAP are only used in test cases, which currently do not +# ship in binary RPMs, so they are not listed here. +# +# * GPLv3+ is used by manual/texinfo.tex, which we do not use and a test and +# some scripts that we do not ship, and so it is not listed here. +# +# * LGPLv3+ is used by some Hurd code, which we do not build. +# +# * A copyleft license is used in posix/runtests.c, but it is only a test +# case and so the license is not listed here. +# +# * A "PCRE License" is used by PCRE.tests, but it is only a test case and +# so the license is not listed here. +# +# * BSL-1.0 is only used by a test from boost and so the license is not +# listed here. +# +# * Unlicense is used in an OpenRISC 1000 file which we don't support. +# +# SPDX references: +# https://spdx.org/licenses +# https://docs.fedoraproject.org/en-US/legal/allowed-licenses +# https://gitlab.com/fedora/legal/fedora-license-data +# +# SPDX license string based on evaluation of glibc-2.39 sources by +# ScanCode toolkit (https://github.com/nexB/scancode-toolkit), +# and accounting for exceptions listed above: +License: LGPL-2.1-or-later AND SunPro AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.1-or-later WITH GNU-compiler-exception AND GPL-2.0-only AND ISC AND LicenseRef-Fedora-Public-Domain AND HPND AND CMU-Mach AND LGPL-2.0-or-later AND Unicode-3.0 AND GFDL-1.1-or-later AND GPL-1.0-or-later AND FSFUL AND MIT AND Inner-Net-2.0 AND X11 AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GFDL-1.3-only AND GFDL-1.1-only URL: http://www.gnu.org/software/glibc/ Source0: %{?glibc_release_url}%{glibcsrcdir}.tar.xz @@ -212,6 +218,75 @@ Source11: parse-SUPPORTED.py # Include in the source RPM for reference. Source12: ChangeLog.old +# glibc_ldso: ABI-specific program interpreter name. Used for debuginfo +# extraction (wrap-find-debuginfo.sh) and smoke testing ($run_ldso below). +# +# glibc_has_libnldbl: -lnldbl is supported for long double as double. +# +# glibc_has_libmvec: libmvec is available. +# +# glibc_rtld_early_cflags: The ABI baseline for architectures with +# potentially a later baseline. The --with-rtld-early-cflags= +# configure option is passed to the main glibc build if this macro is +# defined. +%ifarch %{ix86} +%global glibc_ldso /lib/ld-linux.so.2 +%global glibc_has_libnldbl 0 +%global glibc_has_libmvec 0 +%endif +%ifarch aarch64 +%global glibc_ldso /lib/ld-linux-aarch64.so.1 +%global glibc_has_libnldbl 0 +%global glibc_has_libmvec 1 +%endif +%ifarch ppc +%global glibc_ldso /lib/ld.so.1 +%global glibc_has_libnldbl 1 +%global glibc_has_libmvec 0 +%endif +%ifarch ppc64 +%global glibc_ldso /lib64/ld64.so.1 +%global glibc_has_libnldbl 1 +%global glibc_has_libmvec 0 +%endif +%ifarch ppc64le +%global glibc_ldso /lib64/ld64.so.2 +%global glibc_has_libnldbl 1 +%global glibc_has_libmvec 0 +%define glibc_rtld_early_cflags -mcpu=power8 +%endif +%ifarch riscv64 +%global glibc_ldso /lib/ld-linux-riscv64-lp64d.so.1 +%global glibc_has_libnldbl 0 +%global glibc_has_libmvec 0 +%endif +%ifarch s390 +%global glibc_ldso /lib/ld.so.1 +%global glibc_has_libnldbl 1 +%global glibc_has_libmvec 0 +%define glibc_rtld_early_cflags -march=z13 +%endif +%ifarch s390x +%global glibc_ldso /lib/ld64.so.1 +%global glibc_has_libnldbl 1 +%global glibc_has_libmvec 0 +%define glibc_rtld_early_cflags -march=z13 +%endif +%ifarch x86_64 x86_64_v2 x86_64_v3 x86_64_v4 +%global glibc_ldso /lib64/ld-linux-x86-64.so.2 +%global glibc_has_libnldbl 0 +%global glibc_has_libmvec 1 +%define glibc_rtld_early_cflags -march=x86-64 +%endif + +# This is necessary to enable source RPM building under noarch, as +# used by some build environments. +%ifarch noarch +%global glibc_ldso /lib/ld.so +%global glibc_has_libnldbl 0 +%global glibc_has_libmvec 0 +%endif + ###################################################################### # Activate the wrapper script for debuginfo generation, by rewriting # the definition of __debug_install_post. @@ -223,7 +298,7 @@ local original = rpm.expand("%{macrobody:__debug_install_post}") -- Avoid embedded newlines that confuse the macro definition. original = original:match("^%s*(.-)%s*$"):gsub("\\\n", "") rpm.define("__debug_install_post bash " .. wrapper - .. " " .. sysroot .. " " .. original) + .. " " .. sysroot .. " %{_prefix}%{glibc_ldso} " .. original) } # sysroot package support. These contain arch-specific packages, so @@ -244,6 +319,18 @@ rpm.define("__debug_install_post bash " .. wrapper %global _no_recompute_build_ids 1 %undefine _unique_build_ids +%ifarch %{ix86} +# The memory tracing tools (like mtrace, memusage) in glibc-utils only work +# when the corresponding memory tracing libraries are preloaded. So we ship +# memory allocation tracing/checking libraries in glibc-utils, except on +# i686 where we need to ship them in glibc.i686. This is because +# glibc-utils.x86_64 will contain only the 64-bit version of these +# libraries. +%global glibc_ship_tracelibs_in_utils 0 +%else +%global glibc_ship_tracelibs_in_utils 1 +%endif + ############################################################################## # Patches: # - See each individual patch file for origin and upstream status. @@ -251,10 +338,10 @@ rpm.define("__debug_install_post bash " .. wrapper ############################################################################## Patch4: glibc-fedora-linux-tcsetattr.patch Patch8: glibc-fedora-manual-dircategory.patch -Patch9: glibc-rh827510.patch Patch13: glibc-fedora-localedata-rh61908.patch Patch17: glibc-cs-path.patch Patch23: glibc-python3.patch +Patch24: glibc-nolink-libc.patch ############################################################################## # Continued list of core "glibc" package information: @@ -262,8 +349,14 @@ Patch23: glibc-python3.patch Obsoletes: glibc-profile < 2.4 Obsoletes: nscd < 2.35 Provides: ldconfig +%if "%{_sbindir}" == "%{_bindir}" +# We rely on filesystem to create the compat symlinks for us +Requires: filesystem(unmerged-sbin-symlinks) +%endif Provides: /sbin/ldconfig Provides: /usr/sbin/ldconfig +# Historic file paths provided for backwards compatibility. +Provides: %{glibc_ldso} # The dynamic linker supports DT_GNU_HASH Provides: rtld(GNU_HASH) @@ -285,6 +378,10 @@ Requires: basesystem # after nss_*.x86_64. (See below for the other ordering.) Recommends: (nss_db(x86-32) if nss_db(x86-64)) Recommends: (nss_hesiod(x86-32) if nss_hesiod(x86-64)) +# Deinstall the glibc32 package if present. This helps tests that do +# not run against the compose. +Conflicts: glibc32 <= %{version}-%{release} +Obsoletes: glibc32 <= %{version}-%{release} %endif # This is for building auxiliary programs like memusage @@ -324,10 +421,7 @@ BuildRequires: python3 python3-devel BuildRequires: gcc >= 7.2.1-6 %global enablekernel 3.2 Conflicts: kernel < %{enablekernel} -%global target %{_target_cpu}-redhat-linux -%ifarch %{arm} -%global target %{_target_cpu}-redhat-linuxeabi -%endif +%define target %{_target_cpu}-redhat-linux %ifarch ppc64le %global target ppc64le-redhat-linux %endif @@ -421,14 +515,21 @@ Requires: %{name} = %{version}-%{release} Requires: libxcrypt-devel%{_isa} >= 4.0.0 Requires: kernel-headers >= 3.2 BuildRequires: kernel-headers >= 3.2 -%if %{need_headers_package} -Requires: %{headers_package_name} = %{version}-%{release} -%endif -%if !(0%{?rhel} > 0 && %{need_headers_package}) # For backwards compatibility, when the glibc-headers package existed. Provides: glibc-headers = %{version}-%{release} Provides: glibc-headers(%{_target_cpu}) Obsoletes: glibc-headers < %{version}-%{release} +# For backwards compatibility with alternative Fedora approach to +# work around multilib issue in composes. +%if 0%{?fedora} +%ifarch x86_64 +Provides: glibc-headers-x86 = %{version}-%{release} +Obsoletes: glibc-headers-x86 < %{version}-%{release} +%endif +%ifarch s390x +Provides: glibc-headers-s390 = %{version}-%{release} +Obsoletes: glibc-headers-s390 < %{version}-%{release} +%endif %endif %description devel @@ -475,32 +576,6 @@ The glibc-static package contains the C library static libraries for -static linking. You don't need these, unless you link statically, which is highly discouraged. -############################################################################## -# glibc "headers" sub-package -# - The headers package includes all common headers that are shared amongst -# the multilib builds. It avoids file conflicts between the architecture- -# specific glibc-devel variants. -# Files like gnu/stubs.h which have gnu/stubs-32.h (i686) and gnu/stubs-64.h -# are included in glibc-headers, but the -32 and -64 files are in their -# respective i686 and x86_64 devel packages. -############################################################################## -%if %{need_headers_package} -%package -n %{headers_package_name} -Summary: Additional internal header files for glibc-devel. -Requires: %{name} = %{version}-%{release} -%if 0%{?rhel} > 0 -Provides: %{name}-headers(%{_target_cpu}) -Obsoletes: glibc-headers-x86 < %{version}-%{release} -Obsoletes: glibc-headers-s390 < %{version}-%{release} -%else -BuildArch: noarch -%endif - -%description -n %{headers_package_name} -The %{headers_package_name} package contains the architecture-specific -header files which cannot be included in glibc-devel package. -%endif - ############################################################################## # glibc "common" sub-package ############################################################################## @@ -509,6 +584,11 @@ Summary: Common binaries and locale data for glibc Requires: %{name} = %{version}-%{release} Recommends: tzdata >= 2003a +%if "%{_sbindir}" == "%{_bindir}" +# We rely on filesystem to create the compat symlinks for us +Requires: filesystem(unmerged-sbin-symlinks) +%endif + %description common The glibc-common package includes common binaries for the GNU libc libraries, as well as national language (locale) support. @@ -749,10 +829,12 @@ local locales = { { code="ln", name="Lingala", regions={ "CD" } }, { code="lo", name="Lao", regions={ "LA" } }, { code="lt", name="Lithuanian", regions={ "LT" } }, + { code="ltg", name="Latgalian", regions={ "LV" } }, { code="lv", name="Latvian", regions={ "LV" } }, { code="lzh", name="Literary Chinese", regions={ "TW" } }, { code="mag", name="Magahi", regions={ "IN" } }, { code="mai", name="Maithili", regions={ "IN", "NP" } }, + { code="mdf", name="Moksha", regions={ "RU" } }, { code="mfe", name="Morisyen", regions={ "MU" } }, { code="mg", name="Malagasy", regions={ "MG" } }, { code="mhr", name="Meadow Mari", regions={ "RU" } }, @@ -797,6 +879,7 @@ local locales = { { code="sah", name="Sakha", regions={ "RU" } }, { code="sat", name="Santali", regions={ "IN" } }, { code="sc", name="Sardinian", regions={ "IT" } }, + { code="scn", name="Sicilian", regions={ "IT" } }, { code="sd", name="Sindhi", regions={ "IN" } }, { code="se", name="Northern Sami", regions={ "NO" } }, { code="sgs", name="Samogitian", regions={ "LT" } }, @@ -1054,6 +1137,32 @@ that can be installed across architectures. %dnl %%{without bootstrap} %endif +############################################################################## +# glibc32 (only for use in building GCC, not shipped) +############################################################################## +%ifarch x86_64 +%package -n glibc32 +Summary: The GNU libc libraries (32-bit) +Conflicts: glibc(x86-32) +%dnl The gcc package does not use ELF dependencies to install glibc32: +%dnl BuildRequires: (glibc32 or glibc-devel(%{__isa_name}-32)) +%dnl Not generating the ELF dependencies for glibc32 makes it less likely +%dnl that the package is selected by accident over glibc.i686. +AutoReqProv: no + +%description -n glibc32 +This package is only used for internal building of multilib aware +packages, like gcc, due to a technical limitation in the distribution +build environment. Any package which needs both 32-bit and 64-bit +runtimes at the same time must install glibc32 (marked as a 64-bit +package) to access the 32-bit development files during a 64-bit build. + +This package is not supported or intended for use outside of the +distribution build enviroment. Regular users can install both 32-bit and +64-bit runtimes and development files without any problems. + +%endif + ############################################################################## # Prepare for the build. ############################################################################## @@ -1101,78 +1210,97 @@ cat /proc/sysinfo 2>/dev/null || true cat /proc/meminfo df -# We build using the native system compilers. -GCC=gcc -GXX=g++ - -# Part of rpm_inherit_flags. Is overridden below. -rpm_append_flag () -{ - BuildFlags="$BuildFlags $*" -} - -# Propagates the listed flags to rpm_append_flag if supplied by -# redhat-rpm-config. -BuildFlags="-O2 -g" -rpm_inherit_flags () -{ - local reference=" $* " - local flag - for flag in $RPM_OPT_FLAGS $RPM_LD_FLAGS ; do - if echo "$reference" | grep -q -F " $flag " ; then - rpm_append_flag "$flag" - fi - done -} - # Propgate select compiler flags from redhat-rpm-config. These flags # are target-dependent, so we use only those which are specified in # redhat-rpm-config. We keep the -m32/-m32/-m64 flags to support # multilib builds. -# -# Note: For building alternative run-times, care is required to avoid -# overriding the architecture flags which go into CC/CXX. The flags -# below are passed in CFLAGS. -rpm_inherit_flags \ - "-Wp,-D_GLIBCXX_ASSERTIONS" \ - "-fasynchronous-unwind-tables" \ - "-fstack-clash-protection" \ - "-fno-omit-frame-pointer" \ - "-funwind-tables" \ - "-m31" \ - "-m32" \ - "-m64" \ - "-march=armv8-a+lse" \ - "-march=armv8.1-a" \ - "-march=haswell" \ - "-march=i686" \ - "-march=x86-64" \ - "-march=x86-64-v2" \ - "-march=x86-64-v3" \ - "-march=x86-64-v4" \ - "-march=z13" \ - "-march=z14" \ - "-march=z15" \ - "-march=zEC12" \ - "-mbackchain" \ - "-mbranch-protection=standard" \ - "-mcpu=power10" \ - "-mcpu=power8" \ - "-mcpu=power9" \ - "-mfpmath=sse" \ - "-mno-omit-leaf-frame-pointer" \ - "-msse2" \ - "-mstackrealign" \ - "-mtune=generic" \ - "-mtune=power10" \ - "-mtune=power8" \ - "-mtune=power9" \ - "-mtune=z13" \ - "-mtune=z14" \ - "-mtune=z15" \ - "-mtune=zEC12" \ - "-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" \ +%{lua: +-- Split the string argument into keys of an associate array. +-- The values are set to true. +local function string_to_array(s) + local result = {} + for e in string.gmatch(s, "%S+") do + result[e] = true + end + return result +end + +local inherit_flags = {} + +-- These flags are put into the CC and CXX arguments to configure. +-- Alternate builds do not use the flags listed here, only the main build does. +inherit_flags.cc_main = string_to_array [[ +-march=armv8-a+lse +-march=armv8.1-a +-march=haswell +-march=i686 +-march=x86-64 +-march=x86-64-v2 +-march=x86-64-v3 +-march=x86-64-v4 +-march=z13 +-march=z14 +-march=z15 +-march=zEC12 +-mcpu=power10 +-mcpu=power8 +-mcpu=power9 +-mtune=generic +-mtune=power10 +-mtune=power8 +-mtune=power9 +-mtune=z13 +-mtune=z14 +-mtune=z15 +-mtune=zEC12 +]] + +-- Like inherit_flags_cc_main, but also used for alternate builds. +inherit_flags.cc = string_to_array [[ +-m31 +-m32 +-m64 +]] + +-- These flags are passed through CFLAGS and CXXFLAGS. +inherit_flags.cflags = string_to_array [[ +-O2 +-O3 +-Wall +-Wp,-D_GLIBCXX_ASSERTIONS +-fasynchronous-unwind-tables +-fno-omit-frame-pointer +-fstack-clash-protection +-funwind-tables +-g +-mbackchain +-mbranch-protection=standard +-mfpmath=sse +-mno-omit-leaf-frame-pointer +-msse2 +-mstackrealign +-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 +]] + +-- Iterate over the build_cflags RPM variable and emit a shell +-- variable that contains the inherited flags of the indicated variant. +local function shell_build_flags(variant) + local result = {} + local inherit = assert(inherit_flags[variant]) + for f in string.gmatch(rpm.expand("%build_cflags"), "%S+") do + if inherit[f] then + result[#result + 1] = f + end + end + print("glibc_flags_" .. variant .. "=\"" .. table.concat(result, " ") + .. "\"\n") +end + +shell_build_flags('cc_main') -- Set $glibc_flags_cc_main. +shell_build_flags('cc') -- Set $glibc_flags_cc. +shell_build_flags('cflags') -- Set $glibc_flags_cflags. +} %if 0%{?_annotated_build} > 0 # libc_nonshared.a cannot be built with the default hardening flags @@ -1194,25 +1322,22 @@ BuildFlagsNonshared="-fplugin=annobin -fplugin-arg-annobin-disable -Wa,--generat # %%build - Generic options. ############################################################################## EnableKernel="--enable-kernel=%{enablekernel}" -# Save the used compiler and options into the file "Gcc" for use later -# by %%install. -echo "$GCC" > Gcc ############################################################################## # build() -# Build glibc in `build-%{target}$1', passing the rest of the arguments -# as CFLAGS to the build (not the same as configure CFLAGS). Several +# Build glibc in the directory $1, passing the rest of the arguments +# as additional configure arguments. Several # global values are used to determine build flags, kernel version, # system tap support, etc. ############################################################################## build() { - local builddir=build-%{target}${1:+-$1} - ${1+shift} + local builddir=$1 + shift rm -rf $builddir mkdir $builddir pushd $builddir - ../configure CC="$GCC" CXX="$GXX" CFLAGS="$BuildFlags $*" \ + ../configure "$@" \ --prefix=%{_prefix} \ --with-headers=%{_prefix}/include $EnableKernel \ --with-nonshared-cflags="$BuildFlagsNonshared" \ @@ -1220,10 +1345,6 @@ build() --build=%{target} \ --enable-stack-protector=strong \ --enable-systemtap \ - ${core_with_options} \ -%ifarch x86_64 - --enable-cet \ -%endif %ifarch %{ix86} --disable-multi-arch \ %endif @@ -1256,8 +1377,37 @@ build() popd } +%ifarch x86_64 +# Build for the glibc32 package. +build build-%{target}-32 \ + CC="gcc -m32" \ + CXX="g++ -m32" \ + CFLAGS="${glibc_flags_cflags/-m64/-m32}" \ + --host=i686-linux-gnu \ +# +%endif + # Default set of compiler options. -build +build build-%{target} \ + CC="gcc $glibc_flags_cc $glibc_flags_cc_main" \ + CXX="g++ $glibc_flags_cc $glibc_flags_cc_main" \ + CFLAGS="$glibc_flags_cflags" \ + %{?glibc_rtld_early_cflags:--with-rtld-early-cflags=%glibc_rtld_early_cflags} \ +%ifarch x86_64 + --enable-cet \ +%endif +# + +# POWER10 build variant. +%if %{buildpower10} +build build-%{target}-power10 \ + CC="gcc $glibc_flags_cc" \ + CXX="g++ $glibc_flags_cc" \ + CFLAGS="$glibc_flags_cflags" \ + --with-cpu=power10 \ +# +%endif + ############################################################################## # Install glibc... @@ -1270,22 +1420,40 @@ build # distribution that supports multiple installed glibc versions. %global glibc_sysroot $RPM_BUILD_ROOT -# Remove existing file lists. -find . -type f -name '*.filelist' -exec rm -rf {} \; - -# Reload compiler and build options that were used during %%build. -GCC=`cat Gcc` +# Create symbolic links for Features/UsrMove (aka UsrMerge, MoveToUsr). +# See below: Remove UsrMove symbolic links. +usrmove_file_names="bin lib lib64 sbin" +for d in $usrmove_file_names ; do + mkdir -p "%{glibc_sysroot}/usr/$d" + ln -s "usr/$d" "%{glibc_sysroot}/$d" +done %ifarch riscv64 -# RISC-V ABI wants to install everything in /lib64/lp64d or /usr/lib64/lp64d. +# RISC-V ABI wants to install everything in /usr/lib64/lp64d. +# Make these be symlinks to /usr/lib64. See: # Make these be symlinks to /lib64 or /usr/lib64 respectively. See: # https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/DRHT5YTPK4WWVGL3GIN5BF2IKX2ODHZ3/ -for d in %{glibc_sysroot}%{_libdir} %{glibc_sysroot}/%{_lib}; do +for d in %{glibc_sysroot}%{_libdir}; do mkdir -p $d (cd $d && ln -sf . lp64d) done %endif +%ifarch x86_64 +# Install for the glibc32 package. +pushd build-%{target}-32 +%make_build install_root=%{glibc_sysroot} install +popd +pushd %{glibc_sysroot} +rm -rf etc var usr/bin usr/lib/gconv usr/libexec usr/sbin usr/share +rm -f lib/libnss_db* lib/libnss_hesiod* lib/libnsl* usr/lib/libnsl* usr/lib/libnss* +rm usr/lib/libc_malloc_debug.so +strip -g usr/lib/*.o +popd +mkdir glibc32-headers +cp -a %{glibc_sysroot}%{_includedir} glibc32-headers +%endif + # Build and install: pushd build-%{target} %make_build install_root=%{glibc_sysroot} install @@ -1296,6 +1464,38 @@ popd # via hardlinks, so we must group them ourselves. hardlink -c %{glibc_sysroot}/usr/lib/locale +%ifarch x86_64 +# Verify that there are no unexpected differences in the header files common +# between i386 and x86_64. +diff -ur %{glibc_sysroot}%{_includedir} glibc32-headers/include \ + > glibc-32-64.diff || true +if test -s glibc-32-64.diff ; then + if test $(grep -v '^Only in ' glibc-32-64.diff | wc -l) -ne 0; then + : Unexpected header file differences + exit 1 + fi +else + : Missing additional stubs header files. +fi +rm glibc-32-64.diff +rm -rf glibc32-headers +%endif + +%if %{glibc_autorequires} +mkdir -p %{glibc_sysroot}/%{_rpmconfigdir} %{glibc_sysroot}/%{_fileattrsdir} +sed < %{SOURCE3} \ + -e s/@VERSION@/%{version}/ \ + -e s/@RELEASE@/%{baserelease}/ \ + -e s/@SYMVER@/%{glibc_autorequires_symver}/ \ + > %{glibc_sysroot}/%{_rpmconfigdir}/glibc.req +cp %{SOURCE4} %{glibc_sysroot}/%{_fileattrsdir}/glibc.attr +%endif + +# Implement Changes/Unify_bin_and_sbin. +%if "%{_sbindir}" == "%{_bindir}" +mv %{glibc_sysroot}/usr/sbin/{iconvconfig,zic} %{glibc_sysroot}/%{_bindir}/ +%endif + # install_different: # Install all core libraries into DESTDIR/SUBDIR. Either the file is # installed as a copy or a symlink to the default install (if it is the @@ -1326,23 +1526,28 @@ install_different() mkdir -p "$destdir" mkdir -p "$libdestdir" # Walk all of the libraries we installed... - for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db + for lib in libc math/libm do libbase=${lib#*/} # Take care that `libbaseso' has a * that needs expanding so # take care with quoting. - libbaseso=$(basename %{glibc_sysroot}/%{_lib}/${libbase}-*.so) + libbaseso=$(basename %{glibc_sysroot}/%{_libdir}/${libbase}.so.*) # Only install if different from default build library. if cmp -s ${lib}.so ../build-%{target}/${lib}.so; then ln -sf "$subdir_up"/$libbaseso $libdestdir/$libbaseso else cp -a ${lib}.so $libdestdir/$libbaseso fi - dlib=$libdestdir/$(basename %{glibc_sysroot}/%{_lib}/${libbase}.so.*) - ln -sf $libbaseso $dlib done } +%if %{buildpower10} +pushd build-%{target}-power10 +install_different "$RPM_BUILD_ROOT/%{_libdir}/glibc-hwcaps" power10 .. +popd +%endif + + ############################################################################## # Remove the files we don't want to distribute ############################################################################## @@ -1351,11 +1556,10 @@ install_different() # XXX: This looks like a bug in glibc that accidentally installed these # wrong files. We probably don't need this today. rm -f %{glibc_sysroot}/%{_libdir}/libNoVersion* -rm -f %{glibc_sysroot}/%{_lib}/libNoVersion* # Remove the old nss modules. -rm -f %{glibc_sysroot}/%{_lib}/libnss1-* -rm -f %{glibc_sysroot}/%{_lib}/libnss-*.so.1 +rm -f %{glibc_sysroot}%{_libdir}/libnss1-* +rm -f %{glibc_sysroot}%{_libdir}/libnss-*.so.1 # This statically linked binary is no longer necessary in a world where # the default Fedora install uses an initramfs, and further we have rpm-ostree @@ -1373,7 +1577,7 @@ mkdir -p %{glibc_sysroot}/var/cache/ldconfig truncate -s 0 %{glibc_sysroot}/var/cache/ldconfig/aux-cache # ldconfig is statically linked, so we can use the new version. -%{glibc_sysroot}/sbin/ldconfig -N -r %{glibc_sysroot} +%{glibc_sysroot}/%{_sbindir}/ldconfig -N -r %{glibc_sysroot} ############################################################################## # Install info files @@ -1502,10 +1706,10 @@ cp benchtests/scripts/validate_benchout.py %{glibc_sysroot}%{_prefix}/libexec/gl # The #line directives gperf generates do not give the proper # file name relative to the build directory. pushd locale -ln -s programs/*.gperf . +ln -sf programs/*.gperf . popd pushd iconv -ln -s ../locale/programs/charmap-kw.gperf . +ln -sf ../locale/programs/charmap-kw.gperf . popd %if %{with docs} @@ -1514,13 +1718,6 @@ popd rm -f %{glibc_sysroot}%{_infodir}/dir %endif -# Move libpcprofile.so and libmemusage.so into the proper library directory. -# They can be moved without any real consequences because users would not use -# them directly. -mkdir -p %{glibc_sysroot}%{_libdir} -mv -f %{glibc_sysroot}/%{_lib}/lib{pcprofile,memusage}.so \ - %{glibc_sysroot}%{_libdir} - # Disallow linking against libc_malloc_debug. rm %{glibc_sysroot}%{_libdir}/libc_malloc_debug.so @@ -1546,7 +1743,14 @@ done # that have old linker scripts that reference this file. We ship this only # in compat-libpthread-nonshared sub-package. ############################################################################## -ar cr %{glibc_sysroot}%{_prefix}/%{_lib}/libpthread_nonshared.a +ar cr %{glibc_sysroot}%{_libdir}/libpthread_nonshared.a + +# Remove UsrMove symbolic links. +# These should not end in the packaged contents. +# They are part of the filesystem package. +for d in $usrmove_file_names ; do + rm "%{glibc_sysroot}/$d" +done ############################################################################### # Sysroot package creation. @@ -1558,7 +1762,17 @@ pushd %{glibc_sysroot}/%{sysroot_prefix} mkdir -p usr/lib usr/lib64 cp -a %{glibc_sysroot}/%{_prefix}/include usr/. +%ifarch x86_64 +# 32-bit headers for glibc32 don't go in the sysroot. +rm usr/include/gnu/*-32.h +%endif for lib in lib lib64; do +%ifarch x86_64 + if [ "$lib" = "lib" ]; then + # 32-bit libraries built for glibc32 don't go in the sysroot. + continue + fi +%endif for pfx in "" %{_prefix}/; do if test -d %{glibc_sysroot}/$pfx$lib ; then # Implement UsrMove: everything goes into usr/$lib. Only @@ -1580,7 +1794,7 @@ for lib in lib lib64; do exit 1 fi set -x - ln -s $sltarget usr/$lib/$slbase + ln -sf $sltarget usr/$lib/$slbase done fi done @@ -1612,352 +1826,65 @@ popd # installed files. ############################################################################## -############################################################################## -# Build the file lists used for describing the package and subpackages. -############################################################################## -# There are several main file lists (and many more for -# the langpack sub-packages (langpack-${lang}.filelist)): -# * master.filelist -# - Master file list from which all other lists are built. -# * glibc.filelist -# - Files for the glibc packages. -# * common.filelist -# - Flies for the common subpackage. -# * utils.filelist -# - Files for the utils subpackage. -# * devel.filelist -# - Files for the devel subpackage. -# * doc.filelist -# - Files for the documentation subpackage. -# * headers.filelist -# - Files for the headers subpackage. -# * static.filelist -# - Files for the static subpackage. -# * libnsl.filelist -# - Files for the libnsl subpackage -# * nss_db.filelist -# * nss_hesiod.filelist -# - File lists for nss_* NSS module subpackages. -# * nss-devel.filelist -# - File list with the .so symbolic links for NSS packages. -# * compat-libpthread-nonshared.filelist. -# - File list for compat-libpthread-nonshared subpackage. +# Placement of files in subpackages is mostly controlled by the +# %%files section below. There are some exceptions where a subset of +# files are put in one package and need to be elided from another +# package, and it's not possible to do this easily using explicit file +# lists or directory matching. For these exceptions. .filelist file +# are created. -# Create the main file lists. This way we can append to any one of them later -# wihtout having to create it. Note these are removed at the start of the -# install phase. -touch master.filelist -touch glibc.filelist -touch common.filelist -touch utils.filelist -touch gconv.filelist -touch devel.filelist -touch doc.filelist -touch headers.filelist -touch static.filelist -touch libnsl.filelist -touch nss_db.filelist -touch nss_hesiod.filelist -touch nss-devel.filelist -touch compat-libpthread-nonshared.filelist +# Make the sorting below more consistent. +export LC_ALL=C -############################################################################### -# Master file list, excluding a few things. -############################################################################### -{ - # List all files or links that we have created during install. - # Files with 'etc' are configuration files, likewise 'gconv-modules' - # and 'gconv-modules.cache' are caches, and we exclude them. - find %{glibc_sysroot} \( -type f -o -type l \) \ - \( \ - -name etc -printf "%%%%config " -o \ - -name gconv-modules.cache \ - -printf "%%%%verify(not md5 size mtime) " -o \ - -name gconv-modules* \ - -printf "%%%%verify(not md5 size mtime) %%%%config(noreplace) " \ - , \ - ! -path "*/lib/debug/*" -printf "/%%P\n" \) - # List all directories with a %%dir prefix. We omit the info directory and - # all directories in (and including) /usr/share/locale. - find %{glibc_sysroot} -type d \ - \( -path '*%{_prefix}/share/locale' -prune -o \ - \( -path '*%{_prefix}/share/*' \ -%if %{with docs} - ! -path '*%{_infodir}' -o \ -%endif - -path "*%{_prefix}/include/*" \ - \) -printf "%%%%dir /%%P\n" \) -} | { - # Also remove the *.mo entries. We will add them to the - # language specific sub-packages. - # libnss_ files go into subpackages related to NSS modules. - # and .*/share/i18n/charmaps/.*), they go into the sub-package - # "locale-source". /sys-root/ files are put into the sysroot package. - sed -e '\,.*/share/locale/\([^/_]\+\).*/LC_MESSAGES/.*\.mo,d' \ - -e '\,.*/share/i18n/locales/.*,d' \ - -e '\,.*/share/i18n/charmaps/.*,d' \ - -e '\,.*/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\|rpc\|gai\.conf\),d' \ - -e '\,.*/%{_libdir}/lib\(pcprofile\|memusage\)\.so,d' \ - -e '\,.*/bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d' \ - -e '\,.*/sys-root,d' -} | sort > master.filelist +# `make_sysroot_filelist PATH FIND-ARGS LIST` writes %%files section +# lines for files and directories in the sysroot under PATH to the +# file LIST, with FIND-ARGS passed to the find command. The output is +# passed through sort. +make_sysroot_filelist () { + ( + find "%{glibc_sysroot}$1" \( -type f -o -type l \) $2 \ + -printf "$1/%%P\n" || true + find "%{glibc_sysroot}$1" -type d $2 -printf "%%%%dir $1/%%P\n" || true + ) | sort > "$3" +} -# The master file list is now used by each subpackage to list their own -# files. We go through each package and subpackage now and create their lists. -# Each subpackage picks the files from the master list that they need. -# The order of the subpackage list generation does not matter. +# `remove_from_filelist FILE1 FILE2` removes the lines from FILE1 +# which are also in FILE2. The lines must not contain tabs, and the +# file is sorted as a side effect. The input files must be sorted +# according to the sort command. +remove_from_filelist () { + comm -23 "$1" "$2" > "$1.tmp" + mv "$1.tmp" "$1" +} -# Make the master file list read-only after this point to avoid accidental -# modification. -chmod 0444 master.filelist +# `split_sysroot_file_list DIR FIND-ARGS REGEXP MAIN-LIST EXCEPTIONS-LIST` +# creates a list of files in the sysroot subdirectory # DIR. +# Files and directories are enumerated with the find command, +# passing FIND-ARGS as an extra argument. Those output paths that +# match REGEXP (an POSIX extended regular expression; all whitespace +# in it is removed before matching) are put into EXCEPTIONS-LIST. The +# remaining files are put into MAIN-LIST. +split_sysroot_file_list () { + make_sysroot_filelist "$1" "$2" "$4" + grep -E -e "$(printf %%s "$3" | tr -d '[:space:]')" < "$4" > "$5" + remove_from_filelist "$4" "$5" +} -############################################################################### -# glibc -############################################################################### - -# Add all files with the following exceptions: -# - The info files '%{_infodir}/dir' -# - The partial (lib*_p.a) static libraries, include files. -# - The static files, objects, and unversioned DSOs. -# - The bin, locale, some sbin, and share. -# - We want iconvconfig in the main package and we do this by using -# a double negation of -v and [^i] so it removes all files in -# sbin *but* iconvconfig. -# - All the libnss files (we add back the ones we want later). -# - All bench test binaries. -# - The aux-cache, since it's handled specially in the files section. -# - Extra gconv modules. We add the required modules later. -cat master.filelist \ - | grep -v \ - -e '%{_infodir}' \ - -e '%{_libdir}/lib.*_p.a' \ - -e '%{_prefix}/include' \ - -e '%{_libdir}/lib.*\.a' \ - -e '%{_libdir}/.*\.o' \ - -e '%{_libdir}/lib.*\.so' \ - -e '%{_libdir}/gconv/.*\.so$' \ - -e '%{_libdir}/gconv/gconv-modules.d/gconv-modules-extra\.conf$' \ - -e '%{_prefix}/bin' \ - -e '%{_prefix}/lib/locale' \ - -e '%{_prefix}/sbin/[^i]' \ - -e '%{_prefix}/share' \ - -e '/var/db/Makefile' \ - -e '/libnss_.*\.so[0-9.]*$' \ - -e '/libnsl' \ - -e 'glibc-benchtests' \ - -e 'aux-cache' \ - > glibc.filelist - -# Add specific files: -# - The nss_files, nss_compat, and nss_db files. -# - The libmemusage.so and libpcprofile.so used by utils. -for module in compat files dns; do - cat master.filelist \ - | grep -E \ - -e "/libnss_$module(\.so\.[0-9.]+|-[0-9.]+\.so)$" \ - >> glibc.filelist -done -grep -e "libmemusage.so" -e "libpcprofile.so" master.filelist >> glibc.filelist - -############################################################################### -# glibc-gconv-extra -############################################################################### - -grep -e "gconv-modules-extra.conf" master.filelist > gconv.filelist - -# Put the essential gconv modules into the main package. -GconvBaseModules="ANSI_X3.110 ISO8859-15 ISO8859-1 CP1252" -GconvBaseModules="$GconvBaseModules UNICODE UTF-16 UTF-32 UTF-7" -%ifarch s390 s390x -GconvBaseModules="$GconvBaseModules ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9" -GconvBaseModules="$GconvBaseModules UTF16_UTF32_Z9 UTF8_UTF32_Z9" -%endif -GconvAllModules=$(cat master.filelist | - sed -n 's|%{_libdir}/gconv/\(.*\)\.so|\1|p') - -# Put the base modules into glibc and the rest into glibc-gconv-extra -for conv in $GconvAllModules; do - if echo $GconvBaseModules | grep -q $conv; then - grep -E -e "%{_libdir}/gconv/$conv.so$" \ - master.filelist >> glibc.filelist - else - grep -E -e "%{_libdir}/gconv/$conv.so$" \ - master.filelist >> gconv.filelist - fi -done - -############################################################################### -# glibc-devel -############################################################################### - -# Static libraries that land in glibc-devel, not glibc-static. -devel_static_library_pattern='/lib\(\(c\|nldbl\|mvec\)_nonshared\|g\|ieee\|mcheck\|pthread\|dl\|rt\|util\|anl\)\.a$' -# Static libraries neither in glibc-devel nor in glibc-static. -other_static_library_pattern='/libpthread_nonshared\.a' - -grep '%{_libdir}/lib.*\.a' master.filelist \ - | grep "$devel_static_library_pattern" \ - | grep -v "$other_static_library_pattern" \ - > devel.filelist - -# Put all of the object files and *.so (not the versioned ones) into the -# devel package. -grep '%{_libdir}/.*\.o' < master.filelist >> devel.filelist -grep '%{_libdir}/lib.*\.so' < master.filelist >> devel.filelist -# The exceptions are: -# - libmemusage.so and libpcprofile.so in glibc used by utils. -# - libnss_*.so which are in nss-devel. -sed -i -e '\,libmemusage.so,d' \ - -e '\,libpcprofile.so,d' \ - -e '\,/libnss_[a-z]*\.so$,d' \ - devel.filelist - -%if %{glibc_autorequires} -mkdir -p %{glibc_sysroot}/%{_rpmconfigdir} %{glibc_sysroot}/%{_fileattrsdir} -sed < %{SOURCE3} \ - -e s/@VERSION@/%{version}/ \ - -e s/@RELEASE@/%{baserelease}/ \ - -e s/@SYMVER@/%{glibc_autorequires_symver}/ \ - > %{glibc_sysroot}/%{_rpmconfigdir}/glibc.req -cp %{SOURCE4} %{glibc_sysroot}/%{_fileattrsdir}/glibc.attr -%endif - -############################################################################### -# glibc-doc -############################################################################### - -%if %{with docs} -# Put the info files into the doc file list, but exclude the generated dir. -grep '%{_infodir}' master.filelist | grep -v '%{_infodir}/dir' > doc.filelist -grep '%{_docdir}' master.filelist >> doc.filelist -%endif - -############################################################################### -# glibc-headers -############################################################################### - -%if %{need_headers_package} -# The glibc-headers package includes only common files which are identical -# across all multilib packages. We must keep gnu/stubs.h and gnu/lib-names.h -# in the glibc-headers package, but the -32, -64, -64-v1, and -64-v2 versions -# go into glibc-devel. -grep '%{_prefix}/include/gnu/stubs-.*\.h$' < master.filelist >> devel.filelist || : -grep '%{_prefix}/include/gnu/lib-names-.*\.h$' < master.filelist >> devel.filelist || : -# Put the include files into headers file list. -grep '%{_prefix}/include' < master.filelist \ - | grep -E -v '%{_prefix}/include/gnu/stubs-.*\.h$' \ - | grep -E -v '%{_prefix}/include/gnu/lib-names-.*\.h$' \ - > headers.filelist -%else -# If there is no glibc-headers package, all header files go into the -# glibc-devel package. -grep '%{_prefix}/include' < master.filelist >> devel.filelist -%endif - -############################################################################### -# glibc-static -############################################################################### - -# Put the rest of the static files into the static package. -grep '%{_libdir}/lib.*\.a' < master.filelist \ - | grep -v "$devel_static_library_pattern" \ - | grep -v "$other_static_library_pattern" \ - > static.filelist - -############################################################################### -# glibc-common -############################################################################### - -# All of the bin and certain sbin files go into the common package except -# iconvconfig which needs to go in glibc. The iconvconfig binary is kept in -# the main glibc package because we use it in the post-install scriptlet to -# rebuild the gconv-modules.cache. The makedb binary is in nss_db. -grep '%{_prefix}/bin' master.filelist \ - | grep -v '%{_prefix}/bin/makedb' \ - >> common.filelist -grep '%{_prefix}/sbin' master.filelist \ - | grep -v '%{_prefix}/sbin/iconvconfig' >> common.filelist -# All of the files under share go into the common package since they should be -# multilib-independent. -# Exceptions: -# - The actual share directory, not owned by us. -# - The info files which go into doc, and the info directory. -# - All documentation files, which go into doc. -grep '%{_prefix}/share' master.filelist \ - | grep -v \ - -e '%{_prefix}/share/info/libc.info.*' \ - -e '%%dir %{prefix}/share/info' \ - -e '%%dir %{prefix}/share' \ - -e '%{_docdir}' \ - >> common.filelist - -############################################################################### -# glibc-utils -############################################################################### - -# Add the utils scripts and programs to the utils subpackage. -cat > utils.filelist < nss_$module.filelist -done -grep -E "%{_prefix}/bin/makedb$" master.filelist >> nss_db.filelist - -############################################################################### -# nss-devel -############################################################################### - -# Symlinks go into the nss-devel package (instead of the main devel -# package). -grep '/libnss_[a-z]*\.so$' master.filelist > nss-devel.filelist - -############################################################################### -# libnsl -############################################################################### - -# Prepare the libnsl-related file lists. -grep -E '/libnsl\.so\.[0-9]+$' master.filelist > libnsl.filelist -test $(wc -l < libnsl.filelist) -eq 1 - -%if %{with benchtests} -############################################################################### -# glibc-benchtests -############################################################################### - -# List of benchmarks. -find build-%{target}/benchtests -type f -executable | while read b; do - echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)" -done >> benchtests.filelist -# ... and the makefile. -for b in %{SOURCE1} %{SOURCE2}; do - echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)" >> benchtests.filelist -done -# ... and finally, the comparison scripts. -echo "%{_prefix}/libexec/glibc-benchtests/benchout.schema.json" >> benchtests.filelist -echo "%{_prefix}/libexec/glibc-benchtests/compare_bench.py*" >> benchtests.filelist -echo "%{_prefix}/libexec/glibc-benchtests/import_bench.py*" >> benchtests.filelist -echo "%{_prefix}/libexec/glibc-benchtests/validate_benchout.py*" >> benchtests.filelist -%endif - -############################################################################### -# compat-libpthread-nonshared -############################################################################### -echo "%{_libdir}/libpthread_nonshared.a" >> compat-libpthread-nonshared.filelist +# The primary gconv converters are in the glibc package, the rest goes +# into glibc-gconv-extra. The Z9 and Z900 subpatterns are for +# s390x-specific converters. The -name clause skips over files +# that are not loadable gconv modules. +split_sysroot_file_list \ + %{_libdir}/gconv '-name *.so' \ + 'gconv/ + (CP1252 + |ISO8859-15? + |UNICODE + |UTF-[0-9]+ + |ISO-8859-1_CP037_Z900 + |UTF(8|16)_UTF(16|32)_Z9 + )\.so$' \ + gconv-extra.filelist glibc.filelist ############################################################################## # Run the glibc testsuite @@ -2014,21 +1941,25 @@ pushd build-%{target} run_tests popd +%if %{buildpower10} +# Run this test only if the server supports Power10 instructions. +if LD_SHOW_AUXV=1 /bin/true | grep -E "AT_HWCAP2:[^$]*arch_3_1" > /dev/null; then + echo ====================TESTING -mcpu=power10============= + pushd build-%{target}-power10 + run_tests + popd +fi +%endif + echo ====================TESTING END===================== PLTCMD='/^Relocation section .*\(\.rela\?\.plt\|\.rela\.IA_64\.pltoff\)/,/^$/p' echo ====================PLT RELOCS LD.SO================ -readelf -Wr %{glibc_sysroot}/%{_lib}/ld-*.so | sed -n -e "$PLTCMD" +readelf -Wr %{glibc_sysroot}%{_libdir}/ld-*.so | sed -n -e "$PLTCMD" echo ====================PLT RELOCS LIBC.SO============== -readelf -Wr %{glibc_sysroot}/%{_lib}/libc-*.so | sed -n -e "$PLTCMD" +readelf -Wr %{glibc_sysroot}%{_libdir}/libc-*.so | sed -n -e "$PLTCMD" echo ====================PLT RELOCS END================== -# Obtain a way to run the dynamic loader. Avoid matching the symbolic -# link and then pick the first loader (although there should be only -# one). Use -maxdepth 2 to avoid descending into the /sys-root/ -# sub-tree. See wrap-find-debuginfo.sh. -ldso_path="$(find %{glibc_sysroot}/ -maxdepth 2 -regextype posix-extended \ - -regex '.*/ld(-.*|64|)\.so\.[0-9]+$' -type f | LC_ALL=C sort | head -n1)" -run_ldso="$ldso_path --library-path %{glibc_sysroot}/%{_lib}" +run_ldso="%{glibc_sysroot}/%{_prefix}%{glibc_ldso} --library-path %{glibc_sysroot}/%{_libdir}" # Show the auxiliary vector as seen by the new library # (even if we do not perform the valgrind test). @@ -2059,13 +1990,11 @@ if rpm.vercmp(rel, required) < 0 then error("FATAL: kernel too old", 0) end -%post -p -%glibc_post_funcs -- (1) Remove multilib libraries from previous installs. -- In order to support in-place upgrades, we must immediately remove --- obsolete platform directories after installing a new glibc +-- all platform directories before installing a new glibc -- version. RPM only deletes files removed by updates near the end --- of the transaction. If we did not remove the obsolete platform +-- of the transaction. If we did not remove all platform -- directories here, they may be preferred by the dynamic linker -- during the execution of subsequent RPM scriptlets, likely -- resulting in process startup failures. @@ -2138,7 +2067,9 @@ for _, rdir in ipairs (remove_dirs) do end end --- (2) Update /etc/ld.so.conf +%post -p +%glibc_post_funcs +-- (1) Update /etc/ld.so.conf -- Next we update /etc/ld.so.conf to ensure that it starts with -- a literal "include ld.so.conf.d/*.conf". @@ -2177,14 +2108,14 @@ if posix.access (ldsoconf) then end end --- (3) Rebuild ld.so.cache early. +-- (2) Rebuild ld.so.cache early. -- If the format of the cache changes then we need to rebuild -- the cache early to avoid any problems running binaries with -- the new glibc. call_ldconfig() --- (4) Update gconv modules cache. +-- (3) Update gconv modules cache. -- If the /usr/lib/gconv/gconv-modules.cache exists, then update it -- with the latest set of modules that were just installed. -- We assume that the cache is in _libdir/gconv and called @@ -2192,18 +2123,23 @@ call_ldconfig() update_gconv_modules_cache() --- (5) On upgrades, restart systemd if installed. "systemctl -q" does +-- (4) On upgrades, restart systemd if installed. "systemctl -q" does -- not suppress the error message (which is common in chroots), so -- open-code rpm.execute with standard error suppressed. if tonumber(arg[2]) >= 2 and posix.access("%{_prefix}/bin/systemctl", "x") then - local pid = posix.fork() - if pid == 0 then - posix.redirect2null(2) - posix.exec("%{_prefix}/bin/systemctl", "daemon-reexec") - elseif pid > 0 then - posix.wait(pid) + if rpm.spawn ~= nil then + rpm.spawn ({"%{_prefix}/bin/systemctl", "daemon-reexec"}, + {stderr="/dev/null"}) + else + local pid = posix.fork() + if pid == 0 then + posix.redirect2null(2) + posix.exec("%{_prefix}/bin/systemctl", "daemon-reexec") + elseif pid > 0 then + posix.wait(pid) + end end end @@ -2240,13 +2176,46 @@ update_gconv_modules_cache () update_gconv_modules_cache () %files -f glibc.filelist -%dir %{_prefix}/%{_lib}/audit +%{_sbindir}/ldconfig +%{_sbindir}/iconvconfig +%{_libexecdir}/getconf +%{_prefix}%{glibc_ldso} +%{_libdir}/libBrokenLocale.so.1 +%{_libdir}/libanl.so.1 +%{_libdir}/libc.so.6 +%{_libdir}/libdl.so.2 +%{_libdir}/libm.so.6 +%{_libdir}/libnss_compat.so.2 +%{_libdir}/libnss_dns.so.2 +%{_libdir}/libnss_files.so.2 +%{_libdir}/libpthread.so.0 +%{_libdir}/libresolv.so.2 +%{_libdir}/librt.so.1 +%{_libdir}/libthread_db.so.1 +%{_libdir}/libutil.so.1 +%{_libdir}/libpcprofile.so +%{_libdir}/audit +%if %{glibc_has_libmvec} +%{_libdir}/libmvec.so.1 +%endif +%ifarch %{ix86} +# Needs to be in glibc.i686 so that glibc-utils.x86_64 can use it. +%{_libdir}/libmemusage.so +%{_libdir}/libc_malloc_debug.so.0 +%endif +%if %{buildpower10} +%{_libdir}/glibc-hwcaps +%endif %verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf %verify(not md5 size mtime) %config(noreplace) /etc/rpc %dir /etc/ld.so.conf.d -%dir %{_prefix}/libexec/getconf %dir %{_libdir}/gconv %dir %{_libdir}/gconv/gconv-modules.d +%verify(not md5 size mtime) %config(noreplace) %{_libdir}/gconv/gconv-modules +%verify(not md5 size mtime) %{_libdir}/gconv/gconv-modules.cache +%ifarch s390x +%verify(not md5 size mtime) %config(noreplace) %{_libdir}/gconv/gconv-modules.d/gconv-modules-s390.conf +%endif %dir %attr(0700,root,root) /var/cache/ldconfig %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/cache/ldconfig/aux-cache %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache @@ -2255,10 +2224,27 @@ update_gconv_modules_cache () %{!?_licensedir:%global license %%doc} %license COPYING COPYING.LIB LICENSES -%files -f common.filelist common +%files common +%{_bindir}/gencat +%{_bindir}/getconf +%{_bindir}/getent +%{_bindir}/iconv +%{_bindir}/ld.so +%{_bindir}/ldd +%{_bindir}/locale +%{_bindir}/localedef +%{_bindir}/pldd +%{_bindir}/sotruss +%{_bindir}/sprof +%{_bindir}/tzselect +%{_bindir}/zdump +%{_sbindir}/zic +%dir %{_datarootdir}/i18n +%dir %{_datarootdir}/i18n/locales +%dir %{_datarootdir}/i18n/charmaps %dir %{_prefix}/lib/locale -%dir %{_prefix}/lib/locale/C.utf8 -%{_prefix}/lib/locale/C.utf8/* +%{_datarootdir}/locale/locale.alias +%{_prefix}/lib/locale/C.utf8 %files all-langpacks %{_prefix}/lib/locale/locale-archive @@ -2266,54 +2252,1030 @@ update_gconv_modules_cache () %{_prefix}/share/locale/*/LC_MESSAGES/libc.mo %files locale-source -%dir %{_prefix}/share/i18n/locales -%{_prefix}/share/i18n/locales/* -%dir %{_prefix}/share/i18n/charmaps -%{_prefix}/share/i18n/charmaps/* +%{_datarootdir}/i18n/locales +%{_datarootdir}/i18n/charmaps -%files -f devel.filelist devel +%files devel +%{_includedir}/* %if %{glibc_autorequires} %attr(0755,root,root) %{_rpmconfigdir}/glibc.req %{_fileattrsdir}/glibc.attr %endif +%{_libdir}/*.o +%{_libdir}/libBrokenLocale.so +%{_libdir}/libanl.a +%{_libdir}/libanl.so +%{_libdir}/libc.so +%{_libdir}/libc_nonshared.a +%{_libdir}/libdl.a +%{_libdir}/libg.a +%{_libdir}/libm.so +%{_libdir}/libmcheck.a +%{_libdir}/libpthread.a +%{_libdir}/libresolv.so +%{_libdir}/librt.a +%{_libdir}/libthread_db.so +%{_libdir}/libutil.a +%if %{glibc_has_libnldbl} +%{_libdir}/libnldbl_nonshared.a +%endif +%if %{glibc_has_libmvec} +%{_libdir}/libmvec.so +%endif +%ifarch x86_64 +# This files are included in the buildroot for glibc32 below. +%exclude %{_includedir}/gnu/lib-names-32.h +%exclude %{_includedir}/gnu/stubs-32.h +%endif %if %{with docs} -%files -f doc.filelist doc +%files doc +%{_datarootdir}/doc +%{_infodir}/*.info* %endif -%files -f static.filelist static - -%if %{need_headers_package} -%files -f headers.filelist -n %{headers_package_name} +%files static +%{_libdir}/libBrokenLocale.a +%{_libdir}/libc.a +%{_libdir}/libm.a +%{_libdir}/libresolv.a +%if %{glibc_has_libmvec} +%{_libdir}/libm-%{version}.a +%{_libdir}/libmvec.a %endif -%files -f utils.filelist utils +%files utils +%{_bindir}/memusage +%{_bindir}/memusagestat +%{_bindir}/mtrace +%{_bindir}/pcprofiledump +%{_bindir}/xtrace +%ifnarch %{ix86} +# Needs to be in glibc.i686 so that glibc-utils.x86_64 can use it. +%{_libdir}/libmemusage.so +%{_libdir}/libc_malloc_debug.so.0 +%endif -%files -f gconv.filelist gconv-extra +%files -f gconv-extra.filelist gconv-extra +%verify(not md5 size mtime) %config(noreplace) %{_libdir}/gconv/gconv-modules.d/gconv-modules-extra.conf -%files -f nss_db.filelist -n nss_db +%files -n nss_db +%{_bindir}/makedb +%{_libdir}/libnss_db.so.2 /var/db/Makefile -%files -f nss_hesiod.filelist -n nss_hesiod +%files -n nss_hesiod +%{_libdir}/libnss_hesiod.so.2 %doc hesiod/README.hesiod -%files -f nss-devel.filelist nss-devel +%files nss-devel +%{_libdir}/libnss_compat.so +%{_libdir}/libnss_db.so +%{_libdir}/libnss_hesiod.so -%files -f libnsl.filelist -n libnsl -/%{_lib}/libnsl.so.1 +%files -n libnsl +%{_libdir}/libnsl.so.1 %if %{with benchtests} -%files benchtests -f benchtests.filelist +%files benchtests +%{_libexecdir}/glibc-benchtests %endif -%files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared +%files -n compat-libpthread-nonshared +%{_libdir}/libpthread_nonshared.a %if %{without bootstrap} %files -n sysroot-%{_arch}-%{sysroot_dist}-glibc %{sysroot_prefix} %endif +%ifarch x86_64 +%files -n glibc32 +%{_includedir}/gnu/lib-names-32.h +%{_includedir}/gnu/stubs-32.h +%{_prefix}/lib/*.a +%{_prefix}/lib/*.o +%{_prefix}/lib/*.so* +%{_prefix}/lib/audit/* +%endif + %changelog -* Thu Feb 01 2024 David Abdurachmanov - 2.38.9000-39.0.riscv64 -- Apply Florian suggested fix for noarch sysroot (riscv64) +* Fri Nov 29 2024 Florian Weimer - 2.40.9000-21 +- Drop glibc-rh2327564-1.patch, glibc-rh2327564-2.patch. Fixed upstream. + (#2327564) +- Auto-sync with upstream branch master, + commit e2436d6f5aa47ce8da80c2ba0f59dfb9ffde08f3: +- malloc: send freed small chunks to smallbin +- AArch64: Remove zva_128 from memset +- benchtests: Add calloc test +- libio: make _IO_least_marker static +- malloc: Avoid func call for tcache quick path in free() +- math: Add internal roundeven_finite +- RISC-V: Use builtin for fma and fmaf +- RISC-V: Use builtin for copysign and copysignf +- Silence most -Wzero-as-null-pointer-constant diagnostics +- sysdeps: linux: Fix output of LD_SHOW_AUXV=1 for AT_RSEQ_* +- nptl: initialize cpu_id_start prior to rseq registration +- math: Fix branch hint for 68d7128942 +- powerpc64le: ROP Changes for strncpy/ppc-mount +- math: Fix non-portability in the computation of signgam in lgammaf +- malloc: Split _int_free() into 3 sub functions +- math: Use tanf from CORE-MATH +- math: Use lgammaf from CORE-MATH +- math: Use erfcf from CORE-MATH +- math: Use erff from CORE-MATH +- math: Split s_erfF in erff and erfc +- math: Use cbrtf from CORE-MATH +- benchtests: Add tanf benchmark +- benchtests: Add lgammaf benchmark +- benchtests: Add erfcf benchmark +- benchtests: Add erff benchmark +- benchtests: Add cbrtf benchmark +- elf: Handle static PIE with non-zero load address [BZ #31799] +- x86/string: Use `movsl` instead of `movsd` in strncat [BZ #32344] +- stdlib: Make getenv thread-safe in more cases +- aarch64: Remove non-temporal load/stores from oryon-1's memset +- aarch64: Remove non-temporal load/stores from oryon-1's memcpy +- powerpc64le: _init/_fini file changes for ROP +- misc: remove extra va_end in error_tail (bug 32233) +- intl: avoid alloca for arbitrary sizes (bug 32380) + +* Thu Nov 21 2024 Florian Weimer - 2.40.9000-20 +- Revert aarch64 memset changes (cec3aef3241cec3aef32412779e) (#2327564) + +* Wed Nov 20 2024 Florian Weimer - 2.40.9000-19 +- Auto-sync with upstream branch master, + commit 47311cca31e685fa7bfe19bb8cef17d2d3d7fff9: +- manual: Add description of AArch64-specific pkey flags +- AArch64: Add support for memory protection keys +- AArch64: Remove thunderx{,2} memcpy +- powerpc64le: Optimized strcat for POWER10 +- powerpc: Improve the inline asm for syscall wrappers +- elf: handle addition overflow in _dl_find_object_update_1 [BZ #32245] +- x86/string: Use `movsl` instead of `movsd` in strncpy/strncat [BZ #32344] +- manual: Fix overeager s/int/size_t/ in memory.texi +- linux: Add support for getrandom vDSO + +* Wed Nov 13 2024 Florian Weimer - 2.40.9000-18 +- Only relocate ld.so for the second time of libc.so has been loaded + +* Mon Nov 11 2024 DJ Delorie - 2.40.9000-17 +- Auto-sync with upstream branch master, + commit 7b544224f82d20019f9b28522ebf8114a372d1a2. +- stat.h: Fix missing declaration of struct timespec +- mach: Fix __xpg_strerror_r on in-range but undefined errors [BZ #32350] +- x86/string: Use `movsl` instead of `movsd` [BZ #32344] +- Rename new tst-sem17 test to tst-sem18 +- Avoid uninitialized result in sem_open when file does not exist +- nptl: initialize rseq area prior to registration +- s390x: Update ulps +- elf: avoid jumping over a needed declaration +- math: Fix log10f on some ABIs +- stdio-common: Add tests for formatted vsnprintf output specifiers +- stdio-common: Add tests for formatted vsprintf output specifiers +- stdio-common: Add tests for formatted vfprintf output specifiers +- stdio-common: Add tests for formatted vdprintf output specifiers +- stdio-common: Add tests for formatted vasprintf output specifiers +- stdio-common: Add tests for formatted vprintf output specifiers +- stdio-common: Add tests for formatted snprintf output specifiers +- stdio-common: Add tests for formatted sprintf output specifiers +- stdio-common: Add tests for formatted fprintf output specifiers +- stdio-common: Add tests for formatted dprintf output specifiers +- stdio-common: Add tests for formatted asprintf output specifiers +- stdio-common: Add tests for formatted printf output specifiers +- nptl: fix __builtin_thread_pointer detection on LoongArch +- math: Fix incorrect results of exp10m1f with some GCC versions +- misc: Align argument name for pkey_*() functions with the manual +- manual: Use more precise wording for memory protection keys +- elf: Switch to main malloc after final ld.so self-relocation +- elf: Introduce _dl_relocate_object_no_relro +- elf: Do not define consider_profiling, consider_symbind as macros +- elf: rtld_multiple_ref is always true +- Add Arm HWCAP2_* constants from Linux 3.15 and 6.2 to +- Add feature test macro _ISOC2Y_SOURCE +- added license for sysdeps/ieee754/flt-32/e_gammaf_r.c +- AArch64: Remove SVE erf and erfc tables +- x86_64: Add exp2m1f with FMA +- x86_64: Add exp10m1f with FMA +- math: Use log10p1f from CORE-MATH +- math: Use log1pf from CORE-MATH +- math: Use log2p1f from CORE-MATH +- math: Use log10f from CORE-MATH +- math: Use expm1f from CORE-MATH +- math: Use exp2m1f from CORE-MATH +- math: Use exp10m1f from CORE-MATH +- benchtests: Add log10p1f benchmark +- benchtests: Add log1p benchmark +- benchtests: Add log2p1f benchmark +- benchtests: Add log10f benchmark +- benchtests: Add expm1f benchmark +- benchtests: Add exp2m1f benchmark +- benchtests: Add exp10m1f benchmark +- math: Add e_gammaf_r to glibc code and style +- LoongArch: Add RSEQ_SIG in rseq.h. +- nptl: Add for LoongArch +- Link tst-clock_gettime with $(librt) +- powerpc64: Obviate the need for ROP protection in clone/clone3 +- Add tests of time, gettimeofday, clock_gettime +- Add more tests of pthread attributes initial values +- Document further requirement on mixing streams / file descriptors +- powerpc64le: Adhere to ABI stack alignment requirement +- AArch64: Small optimisation in AdvSIMD erf and erfc +- Revert "elf: Run constructors on cyclic recursive dlopen (bug 31986)" +- elf: Change ldconfig auxcache magic number (bug 32231) +- SHARED-FILES: Mention bundled Linux 6.10 headers. +- libio: Fix crash in fputws [BZ #20632] +- stdio-common: Fix scanf parsing for NaN types [BZ #30647] + +* Mon Nov 4 2024 Florian Weimer - 2.40.9000-16 +- Exclude 32-bit headers from the x86_64 package + +* Mon Oct 28 2024 Florian Weimer - 2.40.9000-15 +- Use rpm.spawn instead of posix.fork if availabe (#2291869) + +* Mon Oct 28 2024 Florian Weimer - 2.40.9000-14 +- Eliminate the glibc-headers package + +* Sat Oct 26 2024 Florian Weimer - 2.40.9000-13 +- Restore compatibility with libglvnd by reverting + "elf: Run constructors on cyclic recursive dlopen (bug 31986)" + +* Fri Oct 25 2024 Florian Weimer - 2.40.9000-12 +- Complete Features/UsrMove (aka UsrMerge, MoveToUsr) transition (#1063607) + +* Fri Oct 25 2024 Florian Weimer - 2.40.9000-11 +- Rework filelist construction + +* Fri Oct 25 2024 Florian Weimer - 2.40.9000-10 +- Auto-sync with upstream branch master, + commit ac73067cb7a328bf106ecd041c020fc61be7e087: +- elf: Fix map_complete Systemtap probe in dl_open_worker + +* Fri Oct 25 2024 Florian Weimer - 2.40.9000-9 +- Auto-sync with upstream branch master, + commit 43db5e2c0672cae7edea7c9685b22317eae25471: +- elf: Signal RT_CONSISTENT after relocation processing in dlopen (bug 31986) +- elf: Signal LA_ACT_CONSISTENT to auditors after RT_CONSISTENT switch +- elf: Run constructors on cyclic recursive dlopen (bug 31986) +- Linux: Match kernel text for SCHED_ macros +- libio: Correctly link tst-popen-fork against libpthread + +* Thu Oct 24 2024 Patsy Griffin - 2.40.9000-8 +- Auto-sync with upstream branch master, + commit c5dd659f22058bf9b371ab1cba07631f1206c674. +- Add more tests of pthread_mutexattr_gettype and pthread_mutexattr_settype +- libio: Fix a deadlock after fork in popen +- configure: default to --prefix=/usr on GNU/Linux +- manual: Document stdio.h functions that may be macros +- Check time arguments to pthread_timedjoin_np and pthread_clockjoin_np +- Add .b4-config file +- linux: Fix tst-syscall-restart.c on old gcc (BZ 32283) +- sparc: Fix restartable syscalls (BZ 32173) +- support: Make support_process_state_wait return the found state +- Enable transliteration rules with two input characters in scn_IT [BZ #32280] + +* Mon Oct 14 2024 DJ Delorie - 2.40.9000-7 +- Auto-sync with upstream branch master, + commit 9d4b4515a88c5d0bbfc7809374f322c507c2d779. +- locale: Fix some spelling typos +- LoongArch: Regenerate loongarch/arch-syscall.h by build-many-glibcs.py update-syscalls. +- manual: Fix and test @deftypef* function formatting +- replace tgammaf by the CORE-MATH implementation +- Add IPPROTO_SMC from Linux 6.11 to netinet/in.h +- misc: Add support for Linux uio.h RWF_ATOMIC flag +- linux: Update stat-generic.h with linux 6.11 +- Update kernel version to 6.11 in header constant tests +- linux: Add MAP_DROPPABLE from Linux 6.11 +- Update PIDFD_* constants for Linux 6.11 +- Update syscall lists for Linux 6.11 +- Use Linux 6.11 in build-many-glibcs.py +- Fix header guard in sysdeps/mach/hurd/x86_64/vm_param.h +- rt: more clock_nanosleep tests addendum +- rt: more clock_nanosleep tests +- stdlib: Make abort/_Exit AS-safe (BZ 26275) +- linux: Use GLRO(dl_vdso_time) on time +- linux: Use GLRO(dl_vdso_gettimeofday) on gettimeofday +- S390: Don't use r11 for cu-instructions as used as frame-pointer. [BZ# 32192] +- stdio-common/Makefile: Fix FAIL: lint-makefiles +- Fix whitespace related license issues. +- Add freopen special-case tests: thread cancellation +- hurd: Add missing va_end call in fcntl implementation. [BZ #32234] + +* Wed Oct 02 2024 Carlos O'Donell - 2.40.9000-6 +- Auto-sync with upstream branch master, + commit a36814e1455093fc9ebfcdf6ef39bb0cf3d447da. +- riscv: align .preinit_array (bug 32228) +- linux: sparc: Fix clone for LEON/sparcv8 (BZ 31394) +- linux: sparc: Fix syscall_cancel for LEON +- math: Improve layout of expf data +- Disable _TIME_BITS if the compiler defaults to it +- Disable _FILE_OFFSET_BITS if the compiler defaults to it +- Do not use -Wp to disable fortify (BZ 31928) +- libio: Set _vtable_offset before calling _IO_link_in [BZ #32148] +- Add a new fwrite test that exercises buffer overflow +- x86/string: Fixup alignment of main loop in str{n}cmp-evex [BZ #32212] +- stdio-common: Fix memory leak in tst-freopen4* tests on UNSUPPORTED +- Linux: Block signals around _Fork (bug 32215) +- Update to Unicode 16.0.0 [BZ #32168] +- manual: Document that feof and ferror are mutually exclusive +- stdio-common: Add new test for fdopen +- Fix missing randomness in __gen_tempname (bug 32214) +- arc: Cleanup arcbe +- arc: Remove HAVE_ARC_BE macro and disable big-endian port +- scripts: Remove arceb-linux-gnu from build-many-glibcs.py +- LoongArch: Undef __NR_fstat and __NR_newfstatat. +- Add tests of fread + +* Tue Sep 24 2024 Arjun Shankar - 2.40.9000-5 +- Auto-sync with upstream branch master, + commit da29dc24d419656a4a6d6d61598b767b86b1425d: +- nptl: Prefer setresuid32 in tst-setuid2 +- elf: Move __rtld_malloc_init_stubs call into _dl_start_final +- elf: Eliminate alloca in open_verify +- elf: Remove version assert in check_match in elf/dl-lookup.c +- elf: In rtld_setup_main_map, assume ld.so has a DYNAMIC segment +- misc: Enable internal use of memory protection keys +- misc: Link tst-mkstemp-fuse-parallel with $(shared-thread-library) +- iconv: Use $(run-program-prefix) for running iconv (bug 32197) +- AArch64: Simplify rounding-multiply pattern in several AdvSIMD routines +- AArch64: Improve codegen in users of ADVSIMD expm1f helper +- AArch64: Improve codegen in users of AdvSIMD log1pf helper +- AArch64: Improve codegen in SVE F32 logs +- AArch64: Improve codegen in SVE expf & related routines +- Linux: readdir64_r should not skip d_ino == 0 entries (bug 32126) +- dirent: Add tst-rewinddir +- dirent: Add tst-readdir-long +- Linux: Use readdir64_r for compat __old_readdir64_r (bug 32128) +- dirent: Add tst-closedir-leaks +- support: Add valgrind instructions to +- support: Fix memory leaks in FUSE tests +- misc: FUSE-based tests for mkstemp +- Add freopen special-case tests: chroot, EFBIG, stdin/stdout/stderr +- Make tst-strtod-underflow type-generic +- Add tests of more strtod special cases +- Add more tests of strtod end pointer +- Make tst-strtod2 and tst-strtod5 type-generic +- Implement run-built-tests=no for make xcheck, always build xtests +- Test that errno is set to 0 at program startup +- Add another test for fclose on an unopened file + +* Fri Sep 20 2024 Florian Weimer - 2.40.9000-4 +- Auto-sync with upstream branch master, + commit fa1b0d5e9f6e0353e16339430770a7a8824c0468: +- iconv: Input buffering for the iconv program (bug 6050) +- iconv: Multiple - on command line should not fail (bug 32050) +- iconv: Support in-place conversions (bug 10460, bug 32033) +- iconv: Preserve iconv -c error exit on invalid inputs (bug 32046) +- manual: __is_last is no longer part of iconv internals +- iconv: Do not use mmap in iconv (the program) (bug 17703) +- iconv: Base tests for buffer management +- AArch64: Add vector logp1 alias for log1p +- Linux: Add missing scheduler constants to +- Linux: Add the sched_setattr and sched_getattr functions +- manual: Extract the @manpageurl{func,sec} macro +- AArch64: Remove memset-reg.h +- debug: Fix read error handling in pcprofiledump +- AArch64: Optimize memset +- aarch64: Avoid redundant MOVs in AdvSIMD F32 logs +- Document limitations on streams passed to freopen +- stdlib: Do not use GLIBC_PRIVATE ABI for errno in libc_nonshared.a +- manual: Safety annotations for clock_gettime, clock_getres +- timezone: sync to TZDB 2024b +- Fix freopen handling of ,ccs= (bug 23675) +- powerpc64le: Build new strtod tests with long double ABI flags (bug 32145) + +* Thu Sep 19 2024 Florian Weimer - 2.40.9000-3 +- Use make xcheck in such a way that xtests are actually built + +* Thu Sep 19 2024 Florian Weimer - 2.40.9000-2 +- Ensure that xtests can be built + +* Thu Sep 05 2024 Florian Weimer - 2.40.9000-1 +- Remove RHEL-18039-1.patch, RHEL-18039-2.patch. Applied upstream. +- Auto-sync with upstream branch master, + commit 9c0d6f7a1046aba111e25e34ec07242853e859dc: +- Fix memory leak on freopen error return (bug 32140) +- Clear flags2 flags set from mode in freopen (bug 32134) +- Linux: readdir_r needs to report getdents failures (bug 32124) +- libio: Attempt wide backup free only for non-legacy code +- Do not set errno for overflowing NaN payload in strtod/nan (bug 32045) +- powerpc64: Fix syscall_cancel build for powerpc64le-linux-gnu [BZ #32125] +- Fix strtod subnormal rounding (bug 30220) +- manual: Add Descriptor-Relative Access section +- x86: Enable non-temporal memset for Hygon processors +- x86: Add cache information support for Hygon processors +- x86: Add new architecture type for Hygon processors +- powerpc64: Optimize strcpy and stpcpy for Power9/10 +- nptl: Fix Race conditions in pthread cancellation [BZ#12683] +- x86: Unifies 'strnlen-evex' and 'strnlen-evex512' implementations. +- string: strerror, strsignal cannot use buffer after dlmopen (bug 32026) +- ungetc: Fix backup buffer leak on program exit [BZ #27821] +- ungetc: Fix uninitialized read when putting into unused streams [BZ #27821] +- x86: Add `Avoid_STOSB` tunable to allow NT memset without ERMS +- x86: Use `Avoid_Non_Temporal_Memset` to control non-temporal path +- x86: Fix bug in strchrnul-evex512 [BZ #32078] +- manual: Document dprintf and vdprintf +- manual: Document generic printf error codes +- ARC: Regenerate ULPs +- support: Add options list terminator to the test driver +- Define __libc_initial for the static libc +- Turn on -Wimplicit-fallthrough by default if available +- elf: Remove struct dl_init_args from elf/dl-open.c +- nptl: Fix stray process left by tst-cancel7 blocking testing +- nptl: Reorder semaphore release in tst-cancel7 +- sysdeps: Re-flow and sort multiline gnu/Makefile definitions +- login: Re-flow and sort multiline Makefile definitions +- benchtests: Add random memset benchmark +- AArch64: Improve generic strlen +- rtld: Fix handling of '--' option +- manual/stdio: Further clarify putc, putwc, getc, and getwc +- stdlib: Allow concurrent quick_exit (BZ 31997) +- elf: Avoid re-initializing already allocated TLS in dlopen (bug 31717) +- elf: Clarify and invert second argument of _dl_allocate_tls_init +- Fix name space violation in fortify wrappers (bug 32052) +- iconv: Fix matching of multi-character transliterations (bug 31859) +- x86: Tunables may incorrectly set Prefer_PMINUB_for_stringop (bug 32047) +- x86: Add missing switch/case fall-through markers to init_cpu_features +- stdlib: Link tst-concurrent-exit with $(shared-thread-library) +- hurd: Fix missing pthread_ compat symbol in libc +- resolv: Fix tst-resolv-short-response for older GCC (bug 32042) +- Add mremap tests +- mremap: Update manual entry +- linux: Update the mremap C implementation [BZ #31968] +- Enhanced test coverage for strncmp, wcsncmp +- Enhance test coverage for strnlen, wcsnlen +- stdlib: Mark `abort` as `cold` +- stdlib: Allow concurrent exit (BZ 31997) +- Add F_DUPFD_QUERY from Linux 6.10 to bits/fcntl-linux.h +- Add STATX_SUBVOL from Linux 6.10 to bits/statx-generic.h +- Update syscall lists for Linux 6.10 +- assert: Mark `__assert_fail` as `cold` +- x86-64: Remove sysdeps/x86_64/x32/dl-machine.h + +* Wed Jul 31 2024 Patsy Griffin - 2.40-3 +- Auto-sync with upstream branch release/2.40/master, + commit 132a72f93cb4ad9f16b8469dc061de5f75f6a44e. +- manual: make setrlimit() description less ambiguous +- manual/stdio: Clarify putc and putwc +- malloc: add multi-threaded tests for aligned_alloc/calloc/malloc +- malloc: avoid global locks in tst-aligned_alloc-lib.c + +* Fri Jul 26 2024 Florian Weimer - 2.40-2 +- Support clearing options in /etc/resolv.conf, RES_OPTIONS with a - prefix +- Introduce the strict-error/RES_STRICTERR stub resolver option + +* Fri Jul 26 2024 Florian Weimer - 2.40-1 +- Switch to upstream 2.40 release branch +- Auto-sync with upstream branch release/2.40/master, + commit 145b5886379c8de4f0a1bca3556a4c3d7b6c24b2: +- manual: Do not mention STATIC_TLS in dynamic linker hardening recommendations +- resolv: Do not wait for non-existing second DNS response after error (bug 30081) +- resolv: Allow short error responses to match any query (bug 31890) +- Increase version number to 2.40 +- libc.pot: regenerate (only line number changes) +- x86: Disable non-temporal memset on Skylake Server + +* Thu Jul 18 2024 Arjun Shankar - 2.39.9000-35 +- ppc64le: Build early startup code with -mcpu=power8 + +* Mon Jul 15 2024 DJ Delorie - 2.39.9000-34 +- Auto-sync with upstream branch master, + commit a11e15ea0ab1ee8a1947b6be52beca53693f0991. +- math: Update alpha ulps +- hurd: Fix restoring message to be retried +- nptl: Convert tst-sem11 and tst-sem12 tests to use the test driver +- nptl: Add copyright notice tst-sem11 and tst-sem12 tests +- tests: XFAIL audit tests failing on all mips configurations, bug 29404 +- time/Makefile: Split and sort tests +- s390x: Fix segfault in wcsncmp [BZ #31934] + +* Sat Jul 13 2024 Zbigniew Jędrzejewski-Szmek - 2.39.9000-33 +- Rebuilt for the bin-sbin merge (again) + +* Wed Jul 10 2024 Florian Weimer - 2.39.9000-32 +- Auto-sync with upstream branch master, + commit 2e456ccf0c34a056e3ccafac4a0c7effef14d918: +- Linux: Make __rseq_size useful for feature detection (bug 31965) +- po: incorporate translations (bg) +- manual: add syscalls +- libio: handle opening a file when all files are closed (bug 31963) +- ldconfig: Ignore all GDB extension files +- ldconfig: Move endswithn into a new header file +- math: Update m68k ULPs +- stdlib: fix arc4random fallback to /dev/urandom (BZ 31612) +- elf: Make dl-rseq-symbols Linux only + +* Tue Jul 09 2024 Zbigniew Jędrzejewski-Szmek - 2.39.9000-31 +- Rebuilt for the bin-sbin merge +- ldconfig is moved to /usr/bin and paths are adjusted for merged-sbin + +* Thu Jul 04 2024 Arjun Shankar - 2.39.9000-30 +- Auto-sync with upstream branch master, + commit 2b92982e2369d292560793bee8e730f695f48ff3: +- nptl: fix potential merge of __rseq_* relro symbols +- riscv: Update nofpu libm test ulps +- manual: Recommendations for dynamic linker hardening +- socket: Add new test for shutdown +- elf/rtld: Fix auxiliary vector for enable_secure +- hppa/vdso: Provide 64-bit clock_gettime() vDSO only +- debug: Fix clang open fortify wrapper (BZ 31927) +- Add --disable-static-c++-tests option [BZ #31797] +- Add --disable-static-c++-link-check option [BZ #31412] +- Update mmap() flags and errors lists +- MIPSr6/math: Use builtin fma and fmaf +- elf: Support recursive use of dynamic TLS in interposed malloc +- Fix conditionals on mtrace-based tests (bug 31892) +- signal/Makefile: Split and sort tests +- x86: Set default non_temporal_threshold for Zhaoxin processors +- x86_64: Optimize large size copy in memmove-ssse3 +- x86: Set preferred CPU features on the KH-40000 and KX-7000 Zhaoxin processors +- Aarch64: Add new memset for Qualcomm's oryon-1 core +- Aarch64: Add memcpy for qualcomm's oryon-1 core +- debug: Fix clang open fortify wrapper (BZ 31927) +- debug: Fix clang mq_open fortify wrapper (BZ 31917) +- tests-mbwc: Silence gcc 14 -Werror=format-overflow= + +* Thu Jun 27 2024 Patsy Griffin - 2.39.9000-29 +- Move ANSI_X3.110-1983 support from main package to glibc-gconv-extra. + +* Thu Jun 27 2024 Patsy Griffin - 2.39.9000-28 +- Auto-sync with upstream branch master, + commit 21738846a19eb4a36981efd37d9ee7cb6d687494. +- time: Avoid memcmp overread in tzset (bug 31931) +- Fix strnlen doc re array size +- arm: Avoid UB in elf_machine_rel() +- LoongArch: Fix tst-gnu2-tls2 test case +- posix: Fix pidfd_spawn/pidfd_spawnp leak if execve fails (BZ 31695) +- INSTALL: regenerate +- Revert "MIPSr6/math: Use builtin fma and fmaf" +- INSTALL: Fix typo ibmlondouble to ibmlongdouble +- RISC-V: Execute a PAUSE hint in spin loops +- MIPSr6/math: Use builtin fma and fmaf +- po: incorporate translations (cs, de, hr, ko, pl, ro, ru, sv, uk, zh_CN) +- mtrace: make shell commands robust against meta characters +- hppa/vdso: Add wrappers for vDSO functions +- Update hppa libm-test-ulps +- Benchtests: Remove broken walk benchmarks +- Update hppa libm-test-ulps +- RISC-V: Update ulps +- MIPS: Update ulps + +* Thu Jun 20 2024 Florian Weimer - 2.39.9000-27 +- Auto-sync with upstream branch master, + commit dd144dce21c864781fade4561581d50fb4549956: +- malloc: Replace shell/Perl gate in mtrace +- s390x: Capture grep output in static PIE check +- i386: Update ulps +- malloc: Always install mtrace (bug 31892) +- Translations: Regenerate libc.pot +- s390x: Regenerate ULPs. +- LoongArch: Fix _dl_tlsdesc_dynamic in LSX case +- aarch64: Update ulps +- powerpc: Update ulps +- Linux: Include in dl-sysdep.c +- linux: add definitions for hugetlb page size encodings +- elf: Remove HWCAP_IMPORTANT +- elf: Remove LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask +- elf: Remove _DL_PLATFORMS_COUNT +- elf: Remove _DL_FIRST_PLATFORM +- elf: Remove _DL_HWCAP_PLATFORM +- elf: Remove platform strings in dl-procinfo.c +- elf: Remove _dl_string_platform +- elf: Remove loading legacy hwcaps/platform entries in dynamic loader +- x86: Remove HWCAP_START and HWCAP_COUNT +- math: Update mips32/mips64 ulps for log2p1 +- Convert to autoconf 2.72 (vanilla release, no distribution patches) +- Implement C23 exp2m1, exp10m1 +- Implement C23 log10p1 +- Implement C23 logp1 +- support: Include for NAME_MAX use in temp_file.c +- support: Include for atoi use in support_wait_for_thread_exit +- Extend tst-getconf.sh test with NPROCESSORS_CONF and NPROCESSORS_ONLN +- Define ISO 639-3 "ltg" (Latgalian) and add ltg_LV locale +- Minor code improvement to timespec_subtract example +- Modernize and fix doc’s “Date and Time” (BZ 31876) +- manual: minor language fix (bz 31340) +- x86: Fix value for `x86_memset_non_temporal_threshold` when it is undesirable +- elf: Change module-names to modules-names in comments +- resolv: Track single-request fallback via _res._flags (bug 31476) +- x86: Properly set x86 minimum ISA level [BZ #31883] +- tunables: sort tunables list (BZ 30027) +- linux: Remove __stack_prot + +* Wed Jun 12 2024 DJ Delorie - 2.39.9000-26 +- Auto-sync with upstream branch master, + commit e7ac92e6ca9784b397189df0b2e1fb34f425bab8. +- : Acknowledge that getdelim/getline are in POSIX +- localedata: Lowercase day and abday in cs_CZ +- x86: Properly set MINIMUM_X86_ISA_LEVEL for i386 [BZ #31867] +- x86: Enable non-temporal memset tunable for AMD +- hurd: Fix getxattr/listxattr returning ERANGE +- hurd: Fix setxattr return value on replacing +- hurd: Fix getxattr("gnu.translator") returning ENODATA +- hurd: Fix lsetxattr return value +- localedata: add new locales scn_IT +- support: Fix typo in xgetsockname error message +- getconf: Add NPROCESSORS_{CONF,ONLN} [BZ #31661] +- Linux: Add epoll ioctls +- Improve doc for time_t range (BZ 31808) +- difftime can throw exceptions +- malloc: New test to check malloc alternate path using memory obstruction +- math: Fix exp10 undefined left shift +- libio: Test for fdopen memory leak without SEEK_END support (bug 31840) +- Remove memory leak in fdopen (bug 31840) +- Add new AArch64 HWCAP2 definitions from Linux 6.9 to bits/hwcap.h +- Add more NT_ARM_* constants from Linux kernel to elf.h +- stdlib: Describe __cxa_finalize usage in function comment +- elf: Avoid some free (NULL) calls in _dl_update_slotinfo +- x86: Add seperate non-temporal tunable for memset +- x86: Improve large memset perf with non-temporal stores [RHEL-29312] +- elf: add note identifier for dlopen metadata +- elf: update NT_FDO_PACKAGING_METADATA spec URL + +* Wed May 29 2024 Arjun Shankar - 2.39.9000-25 +- Auto-sync with upstream branch master, + commit 0c1d2c277a59f08fd3232b33d18644ea890190ea: +- LoongArch: Use "$fcsr0" instead of "$r0" in _FPU_{GET,SET}CW +- x86_64: Reformat elf_machine_rela +- i386: Disable Intel Xeon Phi tests for GCC 15 and above (BZ 31782) +- difftime is pure, not const +- parse_fdinfo: Don't advance pointer twice [BZ #31798] +- elf/Makefile: Split and sort PIE tests +- Revert "Test fscanf of long double without " +- sysdeps/ieee754/ldbl-opt/Makefile: Split and sort libnldbl-calls +- Test fscanf of long double without +- sysdeps/ieee754/ldbl-opt/Makefile: Remove test-nldbl-redirect-static +- sysdeps/ieee754/ldbl-opt/Makefile: Split and sort tests +- s390x: Regenerate ULPs. +- powerpc: Remove duplicated versionsort from libm.a (BZ 31789) +- Update kernel version to 6.9 in header constant tests +- localedata: cv_RU: update translation + +* Thu May 23 2024 Patsy Griffin - 2.39.9000-24 +- Auto-sync with upstream branch master, + commit eaa8113bf0eb599025e3efdbe1bb214ee8dc645a. +- math: Provide missing math symbols on libc.a (BZ 31781) +- s390: Make utmp32, utmpx32, and login32 shared only (BZ 31790) +- microblaze: Remove cacheflush from libc.a (BZ 31788) +- powerpc: Remove duplicated llrintf and llrintf32 from libm.a (BZ 31787) +- powerpc: Remove duplicate strchrnul and strncasecmp_l libc.a (BZ 31786) +- loongarch: Remove duplicate strnlen in libc.a (BZ 31785) +- aarch64: Remove duplicate memchr/strlen in libc.a (BZ 31777) +- Update PIDFD_* constants for Linux 6.9 +- Define write_profiling functions only in profile library [BZ #31756] +- Don't provide XXXf128_do_not_use aliases [BZ #31757] +- Don't provide scalb/significand _FloatN aliases [BZ #31760] +- math: Fix isnanf128 static build (BZ 31774) +- math: Add support for auto static math tests +- Change _IO_stderr_/_IO_stdin_/_IO_stdout to compat symbols [BZ #31766] +- Obsolete _dl_mcount_wrapper in glibc 2.40 [BZ #31765] +- math: Fix i386 and m68k exp10 on static build (BZ 31775) +- math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) +- Remove the clone3 symbol from libc.a [BZ #31770] +- aarch64/fpu: Add vector variants of pow +- Compile libmvec with -fno-math-errno +- manual: clarify defintions of floating point exponent bounds (bug 31518) +- LoongArch: Update ulps +- LoongArch: Fix tst-gnu2-tls2 compiler error +- resolv: Make _res_opcodes a compat symbol [BZ #31764] +- i386: Don't define stpncpy alias when used in IFUNC [BZ #31768] +- powerpc: Update ulps +- arm: Update ulps +- aarch64: Update ulps +- math: Add more details to the test driver output. +- Implement C23 log2p1 +- Update syscall lists for Linux 6.9 +- Rename procutils_read_file to __libc_procutils_read_file [BZ #31755] +- nearbyint: Don't define alias when used in IFUNC [BZ #31759] +- Pass -nostdlib -nostartfiles together with -r [BZ #31753] + +* Wed May 22 2024 Florian Weimer - 2.39.9000-23 +- Use release instead of baserelease for glibc32 conflict + +* Sun May 19 2024 Florian Weimer - 2.39.9000-22 +- Add Conflicts:/Obsoletes: for glibc32 to glibc.i686 + +* Sun May 19 2024 Florian Weimer - 2.39.9000-21 +- Auto-sync with upstream branch master, + commit 8d7b6b4cb27d4dec1dd5f7960298c1699275f962: +- socket: Use may_alias on sockaddr structs (bug 19622) +- Use a doubly-linked list for _IO_list_all (bug 27777) +- powerpc64: Fix by using the configure value $libc_cv_cc_submachine [BZ #31629] +- aarch64/fpu: Add vector variants of cbrt +- aarch64/fpu: Add vector variants of hypot +- Use Linux 6.9 in build-many-glibcs.py +- localedata: Fix several issues with the set of characters considered 0-width [BZ #31370] +- math: Add GLIBC_TEST_LIBM_VERBOSE environment variable support. +- malloc: Improve aligned_alloc and calloc test coverage. +- Unify output from backtrace_symbols_fd with backtrace_symbols (bug 31730) +- manual: add dup3 +- Force DT_RPATH for --enable-hardcoded-path-in-tests +- powerpc: Fix __fesetround_inline_nocheck on POWER9+ (BZ 31682) +- localedata: add mdf_RU locale +- elf: Make glibc.rtld.enable_secure ignore alias environment variables +- elf: Remove glibc.rtld.enable_secure check from parse_tunables_string +- elf: Only process multiple tunable once (BZ 31686) + +* Wed May 15 2024 Arjun Shankar - 2.39.9000-20 +- i686: Move libc_malloc_debug.so.0 back to glibc +- Other arches: Move libmemusage.so to glibc-utils + +* Tue May 14 2024 Arjun Shankar - 2.39.9000-19 +- Move libc_malloc_debug.so.0 from glibc to glibc-utils + +* Mon May 06 2024 DJ Delorie - 2.39.9000-18 +- Auto-sync with upstream branch master, + commit 5f245f3bfbe61b2182964dafb94907e38284b806. +- Add crt1-2.0.o for glibc 2.0 compatibility tests +- powerpc: Optimized strncmp for power10 +- build-many-glibcs.py: Add openrisc hard float glibc variant +- or1k: Add hard float support +- or1k: Add hard float libm-test-ulps +- nscd: Use time_t for return type of addgetnetgrentX +- Add a test to check for duplicate definitions in the static library +- i686: Fix multiple definitions of __memmove_chk and __memset_chk +- i586: Fix multiple definitions of __memcpy_chk and __mempcpy_chk +- nscd: Typo inside comment in netgroup cache + +* Wed May 01 2024 Carlos O'Donell - 2.39.9000-17 +- Update License tag to match upstream. +- Auto-sync with upstream branch master, + commit 91695ee4598b39d181ab8df579b888a8863c4cab: +- time: Allow later version licensing. +- hurd: Stop mapping AT_NO_AUTOMOUNT to O_NOTRANS +- libio: Sort test variables in Makefile +- AArch64: Remove unused defines of CPU names +- Make sure INSTALL is ASCII plaintext again +- x86: In ld.so, diagnose missing APX support in APX-only builds +- elf: Also compile dl-misc.os with $(rtld-early-cflags) +- CVE-2024-33601, CVE-2024-33602: nscd: netgroup: Use two buffers in addgetnetgrentX (bug 31680) +- CVE-2024-33600: nscd: Avoid null pointer crashes after notfound response (bug 31678) +- CVE-2024-33600: nscd: Do not send missing not-found response in addgetnetgrentX (bug 31678) +- CVE-2024-33599: nscd: Stack-based buffer overflow in netgroup cache (bug 31677) +- i386: ulp update for SSE2 --disable-multi-arch configurations + +* Thu Apr 25 2024 Florian Weimer - 2.39.9000-16 +- Enable CPU compatibility diagnostics in ld.so (RHEL-31738) + +* Thu Apr 25 2024 Florian Weimer - 2.39.9000-15 +- Auto-sync with upstream branch master, + commit 41903cb6f460d62ba6dd2f4883116e2a624ee6f8: +- GLIBC-SA-2024-0004: add commit for 2.31 branch +- benchtests: Add difficult strstr needle for bruteforce algorithms +- x86: Define MINIMUM_X86_ISA_LEVEL in config.h [BZ #31676] +- LoongArch: Add glibc.cpu.hwcap support. +- nptl: Fix tst-cancel30 on kernels without ppoll_time64 support + +* Tue Apr 23 2024 Arjun Shankar - 2.39.9000-14 +- Drop glibc-rh827510.patch, fixed differently upstream. +- Auto-sync with upstream branch master, + commit 16c8dfba14ff7596ad3aea941a240f8abcdc50e6: +- Revert "Allow glibc to be compiled without EXEC_PAGESIZE" +- locale: Handle loading a missing locale twice (Bug 14247) +- elf: Do not check for loader mmap on tst-decorate-maps (BZ 31553) +- Use --enable-obsolete in build-many-glibcs.py for nios2-linux-gnu +- login: Use unsigned 32-bit types for seconds-since-epoch +- login: structs utmp, utmpx, lastlog _TIME_BITS independence (bug 30701) +- login: Check default sizes of structs utmp, utmpx, lastlog +- benchtests: Add random() benchmark +- advisories: Add Reported-By +- Fix 'Reported-By' to use Camel Case for commit 6a98f4640ea453f +- Document CVE-2024-2961 +- iconv: ISO-2022-CN-EXT: fix out-of-bound writes when writing escape sequence (CVE-2024-2961) +- elf/rtld: Count skipped environment variables for enable_secure + +* Mon Apr 22 2024 Florian Weimer - 2.39.9000-13 +- Build POWER10 multilib + +* Sun Apr 14 2024 Florian Weimer - 2.39.9000-12 +- Auto-sync with upstream branch master, + commit 14e56bd4ce15ac2d1cc43f762eb2e6b83fec1afe: +- powerpc: Fix ld.so address determination for PCREL mode (bug 31640) +- Revert "x86_64: Suppress false positive valgrind error" +- wcsmbs: Ensure wcstr worst-case linear execution time (BZ 23865) +- wcsmbs: Add test-wcsstr +- posix: Sync tempname with gnulib +- socket: Add new test for connect +- libsupport: Add xgetpeername + +* Tue Apr 09 2024 Patsy Griffin - 2.39.9000-11 +- Auto-sync with upstream branch master, + commit 42e48e720c78ab75eb8def9e866da52b0ac278df. +- nptl: Add tst-pthread-key1-static for BZ #21777 +- elf: Add ld.so test with non-existing program name +- elf: Check objname before calling fatal_error +- Use crtbeginT.o and crtend.o for non-PIE static executables +- aarch64: Enhanced CPU diagnostics for ld.so +- x86: Add generic CPUID data dumper to ld.so --list-diagnostics +- elf: Add CPU iteration support for future use in ld.so diagnostics +- timezone: sync to TZDB 2024a +- Fix bsearch, qsort doc to match POSIX better +- x86-64: Exclude FMA4 IFUNC functions for -mapxf +- Reinstate generic features-time64.h +- Cleanup __tls_get_addr on alpha/microblaze localplt.data +- arm: Remove ld.so __tls_get_addr plt usage +- aarch64: Remove ld.so __tls_get_addr plt usage +- math: x86 trunc traps when FE_INEXACT is enabled (BZ 31603) +- math: x86 floor traps when FE_INEXACT is enabled (BZ 31601) +- math: x86 ceill traps when FE_INEXACT is enabled (BZ 31600) +- aarch64/fpu: Add vector variants of erfc +- aarch64/fpu: Add vector variants of tanh +- aarch64/fpu: Add vector variants of sinh +- aarch64/fpu: Add vector variants of atanh +- aarch64/fpu: Add vector variants of asinh +- aarch64/fpu: Add vector variants of acosh +- aarch64/fpu: Add vector variants of cosh +- aarch64/fpu: Add vector variants of erf +- misc: Add support for Linux uio.h RWF_NOAPPEND flag +- manual: significand() uses FLT_RADIX, not 2 +- manual: Clarify return value of cbrt(3) +- manual: floor(log2(fabs(x))) has rounding errors +- manual: logb(x) is floor(log2(fabs(x))) +- powerpc: Add missing arch flags on rounding ifunc variants +- math: Reformat Makefile. +- Always define __USE_TIME_BITS64 when 64 bit time_t is used +- benchtests: Improve benchtests for strstr +- x86_64: Remove avx512 strstr implementation +- signal: Avoid system signal disposition to interfere with tests + +* Tue Mar 26 2024 DJ Delorie - 2.39.9000-10 +- Auto-sync with upstream branch master, + commit 96d1b9ac2321b565f340ba8f3674597141e3450d. +- RISC-V: Fix the static-PIE non-relocated object check +- htl: Implement some support for TLS_DTV_AT_TP +- htl: Respect GL(dl_stack_flags) when allocating stacks +- hurd: Use the RETURN_ADDRESS macro +- hurd: Disable Prefer_MAP_32BIT_EXEC on non-x86_64 for now +- Allow glibc to be compiled without EXEC_PAGESIZE +- hurd: Stop relying on VM_MAX_ADDRESS +- hurd: Move internal functions to internal header +- stdlib: Fix tst-makecontext2 log when swapcontext fails +- or1k: Add prctl wrapper to unwrap variadic args +- or1k: Only define fpu rouding and exceptions with hard-float +- or1k: Update libm test ulps +- AArch64: Check kernel version for SVE ifuncs + +* Wed Mar 20 2024 Florian Weimer - 2.39.9000-9 +- Drop glibc-rh2269799.patch, fixed differently upstream. +- Auto-sync with upstream branch master, + commit 1ea051145612f199d8716ecdf78b084b00b5a727: +- powerpc: Placeholder and infrastructure/build support to add Power11 related changes. +- powerpc: Add HWCAP3/HWCAP4 data to TCB for Power Architecture. +- elf: Enable TLS descriptor tests on aarch64 +- arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ 31372) +- Ignore undefined symbols for -mtls-dialect=gnu2 +- Add tst-gnu2-tls2mod1 to test-internal-extras +- x86-64: Allocate state buffer space for RDI, RSI and RBX (#2269799) +- riscv: Update nofpu libm test ulps +- Add STATX_MNT_ID_UNIQUE from Linux 6.8 to bits/statx-generic.h +- linux: Use rseq area unconditionally in sched_getcpu (bug 31479) +- aarch64: fix check for SVE support in assembler +- Update kernel version to 6.8 in header constant tests +- Update syscall lists for Linux 6.8 +- Use Linux 6.8 in build-many-glibcs.py +- powerpc: Remove power8 strcasestr optimization +- riscv: Fix alignment-ignorant memcpy implementation +- linux/sigsetops: fix type confusion (bug 31468) +- LoongArch: Correct {__ieee754, _}_scalb -> {__ieee754, _}_scalbf +- duplocale: protect use of global locale (bug 23970) + +* Sat Mar 16 2024 Florian Weimer - 2.39.9000-8 +- Global dynamic TLS access may clobber RBX (#2269799) + +* Fri Mar 15 2024 Florian Weimer - 2.39.9000-7 +- Do not generate ELF dependency information for glibc32 + +* Wed Mar 13 2024 Joseph Myers - 2.39.9000-6 +- Build glibc32 binary package from glibc sources as part of x86_64 build, + not from glibc32 SRPM that contains binaries from i686 RPM build. + +* Mon Mar 04 2024 Patsy Griffin - 2.39.9000-5 +- Auto-sync with upstream branch master, + commit b6e3898194bbae78910bbe9cd086937014961e45. +- x86-64: Simplify minimum ISA check ifdef conditional with if +- manual/tunables - Add entry for enable_secure tunable. +- NEWS: Move enable_secure_tunable from 2.39 to 2.40. +- riscv: Add and use alignment-ignorant memcpy +- riscv: Add ifunc helper method to hwprobe.h +- riscv: Enable multi-arg ifunc resolvers +- riscv: Add __riscv_hwprobe pointer to ifunc calls +- riscv: Add hwprobe vdso call support +- linux: Introduce INTERNAL_VSYSCALL +- riscv: Add Linux hwprobe syscall support +- rtld: Add glibc.rtld.enable_secure tunable. +- x86-64: Update _dl_tlsdesc_dynamic to preserve AMX registers +- x86_64: Suppress false positive valgrind error +- x86: Don't check XFD against /proc/cpuinfo +- x86-64: Don't use SSE resolvers for ISA level 3 or above +- x86: Update _dl_tlsdesc_dynamic to preserve caller-saved registers +- sysdeps/unix/sysv/linux/x86_64/Makefile: Add the end marker +- cdefs: Drop access attribute for _FORTIFY_SOURCE=3 (BZ #31383) +- s390: Improve static-pie configure tests +- x86: Change ENQCMD test to CHECK_FEATURE_PRESENT +- debug: Improve mqueue.h fortify warnings with clang +- debug: Improve fcntl.h fortify warnings with clang +- wcsmbs: Improve fortify with clang +- syslog: Improve fortify with clang +- socket: Improve fortify with clang +- unistd: Improve fortify with clang +- stdlib: Improve fortify with clang +- string: Improve fortify with clang +- libio: Improve fortify with clang +- cdefs.h: Add clang fortify directives +- Update SHARED-FILES and license for Unicode 15.1.0. +- aarch64/fpu: Sync libmvec routines from 2.39 and before with AOR +- S390: Do not clobber r7 in clone [BZ #31402] +- x86_64: Exclude SSE, AVX and FMA4 variants in libm multiarch +- hurd: Reformat Makefile. +- htl/tests: Reformat Makefile. +- htl: Reformat Makefile. +- hesiod: Reformat Makefile. +- gmon: Reformat Makefile. +- dlfcn: Reformat Makefile. +- dirent: Reformat Makefile. +- ctype: Reformat Makefile. +- csu: Reformat Makefile. +- conform: Reformat Makefile. +- Support compiling .S files with additional options +- x86-64: Save APX registers in ld.so trampoline +- benchtests: Add more benchtests for rounding functions. +- tests: gracefully handle AppArmor userns containment +- treewide: python-scripts: use `is None` for none-equality +- powerpc: Remove power7 strstr optimization +- arm: Use _dl_find_object on __gnu_Unwind_Find_exidx (BZ 31405) +- math: Update mips64 ulps + +* Tue Feb 27 2024 Arjun Shankar - 2.39.9000-4 +- Analyse glibc-2.39 sources for license information +- Migrate License field to SPDX identifiers for + https://docs.fedoraproject.org/en-US/legal/allowed-licenses/ + https://docs.fedoraproject.org/en-US/legal/update-existing-packages + (#2222074) + +* Thu Feb 22 2024 DJ Delorie - 2.39.9000-3 +- Auto-sync with upstream branch master, + commit b881f1efcd1b30c2afab3599b41ce9cd4864c823. +- elf: Add new LoongArch reloc types (110 to 126) into elf.h +- build-many-glibcs.py: Add s390 --disable-multi-arch / multi-arch configurations. +- sparc: Treat the version field in the FPU control word as reserved +- Implement setcontext/getcontext/makecontext/swapcontext for Hurd x86_64 +- Use proc_getchildren_rusage when available in getrusage and times. +- Linux: Switch back to assembly syscall wrapper for prctl (bug 29770) +- i386: Use generic memrchr in libc (bug 31316) + +* Thu Feb 15 2024 Carlos O'Donell - 2.39.9000-1 +- Auto-sync with upstream branch master, + commit ef7f4b1fef67430a8f3cfc77fa6aada2add851d7: +- Apply the Makefile sorting fix +- sysdeps/x86_64/Makefile (tests): Add the end marker +- sort-makefile-lines.py: Allow '_' in name and "^# name" +- trivial doc fix: remove weird phrase "syscall takes zero to five arguments" +- mips: Use builtins for ffs and ffsll +- x86: Expand the comment on when REP STOSB is used on memset +- x86: Do not prefer ERMS for memset on Zen3+ +- x86: Fix Zen3/Zen4 ERMS selection (BZ 30994) +- x86/cet: fix shadow stack test scripts +- test_printers_common.py: Remove invalid escape sequence +- elf: Remove attempt at env handling in elf/tst-rtld-list-diagnostics.py +- Add SOL_VSOCK from Linux 6.7 to bits/socket.h +- localedata: ssy_ER: Fix syntax error +- localedata: hr_HR: change currency to EUR/€ +- Change lv_LV collation to agree with the recent change in CLDR +- Add new AArch64 HWCAP2 definitions from Linux 6.7 to bits/hwcap.h +- string: Add hidden builtin definition for __strcpy_chk. +- arm: Remove wrong ldr from _dl_start_user (BZ 31339) +- LoongArch: Use builtins for ffs and ffsll +- Remove sysdeps/ia64/math-use-builtins-ffs.h +- Fix stringop-overflow warning in tst-strlcat2. +- mips: FIx clone3 implementation (BZ 31325) +- stdlib: fix qsort example in manual +- soft-fp: Add brain format support +- Rename c2x / gnu2x tests to c23 / gnu23 +- manual: Fix up stdbit.texi +- string: Use builtins for ffs and ffsll +- misc: tst-poll: Proper synchronize with child before sending the signal +- math: Remove bogus math implementations +- Refer to C23 in place of C2X in glibc +- elf: Remove _dl_sysdep_open_object hook function +- build-many-glibcs: relax version check to allow non-digit characters +- Use gcc __builtin_stdc_* builtins in stdbit.h if possible +- Open master branch for glibc 2.40 development + +* Wed Feb 7 2024 Florian Weimer - 2.39-2 +- Ignore symbolic links to . in sysroot construction + +* Fri Feb 02 2024 Carlos O'Donell - 2.39-1 +- Switch to upstream 2.39 release, + commit ef321e23c20eebc6d6fb4044425c00e6df27b05f +- Document CVE-2023-6246, CVE-2023-6779, and CVE-2023-6780 +- Update advisory format and introduce some automation +- manual/io: Fix swapped reading and writing phrase. +- Fix typo +- S390: Fix building with --disable-mutli-arch [BZ #31196] +- NEWS: insert advisories and fixed bugs for 2.39 +- contrib.texi: update +- INSTALL, install.texi: minor updates, regenerate +- libc.pot: regenerate +- version.h, include/features.h: Bump version to 2.39 +- Create ChangeLog.old/ChangeLog.28 * Wed Jan 31 2024 Florian Weimer - 2.38.9000-39 - Add noarch sysroot subpackages diff --git a/sources b/sources index e829191..d3dce74 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (glibc-2.38.9000-530-gddf542da94.tar.xz) = d6e19bbc1eaa22833124d2068570f0943fa3bac130ecc433875514e281fdabfcb976f67cf33c052d06a8ce7ab91134622e2d4df143d4efb1b4627b4c342960a7 +SHA512 (glibc-2.40.9000-399-ge2436d6f5a.tar.xz) = f50cb28fd54bc7dd77903e939e43aedff63e3ac7896b6c4a1e1938fea4c190512857d7a954971e9037b85a727795bb3c5692f4d85848ceaa9cd47fdb1c96aac2 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/Makefile b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/Makefile new file mode 100644 index 0000000..c003abc --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 +# Description: What the test does +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2023 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE estale-test.c refs + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: What the test does" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: gcc glibc-devel glibc-langpack-es glibc-langpack-ja glibc-langpack-fr glibc-langpack-de glibc-langpack-it glibc-langpack-ko glibc-langpack-pt glibc-langpack-ru glibc-langpack-zh" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL6 -RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/PURPOSE b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/PURPOSE new file mode 100644 index 0000000..64f3c96 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 +Description: What the test does +Author: Sergey Kolosov diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/estale-test.c b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/estale-test.c new file mode 100644 index 0000000..1a8efe2 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/estale-test.c @@ -0,0 +1,14 @@ +#include +#include +#include + +int +main (void) +{ + setlocale (LC_ALL, ""); + errno = ESTALE; + perror ("ESTALE"); + errno = EAGAIN; + perror ("EAGAIN"); + return 0; +} diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/main.fmf b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/main.fmf new file mode 100644 index 0000000..394a933 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/main.fmf @@ -0,0 +1,25 @@ +summary: What the test does +description: '' +contact: Sergey Kolosov +component: + - glibc +adjust: + - enabled: false + when: distro < rhel-8.9 +test: ./runtest.sh +framework: beakerlib +recommend: + - gcc + - glibc-devel + - glibc-langpack-es + - glibc-langpack-ja + - glibc-langpack-fr + - glibc-langpack-de + - glibc-langpack-it + - glibc-langpack-ko + - glibc-langpack-pt + - glibc-langpack-ru + - glibc-langpack-zh +duration: 10m +extra-summary: /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 +extra-task: /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_AT b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_AT new file mode 100644 index 0000000..3719e16 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_AT @@ -0,0 +1,2 @@ +ESTALE: Veraltete Dateizugriffsnummer (file handle) +EAGAIN: Die Ressource ist zur Zeit nicht verfgbar diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_DE b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_DE new file mode 100644 index 0000000..3719e16 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_DE @@ -0,0 +1,2 @@ +ESTALE: Veraltete Dateizugriffsnummer (file handle) +EAGAIN: Die Ressource ist zur Zeit nicht verfgbar diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_en_US b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_en_US new file mode 100644 index 0000000..0074184 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_en_US @@ -0,0 +1,2 @@ +ESTALE: Stale file handle +EAGAIN: Resource temporarily unavailable diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_es_ES b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_es_ES new file mode 100644 index 0000000..99ba394 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_es_ES @@ -0,0 +1,2 @@ +ESTALE: `handle' de fichero en desuso +EAGAIN: Recurso no disponible temporalmente diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR new file mode 100644 index 0000000..cb93f19 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR @@ -0,0 +1,2 @@ +ESTALE: Panne d'accs au fichier +EAGAIN: Ressource temporairement non disponible diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR.utf8 new file mode 100644 index 0000000..19bb87f --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR.utf8 @@ -0,0 +1,2 @@ +ESTALE: Panne d'accès au fichier +EAGAIN: Ressource temporairement non disponible diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_it_IT b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_it_IT new file mode 100644 index 0000000..20e9f4b --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_it_IT @@ -0,0 +1,2 @@ +ESTALE: Riferimento al file obsoleto +EAGAIN: Risorsa temporaneamente non disponibile diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP new file mode 100644 index 0000000..eb01dfe --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP @@ -0,0 +1,2 @@ +ESTALE: ŤեϥɥǤ +EAGAIN: ꥽ŪѤǤޤ diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP.utf8 new file mode 100644 index 0000000..1a4a02c --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP.utf8 @@ -0,0 +1,2 @@ +ESTALE: 古いファイルハンドルです +EAGAIN: リソースが一時的に利用できません diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ko_KR.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ko_KR.utf8 new file mode 100644 index 0000000..7855938 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ko_KR.utf8 @@ -0,0 +1,2 @@ +ESTALE: 끊어진 파일 핸들 +EAGAIN: 자원이 일시적으로 사용 불가능함 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_pt_BR.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_pt_BR.utf8 new file mode 100644 index 0000000..acb9aaa --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_pt_BR.utf8 @@ -0,0 +1,2 @@ +ESTALE: Manipulador de arquivo corrompido +EAGAIN: Recurso temporariamente indisponível diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ru_UA.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ru_UA.utf8 new file mode 100644 index 0000000..82324e0 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ru_UA.utf8 @@ -0,0 +1,2 @@ +ESTALE: Устаревший дескриптор файла +EAGAIN: Ресурс временно недоступен diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_CN.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_CN.utf8 new file mode 100644 index 0000000..c45e771 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_CN.utf8 @@ -0,0 +1,2 @@ +ESTALE: 过旧的文件句柄 +EAGAIN: 资源暂时不可用 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_CN.utf8_rhel b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_CN.utf8_rhel new file mode 100644 index 0000000..147901b --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_CN.utf8_rhel @@ -0,0 +1,2 @@ +ESTALE: 过旧的文件控柄 +EAGAIN: 资源暂时不可用 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_TW.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_TW.utf8 new file mode 100644 index 0000000..212c34d --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_TW.utf8 @@ -0,0 +1,2 @@ +ESTALE: 過舊的檔案控柄 +EAGAIN: 資源暫時無法取得 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/runtest.sh b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/runtest.sh new file mode 100755 index 0000000..3f5f818 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/runtest.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 +# Description: What the test does +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2023 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="glibc" +TESTPROG="estale-test" +TESTED_LANGS="de_AT de_DE en_US es_ES fr_FR fr_FR.utf8 it_IT ja_JP ja_JP.utf8 ko_KR.utf8 pt_BR.utf8 ru_UA.utf8 zh_CN.utf8 zh_TW.utf8" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "cp refs/orig_* $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest prepare + rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG" + rlAssertExists "$TESTPROG" + rlPhaseEnd + + for L in $TESTED_LANGS + do + rlPhaseStartTest estale-test-$L + rlRun -c "LANG=$L ./${TESTPROG} 2> out_$L" + if rlIsRHEL "<=9" && [ -f orig_${L}_rhel ] + then + rlAssertNotDiffer out_$L orig_${L}_rhel + else + rlAssertNotDiffer out_$L orig_$L + fi + rlLogInfo "out_$L:\n$(cat out_$L)" + rlPhaseEnd + done + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/Makefile b/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/Makefile new file mode 100644 index 0000000..3429bda --- /dev/null +++ b/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc +# Description: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 2h" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc rpm-build" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1430477" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/PURPOSE b/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/PURPOSE new file mode 100644 index 0000000..d31ceb1 --- /dev/null +++ b/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/PURPOSE @@ -0,0 +1,8 @@ +PURPOSE of /tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc +Description: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc) +Author: Sergey Kolosov +Bug summary: glibc: Missing else branch in __libc_calloc +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1430477 + +The test builds glibc, then does malloc.o recompilation and does checking that +there are no missing initializations for oldtop and oldtopsize variables. diff --git a/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/main.fmf b/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/main.fmf new file mode 100644 index 0000000..f5ff109 --- /dev/null +++ b/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/main.fmf @@ -0,0 +1,23 @@ +summary: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc) +description: | + Bug summary: glibc: Missing else branch in __libc_calloc + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1430477 + + The test builds glibc, then does malloc.o recompilation and does checking + that there are no missing initializations for oldtop and oldtopsize + variables. +contact: Sergey Kolosov +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1430477 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - rpm-build +duration: 2h +extra-summary: + /tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc +extra-task: + /tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc diff --git a/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/runtest.sh b/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/runtest.sh new file mode 100755 index 0000000..cfc5a1a --- /dev/null +++ b/tests/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc/runtest.sh @@ -0,0 +1,104 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc +# Description: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="glibc" + +rlJournalStart + rlPhaseStartSetup + PRARCH="$(rlGetPrimaryArch)" + BUILDDIR="$(rpm -E '%{_builddir}')" + SPECDIR="$(rpm -E '%{_specdir}')" + rlAssertRpm $PACKAGE + rlLog "Build directory: $BUILDDIR" + rlLog "Spec directory: $SPECDIR" + rlLog "Architecture : $PRARCH" + + rlLog "Cleaning build and spec directories of glibc files" + rlRun "rm -rf $BUILDDIR/glibc*" 0 "Cleaning $BUILDDIR/glibc*" + rlRun "rm -rf $SPECDIR/glibc*.spec" 0 "Cleaning $SPECDIR/glibc*.spec" + rlRun "rm -rf glibc*.src.rpm" 0 "Removing any present glibc src.rpm" + + rlLog "Installing glibc srpm" + rlFetchSrcForInstalled $PACKAGE + rlRun "rpm -Uhv $PACKAGE*.src.rpm" + rlAssertExists $SPECDIR/$PACKAGE.spec + + rlRun "yum-builddep -y $PACKAGE-*.src.rpm" 0 "Installing dependences" + rlPhaseEnd + + rlPhaseStartTest "Building glibc" + rlRun "rpmbuild -bc ${SPECDIR}/${PACKAGE}.spec &> glibc_build_log.txt" 0 "Unpacking $PACKAGE" + ISSUCCESS=$? + if [ $ISSUCCESS -ne 0 ] + then + rlFileSubmit glibc_build_log.txt + rlFail "Glibc compilation error" + fi + + if rlIsRHEL "==10"; then + BUILDS="$BUILDDIR/glibc-2.39/build*" + elif rlIsFedora ">=41"; then + BUILDS="$BUILDDIR/glibc*build/glibc*/build*" + else + BUILDS="$BUILDDIR/glibc*/build*" + fi + rlLog "Found builds at:" + for build in $BUILDS; do + rlLog "$build" + done; unset build + rlPhaseEnd + + rlPhaseStartTest "Check for uninitialized values" + for CURBUILD in $BUILDS + do + rlRun -c "pushd $CURBUILD" + rlRun -c "rm malloc/malloc.o" + rlRun -c "make -r PARALLELMFLAGS="" -C .. -C malloc objdir=`pwd` subdir=malloc &> malloc_build_log.txt" + rlAssertExists malloc_build_log.txt + rlAssertNotGrep "‘oldtop’ may be used uninitialized in this function" malloc_build_log.txt + rlAssertNotGrep "‘oldtopsize’ may be used uninitialized in this function" malloc_build_log.txt + rlFileSubmit malloc_build_log.txt ${CURBUILD}_malloc_build_log + rlRun -c "popd" + done + rlPhaseEnd + + rlPhaseStartCleanup + if [ -n "$KEEP_GLIBC_RESULTS" ]; then + rlLog "$(pwd) contains:" + rlLog "$(ls $(pwd))" + rlLog "Build Directory at: $(ls $BUILDDIR)" + rlLog "Spec File at: $(ls $SPECDIR/glibc*.spec)" + else + rlRun "rm glibc*.src.rpm" + rlRun "rm -rf $BUILDDIR/glibc* $SPECDIR/glibc*.spec" + fi + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/Makefile b/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/Makefile index 7006044..8b4b02f 100644 --- a/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/Makefile +++ b/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/Makefile @@ -53,7 +53,7 @@ $(METADATA): Makefile @echo "Type: Regression" >> $(METADATA) @echo "TestTime: 30m" >> $(METADATA) @echo "RunFor: glibc" >> $(METADATA) - @echo "Requires: glibc-devel glibc-debuginfo glibc-debuginfo-common gdb" >> $(METADATA) + @echo "Requires: glibc-devel glibc-debuginfo gdb" >> $(METADATA) @echo "Priority: Normal" >> $(METADATA) @echo "License: GPLv2+" >> $(METADATA) @echo "Confidential: no" >> $(METADATA) diff --git a/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/main.fmf b/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/main.fmf index 422d973..acc4ebd 100644 --- a/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/main.fmf +++ b/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/main.fmf @@ -11,11 +11,11 @@ component: - glibc test: ./runtest.sh framework: beakerlib -recommend: +require: - glibc-devel - glibc-debuginfo - - glibc-debuginfo-common - gdb + - gcc duration: 30m extra-summary: /tools/glibc/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value diff --git a/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/tst-getlogin_r.c b/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/tst-getlogin_r.c index c2dceb1..fd4f9a0 100644 --- a/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/tst-getlogin_r.c +++ b/tests/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value/tst-getlogin_r.c @@ -1,5 +1,6 @@ #include #include +#include #define BUFSIZE 1024 int main(int argc, char *argv[]) { int r=0,i,attempts=0; diff --git a/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/Makefile b/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/Makefile new file mode 100644 index 0000000..378022c --- /dev/null +++ b/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports +# Description: Test for BZ#1577212 (glibc Remove stray Sun RPC exports) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Alexandra Hájková " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1577212 (glibc Remove stray Sun RPC exports)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 1h" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc elfutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1577212" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/PURPOSE b/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/PURPOSE new file mode 100644 index 0000000..d77a6de --- /dev/null +++ b/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/PURPOSE @@ -0,0 +1,9 @@ +PURPOSE of /tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports +Description: Test for BZ#1577212 (glibc Remove stray Sun RPC exports) +Author: Alexandra Hájková +Bug summary: glibc: Remove stray Sun RPC exports +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1577212 + +Remove stray Sun RPC exports: In this context, “remove“ means that the default symbol version (the @@ part) +is gone, and there is only a compat symbol (with a single @). We cannot remove the compat symbols for +backwards compatibility reasons. diff --git a/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/main.fmf b/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/main.fmf new file mode 100644 index 0000000..e251cec --- /dev/null +++ b/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/main.fmf @@ -0,0 +1,24 @@ +summary: Test for BZ#1577212 (glibc Remove stray Sun RPC exports) +description: | + Bug summary: glibc: Remove stray Sun RPC exports + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1577212 + + Remove stray Sun RPC exports: In this context, “remove“ means that the + default symbol version (the @@ part) is gone, and there is only a compat + symbol (with a single @). We cannot remove the compat symbols for backwards + compatibility reasons. +contact: Alexandra Hájková +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1577212 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - elfutils +duration: 1h +extra-summary: + /tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports +extra-task: + /tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports diff --git a/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/runtest.sh b/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/runtest.sh new file mode 100755 index 0000000..6513c9a --- /dev/null +++ b/tests/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports/runtest.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports +# Description: Test for BZ#1577212 (glibc Remove stray Sun RPC exports) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="glibc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "eu-readelf --symbols=.dynsym /usr/lib64/libc.so.6 > log" + rlAssertNotGrep "svcauthdes_stats@@" log + rlAssertNotGrep "svc_pollfd@@" log + rlAssertNotGrep "rpc_createerr@@" log + rlAssertNotGrep "svc_fdset@@" log + rlAssertNotGrep "svc_max_pollfd@@" log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/Makefile b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/Makefile index 3bb1315..53389c1 100644 --- a/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/Makefile +++ b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/Makefile @@ -53,7 +53,7 @@ $(METADATA): Makefile @echo "Type: Regression" >> $(METADATA) @echo "TestTime: 20m" >> $(METADATA) @echo "RunFor: glibc" >> $(METADATA) - @echo "Requires: glibc glibc-debuginfo glibc-debuginfo-common glibc-common-debuginfo binutils" >> $(METADATA) + @echo "Requires: glibc glibc-debuginfo glibc-common-debuginfo binutils" >> $(METADATA) @echo "Priority: Normal" >> $(METADATA) @echo "License: GPLv2+" >> $(METADATA) @echo "Confidential: no" >> $(METADATA) diff --git a/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/main.fmf b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/main.fmf index 0171c47..fbaa011 100644 --- a/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/main.fmf +++ b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/main.fmf @@ -9,10 +9,9 @@ component: - glibc test: ./runtest.sh framework: beakerlib -recommend: +require: - glibc - glibc-debuginfo - - glibc-debuginfo-common - glibc-common-debuginfo - binutils duration: 20m diff --git a/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/main.fmf b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/main.fmf index 31302be..39acd0b 100644 --- a/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/main.fmf +++ b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/main.fmf @@ -14,5 +14,6 @@ recommend: - glibc - gdb duration: 15m +order: 1000 extra-summary: /tools/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries extra-task: /tools/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries diff --git a/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/runtest.sh b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/runtest.sh index e40714d..31bdebe 100755 --- a/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/runtest.sh +++ b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/runtest.sh @@ -48,7 +48,7 @@ rlJournalStart rlAssertGrep "ldconfig.*, stripped" output.log rlAssertGrep "iconvconfig.*, stripped" output.log rlAssertGrep "localedef.*, stripped" output.log - rlAssertGrep "ld-.*, not stripped" output.log + rlAssertGrep "$(readlink -f /usr/bin/ld.so).*, not stripped" output.log rlLogInfo "Content of output.log:\n$(cat output.log)" # some debugging info (e.g. pthread struct) should be accessible even without installed debuginfo packages diff --git a/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/main.fmf b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/main.fmf index 5acd701..c13e2eb 100644 --- a/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/main.fmf +++ b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/main.fmf @@ -7,6 +7,9 @@ link: contact: Sergey Kolosov component: - glibc +adjust: + - enabled: false + when: distro < rhel-9 test: ./runtest.sh framework: beakerlib recommend: diff --git a/tests/Regression/bz2007417-glibc-ldd-segfaults-when-inspecting/main.fmf b/tests/Regression/bz2007417-glibc-ldd-segfaults-when-inspecting/main.fmf index bcbba50..d2963d1 100644 --- a/tests/Regression/bz2007417-glibc-ldd-segfaults-when-inspecting/main.fmf +++ b/tests/Regression/bz2007417-glibc-ldd-segfaults-when-inspecting/main.fmf @@ -5,6 +5,9 @@ description: | contact: Sergey Kolosov component: - glibc +adjust: + - enabled: false + when: distro < rhel-9 test: ./runtest.sh framework: beakerlib recommend: diff --git a/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/main.fmf b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/main.fmf index 826bc25..eb82ecc 100644 --- a/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/main.fmf +++ b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/main.fmf @@ -7,6 +7,9 @@ link: contact: Sergey Kolosov component: - glibc +adjust: + - enabled: false + when: distro < rhel-9 test: ./runtest.sh framework: beakerlib recommend: diff --git a/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/main.fmf b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/main.fmf index 8f638fa..aad4b13 100644 --- a/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/main.fmf +++ b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/main.fmf @@ -7,6 +7,9 @@ link: contact: Sergey Kolosov component: - glibc +adjust: + - enabled: false + when: distro < rhel-9 test: ./runtest.sh framework: beakerlib recommend: diff --git a/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/Makefile b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/Makefile new file mode 100644 index 0000000..33f1a75 --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +# Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE tst-mktime.c + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc glibc-devel gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 2110357" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/PURPOSE b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/PURPOSE new file mode 100644 index 0000000..a5ccc83 --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when) +Author: Sergey Kolosov +Bug summary: glibc: mktime() fails with -EOVERFLOW when tm_isdst=1 and a neighboring DST boundary is far from tm_year +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2110357 diff --git a/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/main.fmf b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/main.fmf new file mode 100644 index 0000000..b4a5b47 --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/main.fmf @@ -0,0 +1,18 @@ +summary: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when) +description: | + Bug summary: glibc: mktime() fails with -EOVERFLOW when tm_isdst=1 and a neighboring DST boundary is far from tm_year + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2110357 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2110357 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - glibc-devel + - gcc +duration: 10m +extra-summary: /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +extra-task: /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when diff --git a/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/runtest.sh b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/runtest.sh new file mode 100755 index 0000000..77aaf34 --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/runtest.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +# Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="glibc" +TESTPROG="tst-mktime" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG" + rlAssertExists "$TESTPROG" + rlRun -c "./${TESTPROG}" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/tst-mktime.c b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/tst-mktime.c new file mode 100644 index 0000000..d73c97d --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/tst-mktime.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + time_t t; + struct tm tm; + + setenv("TZ", "Asia/Tokyo", 1); + + memset(&tm, 0, sizeof(tm)); + tm.tm_mday = 1; + tm.tm_mon = 1; + tm.tm_year = 2023; + tm.tm_isdst = 1; + + t = mktime(&tm); + printf("mktime(&tm) = %d\n", t); + if (t < 0) + exit(1); + + return 0; +} diff --git a/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/Makefile b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/Makefile new file mode 100644 index 0000000..2840e52 --- /dev/null +++ b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in +# Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: elfutils glibc glibc-debuginfo" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 2115831" >> $(METADATA) + @echo "Releases: RHEL8 RHEL9" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/PURPOSE b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/PURPOSE new file mode 100644 index 0000000..85effc3 --- /dev/null +++ b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in +Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,) +Author: Sergey Kolosov +Bug summary: glibc: missing .gnu_debuglink section in libc.so.6, redundant annobin symbols and debufginfo for ld.so +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2115831 diff --git a/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/main.fmf b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/main.fmf new file mode 100644 index 0000000..4a3341c --- /dev/null +++ b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/main.fmf @@ -0,0 +1,19 @@ +enabled: false +summary: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,) +description: | + Bug summary: glibc: missing .gnu_debuglink section in libc.so.6, redundant annobin symbols and debufginfo for ld.so + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2115831 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2115831 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - elfutils + - glibc + - glibc-debuginfo +duration: 20m +extra-summary: /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in +extra-task: /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in diff --git a/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/runtest.sh b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/runtest.sh new file mode 100755 index 0000000..ad288e4 --- /dev/null +++ b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/runtest.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in +# Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="glibc" +LIBC_SO_6_LIBS=$(find /usr/lib/ /usr/lib64/ -name libc.so.6) +TESTL2="/usr/bin/ld.so" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -l "rpm -ql glibc-debuginfo" + for LIB in $LIBC_SO_6_LIBS; do + rlRun -l "eu-readelf -S $LIB | grep -q .debug_" 1 + rlRun -l "eu-readelf -S $LIB | grep -q .gnu_debuglink" 0 + done + rlRun -l "eu-readelf -S $TESTL2 | grep -q .debug_" 0 + rlRun -l "eu-readelf -S $TESTL2 | grep -q .gnu_debuglink" 1 + rlRun -l "eu-readelf -s $TESTL2 | grep -q annobin" 1 + if rlIsRHEL "8"; then + rlRun -l "rpm -ql glibc-debuginfo|sort|grep '/ld-$(rpm -q --qf "%{VERSION}" ${PACKAGE}.`arch`)'" 1 + rlRun -l "rpm -ql glibc-debuginfo|sort|grep '/libc-$(rpm -q --qf "%{VERSION}" ${PACKAGE}.`arch`)'" 0 + elif rlIsRHEL ">=9" || rlIsFedora; then + rlRun -l "rpm -ql glibc-debuginfo|sort|grep ld-linux-" 1 + rlRun -l "rpm -ql glibc-debuginfo|sort|grep libc.so.6-" 0 + else + rlFail "Test does not support current distro (yet?)!" + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz434601-timedlock-segfault/main.fmf b/tests/Regression/bz434601-timedlock-segfault/main.fmf index c5f2a74..6f2d55b 100644 --- a/tests/Regression/bz434601-timedlock-segfault/main.fmf +++ b/tests/Regression/bz434601-timedlock-segfault/main.fmf @@ -13,8 +13,9 @@ contact: Petr Muller component: - glibc test: ./runtest.sh +tier: 2 framework: beakerlib -recommend: +require: - glibc - gcc tag: diff --git a/tests/Regression/bz434601-timedlock-segfault/runtest.sh b/tests/Regression/bz434601-timedlock-segfault/runtest.sh index a451879..b1bdd39 100755 --- a/tests/Regression/bz434601-timedlock-segfault/runtest.sh +++ b/tests/Regression/bz434601-timedlock-segfault/runtest.sh @@ -40,7 +40,7 @@ rlJournalStart rlPhaseEnd rlPhaseStartTest - rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG" + rlRun -c "gcc -pthread ${TESTPROG}.c -o $TESTPROG" rlAssertExists "$TESTPROG" rlRun -c "./${TESTPROG}" rlPhaseEnd diff --git a/tests/Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive/main.fmf b/tests/Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive/main.fmf index da5ba66..a737a0a 100644 --- a/tests/Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive/main.fmf +++ b/tests/Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive/main.fmf @@ -77,6 +77,7 @@ test: ./runtest.sh framework: beakerlib recommend: - glibc + - gcc tag: - simple - tier1_mfranc diff --git a/tests/Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive/testcase.c b/tests/Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive/testcase.c index 05c7a33..22f9419 100644 --- a/tests/Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive/testcase.c +++ b/tests/Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive/testcase.c @@ -1,5 +1,6 @@ #include #include +#include int main (void) diff --git a/tests/Regression/bz488748-inet6-opt-init-sets-incorrect-header-len/runtest.sh b/tests/Regression/bz488748-inet6-opt-init-sets-incorrect-header-len/runtest.sh index 44962e1..3649de7 100755 --- a/tests/Regression/bz488748-inet6-opt-init-sets-incorrect-header-len/runtest.sh +++ b/tests/Regression/bz488748-inet6-opt-init-sets-incorrect-header-len/runtest.sh @@ -34,7 +34,7 @@ PACKAGE="glibc" rlJournalStart rlPhaseStartSetup rlAssertRpm $PACKAGE - rlRun 'gcc optinit.c -o optinit' 0 "Compiling the testcase" + rlRun 'gcc -D_GNU_SOURCE optinit.c -o optinit' 0 "Compiling the testcase" rlPhaseEnd rlPhaseStartTest diff --git a/tests/Regression/bz529997-sem_timedwait-with-invalid-time/main.fmf b/tests/Regression/bz529997-sem_timedwait-with-invalid-time/main.fmf index 9cd0fec..32d87ae 100644 --- a/tests/Regression/bz529997-sem_timedwait-with-invalid-time/main.fmf +++ b/tests/Regression/bz529997-sem_timedwait-with-invalid-time/main.fmf @@ -149,6 +149,7 @@ contact: Petr Muller component: - glibc test: ./runtest.sh +tier: 2 framework: beakerlib require: - gcc diff --git a/tests/Regression/bz529997-sem_timedwait-with-invalid-time/real-reproducer.c b/tests/Regression/bz529997-sem_timedwait-with-invalid-time/real-reproducer.c index 471fe16..c01a116 100644 --- a/tests/Regression/bz529997-sem_timedwait-with-invalid-time/real-reproducer.c +++ b/tests/Regression/bz529997-sem_timedwait-with-invalid-time/real-reproducer.c @@ -5,6 +5,7 @@ #include #include #include +#include void func(sem_t *semp) { diff --git a/tests/Regression/bz549813-dl-close-race-with-C-destructor/C_Only.tar b/tests/Regression/bz549813-dl-close-race-with-C-destructor/C_Only.tar index 76a5dda..4063dab 100644 Binary files a/tests/Regression/bz549813-dl-close-race-with-C-destructor/C_Only.tar and b/tests/Regression/bz549813-dl-close-race-with-C-destructor/C_Only.tar differ diff --git a/tests/Regression/bz549813-dl-close-race-with-C-destructor/main.fmf b/tests/Regression/bz549813-dl-close-race-with-C-destructor/main.fmf index f786b6d..4c42793 100644 --- a/tests/Regression/bz549813-dl-close-race-with-C-destructor/main.fmf +++ b/tests/Regression/bz549813-dl-close-race-with-C-destructor/main.fmf @@ -92,6 +92,7 @@ contact: Petr Muller component: - glibc test: ./runtest.sh +tier: 2 framework: beakerlib require: - make diff --git a/tests/Regression/bz585674-free-race-in-mcheck-hooks/main.fmf b/tests/Regression/bz585674-free-race-in-mcheck-hooks/main.fmf index b0a168c..eecfcb5 100644 --- a/tests/Regression/bz585674-free-race-in-mcheck-hooks/main.fmf +++ b/tests/Regression/bz585674-free-race-in-mcheck-hooks/main.fmf @@ -50,8 +50,9 @@ contact: Petr Muller component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc - gcc - libgomp diff --git a/tests/Regression/bz600457-locally-defined-symbol-resolving-failure/main.fmf b/tests/Regression/bz600457-locally-defined-symbol-resolving-failure/main.fmf index beddb06..0bf0d00 100644 --- a/tests/Regression/bz600457-locally-defined-symbol-resolving-failure/main.fmf +++ b/tests/Regression/bz600457-locally-defined-symbol-resolving-failure/main.fmf @@ -127,6 +127,7 @@ contact: Petr Muller component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib require: - gcc diff --git a/tests/Regression/bz600457-locally-defined-symbol-resolving-failure/reproducer.tar.gz b/tests/Regression/bz600457-locally-defined-symbol-resolving-failure/reproducer.tar.gz index 9551435..1153a58 100644 Binary files a/tests/Regression/bz600457-locally-defined-symbol-resolving-failure/reproducer.tar.gz and b/tests/Regression/bz600457-locally-defined-symbol-resolving-failure/reproducer.tar.gz differ diff --git a/tests/Regression/bz656530-sqrtl-returns-highly-incorrect-results-for-some/main.fmf b/tests/Regression/bz656530-sqrtl-returns-highly-incorrect-results-for-some/main.fmf index 662e657..bf6eb57 100644 --- a/tests/Regression/bz656530-sqrtl-returns-highly-incorrect-results-for-some/main.fmf +++ b/tests/Regression/bz656530-sqrtl-returns-highly-incorrect-results-for-some/main.fmf @@ -10,8 +10,9 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc - gcc tag: diff --git a/tests/Regression/bz692177-sysconf-SC-CACHE-returns-0-for-all-caches-on/main.fmf b/tests/Regression/bz692177-sysconf-SC-CACHE-returns-0-for-all-caches-on/main.fmf index 5120de1..2bb020c 100644 --- a/tests/Regression/bz692177-sysconf-SC-CACHE-returns-0-for-all-caches-on/main.fmf +++ b/tests/Regression/bz692177-sysconf-SC-CACHE-returns-0-for-all-caches-on/main.fmf @@ -45,8 +45,9 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc tag: - simple diff --git a/tests/Regression/bz711531-shared-robust-mutexes-fail-in-child-fork/main.fmf b/tests/Regression/bz711531-shared-robust-mutexes-fail-in-child-fork/main.fmf index 88f16cd..05c79f0 100644 --- a/tests/Regression/bz711531-shared-robust-mutexes-fail-in-child-fork/main.fmf +++ b/tests/Regression/bz711531-shared-robust-mutexes-fail-in-child-fork/main.fmf @@ -6,8 +6,9 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc - gcc - glibc-devel diff --git a/tests/Regression/bz730379-libresolv-is-not-compiled-with-the-stack-protector/main.fmf b/tests/Regression/bz730379-libresolv-is-not-compiled-with-the-stack-protector/main.fmf index 299c175..083d34b 100644 --- a/tests/Regression/bz730379-libresolv-is-not-compiled-with-the-stack-protector/main.fmf +++ b/tests/Regression/bz730379-libresolv-is-not-compiled-with-the-stack-protector/main.fmf @@ -6,8 +6,9 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc - binutils tag: diff --git a/tests/Regression/bz731042-pthread-create-dumps-core-when-it-fails-to-set/main.fmf b/tests/Regression/bz731042-pthread-create-dumps-core-when-it-fails-to-set/main.fmf index 6cfc0c7..63cf32e 100644 --- a/tests/Regression/bz731042-pthread-create-dumps-core-when-it-fails-to-set/main.fmf +++ b/tests/Regression/bz731042-pthread-create-dumps-core-when-it-fails-to-set/main.fmf @@ -6,8 +6,9 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc - gcc tag: diff --git a/tests/Regression/bz789238-FJ6-2-Bug-malloc-deadlock-in-case-of/main.fmf b/tests/Regression/bz789238-FJ6-2-Bug-malloc-deadlock-in-case-of/main.fmf index 4768245..6c3a169 100644 --- a/tests/Regression/bz789238-FJ6-2-Bug-malloc-deadlock-in-case-of/main.fmf +++ b/tests/Regression/bz789238-FJ6-2-Bug-malloc-deadlock-in-case-of/main.fmf @@ -6,11 +6,11 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc - glibc-devel - - glibc-headers - gcc - coreutils tag: diff --git a/tests/Regression/bz804689-getaddrinfo-localhost6-returns-127-0-0-1/main.fmf b/tests/Regression/bz804689-getaddrinfo-localhost6-returns-127-0-0-1/main.fmf index cc9f6b1..be5187e 100644 --- a/tests/Regression/bz804689-getaddrinfo-localhost6-returns-127-0-0-1/main.fmf +++ b/tests/Regression/bz804689-getaddrinfo-localhost6-returns-127-0-0-1/main.fmf @@ -6,8 +6,9 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc - gcc tag: diff --git a/tests/Regression/bz819430-fnmatch-fails-when-wildcard-is-applied-on/main.fmf b/tests/Regression/bz819430-fnmatch-fails-when-wildcard-is-applied-on/main.fmf index fc4be7c..9776dc9 100644 --- a/tests/Regression/bz819430-fnmatch-fails-when-wildcard-is-applied-on/main.fmf +++ b/tests/Regression/bz819430-fnmatch-fails-when-wildcard-is-applied-on/main.fmf @@ -6,8 +6,9 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc - gcc tag: diff --git a/tests/Regression/bz827362-RHEL6-2-ftell-after-fseek-moves-the-offset-on-a/test.c b/tests/Regression/bz827362-RHEL6-2-ftell-after-fseek-moves-the-offset-on-a/test.c index 496fe4c..b8636bb 100644 --- a/tests/Regression/bz827362-RHEL6-2-ftell-after-fseek-moves-the-offset-on-a/test.c +++ b/tests/Regression/bz827362-RHEL6-2-ftell-after-fseek-moves-the-offset-on-a/test.c @@ -1,6 +1,7 @@ #include #include #include +#include int main(int argc, char** argv) { diff --git a/tests/Regression/bz839572-Anaconda-traceback-when-installing-on-s390x/main.fmf b/tests/Regression/bz839572-Anaconda-traceback-when-installing-on-s390x/main.fmf index cf595ca..236b663 100644 --- a/tests/Regression/bz839572-Anaconda-traceback-when-installing-on-s390x/main.fmf +++ b/tests/Regression/bz839572-Anaconda-traceback-when-installing-on-s390x/main.fmf @@ -6,6 +6,7 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib recommend: - glibc diff --git a/tests/Regression/bz863384-getaddrinfo-fails-to-return-FQDN-for-AF_INET-and-AF_INET6/main.fmf b/tests/Regression/bz863384-getaddrinfo-fails-to-return-FQDN-for-AF_INET-and-AF_INET6/main.fmf index c88d3fd..50f30d4 100644 --- a/tests/Regression/bz863384-getaddrinfo-fails-to-return-FQDN-for-AF_INET-and-AF_INET6/main.fmf +++ b/tests/Regression/bz863384-getaddrinfo-fails-to-return-FQDN-for-AF_INET-and-AF_INET6/main.fmf @@ -1,5 +1,8 @@ summary: Tests if 'getaddrinfo' returns FQDN in ai_canonname. description: '' +adjust: + - enabled: false + when: distro > rhel-9 contact: Arjun Shankar component: - glibc diff --git a/tests/Regression/double_free_exploit/exploit.c b/tests/Regression/double_free_exploit/exploit.c index dfc0420..f2491e2 100644 --- a/tests/Regression/double_free_exploit/exploit.c +++ b/tests/Regression/double_free_exploit/exploit.c @@ -1,6 +1,7 @@ -#include -#include +#include +#include #include +#include int main(void) { unsigned int *chunk; @@ -17,8 +18,8 @@ int main(void) { */ chunk[0] = -0x10; /* prev_size */ chunk[1] = 0x8; /* size */ - chunk[2] = shellcode; /* fd */ - chunk[3] = shellcode; /* bk */ + chunk[2] = (int) shellcode; /* fd */ + chunk[3] = (int) shellcode; /* bk */ /* set fd to the adres of the return address - 3 the minus 3 is needed because fd[3] will become bk diff --git a/tests/Regression/double_free_exploit/exploit2.c b/tests/Regression/double_free_exploit/exploit2.c index b9eb76f..be9f77a 100644 --- a/tests/Regression/double_free_exploit/exploit2.c +++ b/tests/Regression/double_free_exploit/exploit2.c @@ -1,4 +1,7 @@ -main() +#include +#include + +int main() { int *a,*b,*c,*d,*e; b=malloc(8); diff --git a/tests/Regression/double_free_exploit/main.fmf b/tests/Regression/double_free_exploit/main.fmf index 7261ef4..5bdac44 100644 --- a/tests/Regression/double_free_exploit/main.fmf +++ b/tests/Regression/double_free_exploit/main.fmf @@ -5,8 +5,9 @@ contact: Petr Muller component: - glibc test: ./runtest.sh +tier: 2 framework: beakerlib -recommend: +require: - glibc - glibc-devel - gcc diff --git a/tests/Regression/fallocate_156289/main.fmf b/tests/Regression/fallocate_156289/main.fmf index 5974203..6304313 100644 --- a/tests/Regression/fallocate_156289/main.fmf +++ b/tests/Regression/fallocate_156289/main.fmf @@ -5,8 +5,9 @@ contact: David Malcolm component: - glibc test: ./runtest.sh +tier: 2 framework: beakerlib -recommend: +require: - glibc - gcc-c++ tag: diff --git a/tests/Sanity/basic-linking-sanity/lc.c b/tests/Sanity/basic-linking-sanity/lc.c index 2b4f286..23679f4 100644 --- a/tests/Sanity/basic-linking-sanity/lc.c +++ b/tests/Sanity/basic-linking-sanity/lc.c @@ -15,7 +15,7 @@ int main(){ two[3] = '\0'; fprintf(fp, "Two: %s, length %d\n", two, strlen(two)); - close(fp); + fclose(fp); free(two); return 0; } diff --git a/tests/Sanity/basic-linking-sanity/lm.c b/tests/Sanity/basic-linking-sanity/lm.c index 72612b9..ca45637 100644 --- a/tests/Sanity/basic-linking-sanity/lm.c +++ b/tests/Sanity/basic-linking-sanity/lm.c @@ -8,6 +8,6 @@ int main(){ fprintf(fp, "SIN: %0.2f\n", 1.0); - close(fp); + fclose(fp); return 0; } diff --git a/tests/Sanity/basic-linking-sanity/lpthread.c b/tests/Sanity/basic-linking-sanity/lpthread.c index 65aca15..7ce81d7 100644 --- a/tests/Sanity/basic-linking-sanity/lpthread.c +++ b/tests/Sanity/basic-linking-sanity/lpthread.c @@ -41,6 +41,6 @@ int main(){ pthread_join(tw, NULL); pthread_join(on, NULL); - close(fp); + fclose(fp); return 0; } diff --git a/tests/Sanity/basic-linking-sanity/lrt.c b/tests/Sanity/basic-linking-sanity/lrt.c index 2a31e0d..daadf29 100644 --- a/tests/Sanity/basic-linking-sanity/lrt.c +++ b/tests/Sanity/basic-linking-sanity/lrt.c @@ -1,4 +1,5 @@ #include +#include #include int main(){ @@ -16,6 +17,6 @@ int main(){ else fprintf(fp, "shm_unlink successful\n"); - close(fp); + fclose(fp); return 0; } diff --git a/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/main.fmf b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/main.fmf index 13cda56..f2c7353 100644 --- a/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/main.fmf +++ b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/main.fmf @@ -7,6 +7,9 @@ link: contact: Martin Coufal component: - glibc +adjust: + - enabled: false + when: distro < rhel-8.6 test: ./runtest.sh framework: beakerlib recommend: diff --git a/tests/Standardscompliance/bz531160-ldd-Vulnerable-to-Social-Engineering-Exploits/interp.c b/tests/Standardscompliance/bz531160-ldd-Vulnerable-to-Social-Engineering-Exploits/interp.c index 965d3d1..4030866 100644 --- a/tests/Standardscompliance/bz531160-ldd-Vulnerable-to-Social-Engineering-Exploits/interp.c +++ b/tests/Standardscompliance/bz531160-ldd-Vulnerable-to-Social-Engineering-Exploits/interp.c @@ -1,3 +1,5 @@ +#include + #define MESG "you are not suppposed to see this\n" int main() diff --git a/tests/Standardscompliance/bz531160-ldd-Vulnerable-to-Social-Engineering-Exploits/main.fmf b/tests/Standardscompliance/bz531160-ldd-Vulnerable-to-Social-Engineering-Exploits/main.fmf index 3b23534..2c38424 100644 --- a/tests/Standardscompliance/bz531160-ldd-Vulnerable-to-Social-Engineering-Exploits/main.fmf +++ b/tests/Standardscompliance/bz531160-ldd-Vulnerable-to-Social-Engineering-Exploits/main.fmf @@ -6,8 +6,9 @@ contact: Miroslav Franc component: - glibc test: ./runtest.sh +tier: 1 framework: beakerlib -recommend: +require: - glibc - glibc-static - glibc-common diff --git a/wrap-find-debuginfo.sh b/wrap-find-debuginfo.sh index 1fae784..5257de7 100644 --- a/wrap-find-debuginfo.sh +++ b/wrap-find-debuginfo.sh @@ -18,7 +18,13 @@ set -ex workdir="$(mktemp -d -t find_debuginfo.XXXXXX)" ldso_tmp="$workdir/ld.so" -libc_tmp="$workdir/libc.so" +libc_tmp_dir="$workdir/" + +# Return the path where a libc should be saved temporarily. This path is +# based on its original path received in $1. +libc_tmp_path() { + echo "$libc_tmp_dir"`dirname "$1"`"/libc.so" +} # Prefer a separately installed debugedit over the RPM-integrated one. if command -v debugedit >/dev/null ; then @@ -34,54 +40,65 @@ trap cleanup 0 sysroot_path="$1" shift +# Resolve symbolic link, so that the activities below only alter the +# file it points to. +ldso_path="$(readlink -f "$sysroot_path/$1")" +shift script_path="$1" shift -# See ldso_path setting in glibc.spec. -ldso_path= -for ldso_candidate in `find "$sysroot_path" -maxdepth 2 \ - -regextype posix-extended -regex '.*/ld(-.*|64|)\.so\.[0-9]+$' -type f` ; do - if test -z "$ldso_path" ; then - ldso_path="$ldso_candidate" - else - echo "error: multiple ld.so candidates: $ldso_path, $ldso_candidate" - exit 1 - fi -done - # libc.so.6 always uses this name, so it is simpler to locate. -libc_path= -for libc_candidate in `find "$sysroot_path" -maxdepth 2 -name libc.so.6`; do - if test -z "$libc_path" ; then - libc_path="$libc_candidate" - else - echo "error: multiple libc.so.6 candidates: $libc_path, $libc_candidate" - exit 1 - fi -done +# This can result in multiple paths, hence the loop below. +libc_path=`find "$sysroot_path" -name libc.so.6` # Preserve the original files. cp "$ldso_path" "$ldso_tmp" -cp "$libc_path" "$libc_tmp" +for lib in $libc_path ; do + libtmp=`libc_tmp_path $lib` + mkdir -p `dirname "$libtmp"` + cp "$lib" "$libtmp" +done # Run the debuginfo extraction. "$script_path" "$@" -# libc.so.6: Extract the .gnu_debuglink section -objcopy -j.gnu_debuglink --set-section-flags .gnu_debuglink=alloc \ - -O binary "$libc_path" "$libc_tmp.debuglink" +for lib in $libc_path ; do + libtmp=`libc_tmp_path "$lib"` + # libc.so.6: Extract the .gnu_debuglink section + objcopy -j.gnu_debuglink --set-section-flags .gnu_debuglink=alloc \ + -O binary "$lib" "$libtmp.debuglink" + # Restore the original files. + cp "$libtmp" "$lib" -# Restore the original files. + # Reduce the size of libc notes. Primarily for annobin. + objcopy --merge-notes "$lib" + + # libc.so.6: Restore the .gnu_debuglink section + objcopy --add-section .gnu_debuglink="$libtmp.debuglink" "$lib" + + # libc.so.6: Reduce to valuable symbols. Eliminate file symbols, + # annobin symbols, and symbols used by the glibc build to implement + # hidden aliases (__EI_*). We would also like to remove __GI_* + # symbols, but even listing them explicitly (as in -K __GI_strlen) + # still causes strip to remove them, so there is no filtering of + # __GI_* here. (Debuginfo is gone after this, so no need to optimize + # it.) + strip -w \ + -K '*' \ + -K '!*.c' \ + -K '!*.os' \ + -K '!.annobin_*' \ + -K '!__EI_*' \ + -K '!__PRETTY_FUNCTION__*' \ + "$lib" +done + +# Restore the original ld.so. cp "$ldso_tmp" "$ldso_path" -cp "$libc_tmp" "$libc_path" # Reduce the size of notes. Primarily for annobin. objcopy --merge-notes "$ldso_path" -objcopy --merge-notes "$libc_path" - -# libc.so.6: Restore the .gnu_debuglink section -objcopy --add-section .gnu_debuglink="$libc_tmp.debuglink" "$libc_path" # ld.so does not have separated debuginfo and so the debuginfo file # generated by find-debuginfo is redundant. Therefore, remove it. @@ -98,22 +115,6 @@ for ldso_debug_candidate in `find "$sysroot_path" -maxdepth 2 \ done rm -f "$ldso_debug" -# libc.so.6: Reduce to valuable symbols. Eliminate file symbols, -# annobin symbols, and symbols used by the glibc build to implement -# hidden aliases (__EI_*). We would also like to remove __GI_* -# symbols, but even listing them explicitly (as in -K __GI_strlen) -# still causes strip to remove them, so there is no filtering of -# __GI_* here. (Debuginfo is gone after this, so no need to optimize -# it.) -strip -w \ - -K '*' \ - -K '!*.c' \ - -K '!*.os' \ - -K '!.annobin_*' \ - -K '!__EI_*' \ - -K '!__PRETTY_FUNCTION__*' \ - "$libc_path" - # ld.so: Rewrite the source file paths to match the extracted # locations. First compute the arguments for invoking debugedit. # See find-debuginfo.sh. @@ -137,7 +138,7 @@ done debug_base_name=${last_arg:-$RPM_BUILD_ROOT} $debugedit -b "$debug_base_name" -d "$debug_dest_name" -n $ldso_path # Remove the .annobin* symbols (and only them). -if nm --format=just-symbols "$ldso_path" \ +if nm --format=posix "$ldso_path" | cut -d' ' -f1 \ | grep '^\.annobin' > "$ldso_tmp.annobin-symbols"; then objcopy --strip-symbols="$ldso_tmp.annobin-symbols" "$ldso_path" fi