From b7f904012afa12969615651d6f0eadce14353ccb Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 3 Sep 2025 16:04:49 +0000 Subject: [PATCH] Fix sysdeps/mips/dl-machine-reject-phdr.h build with GCC 16 Building for MIPS has been broken with GCC mainline since mid-July, probably GCC commit 0eac9cfee8cb0b21de866a04d5d59685ab35208f "c, c++: Extend -Wunused-but-set-* warnings [PR44677]", because the variable perfect_match in elf_machine_reject_phdr_p is set unconditionally, but only used if _MIPS_SIM == _ABIO32. Mark it with __attribute__ ((unused)), which seems cleaner in such a conditionally-used case than making all other logic relating to this variable conditional. Tested with build-many-glibcs.py (compilers build, which previously failed) for mips64-linux-gnu. --- sysdeps/mips/dl-machine-reject-phdr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/mips/dl-machine-reject-phdr.h b/sysdeps/mips/dl-machine-reject-phdr.h index 72bb9087a8..46852d241f 100644 --- a/sysdeps/mips/dl-machine-reject-phdr.h +++ b/sysdeps/mips/dl-machine-reject-phdr.h @@ -162,7 +162,7 @@ elf_machine_reject_phdr_p (const ElfW(Phdr) *phdr, unsigned int phnum, int in_abi = -1; struct abi_req in_req; Elf_MIPS_ABIFlags_v0 mips_abiflags; - bool perfect_match = false; + bool perfect_match __attribute__ ((unused)) = false; #if _MIPS_SIM == _ABIO32 unsigned int cur_mode = -1; # if HAVE_PRCTL_FP_MODE