glibc/sysdeps
Joseph Myers af16a59ee1 Fix Hurd getcwd build with GCC >= 13
The build of glibc for i686-gnu has been failing for a while with GCC
mainline / GCC 13:

../sysdeps/mach/hurd/getcwd.c: In function '__hurd_canonicalize_directory_name_internal':
../sysdeps/mach/hurd/getcwd.c:242:48: error: pointer 'file_name' may be used after 'realloc' [-Werror=use-after-free]
  242 |                   file_namep = &buf[file_namep - file_name + size / 2];
      |                                     ~~~~~~~~~~~^~~~~~~~~~~
../sysdeps/mach/hurd/getcwd.c:236:25: note: call to 'realloc' here
  236 |                   buf = realloc (file_name, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~

Fix by doing the subtraction before the reallocation.

Tested with build-many-glibcs.py for i686-gnu.

[samuel.thibault@ens-lyon.rg: Removed mention of this being a bug]

Message-Id: <18587337-7815-4056-ebd0-724df262d591@codesourcery.com>
2023-04-27 01:27:28 +02:00
..
aarch64 aarch64: update libm test ulps 2023-02-24 10:55:38 +00:00
alpha alpha: Remove strncmp optimization 2023-03-02 16:41:43 -03:00
arc ARC:fpu: add extra capability check before use of sqrt and fma builtins 2023-02-17 16:17:58 -03:00
arm Update arm libm-tests-ulps 2023-03-30 10:50:50 -03:00
csky C-SKY: Strip hard float abi from hard float feature. 2023-02-07 16:34:24 +08:00
generic elf: Stop including tls.h in ldsodefs.h 2023-04-10 23:26:28 +02:00
gnu Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hppa hppa: Update struct __pthread_rwlock_arch_t comment. 2023-04-05 18:54:47 +00:00
htl htl: move pthread_self info libc. 2023-04-05 01:26:36 +02:00
hurd Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
i386 math: Remove the error handling wrapper from fmod and fmodf 2023-04-03 16:45:27 -03:00
ia64 ia64: Regenerate ulps 2023-01-24 11:21:38 -05:00
ieee754 math: Improve fmod(f) performance 2023-04-17 13:03:10 +01:00
loongarch LoongArch: Add get_rounding_mode. 2023-03-13 09:20:42 +08:00
m68k math: Remove the error handling wrapper from fmod and fmodf 2023-04-03 16:45:27 -03:00
mach Fix Hurd getcwd build with GCC >= 13 2023-04-27 01:27:28 +02:00
microblaze Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
mips Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
nios2 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
nptl Created tunable to force small pages on stack allocation. 2023-04-20 13:54:24 -03:00
or1k Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
posix system: Add "--" after "-c" for sh (BZ #28519) 2023-03-28 10:12:30 -03:00
powerpc powerpc: Disable stack protector in early static initialization 2023-04-03 17:42:08 -03:00
pthread Use O_CLOEXEC in more places (BZ #15722) 2023-04-22 13:50:14 +02:00
riscv riscv: Add string-fza.h and string-fzi.h 2023-02-06 16:19:35 -03:00
s390 Remove --enable-tunables configure option 2023-03-29 14:33:06 -03:00
sh sh: Add string-fzb.h 2023-02-06 16:19:35 -03:00
sparc Remove --enable-tunables configure option 2023-03-29 14:33:06 -03:00
unix if_index: Remove unneeded alloca.h include 2023-04-26 08:06:49 -04:00
wordsize-32 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
wordsize-64 C2x strtol binary constant handling 2023-02-16 23:02:40 +00:00
x86 <sys/platform/x86.h>: Add PREFETCHI support 2023-04-05 14:46:10 -07:00
x86_64 hurd: Implement prefer_map_32bit_exec tunable 2023-04-24 22:48:35 +02:00