From 66a87f8cfdd4d8423b521cbcfc28f977ea63f1a1 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Fri, 23 Nov 2018 18:23:29 +0000 Subject: [PATCH] rtld: Silence a false positive GCC 6.4.0 warning The function reloc_non_plt has complicated variable lifetimes that GCC 6.4.0 (the version currently used by amd64-xtoolchain-gcc) misunderstands and produces an erroneous warning about. Silence it to allow the -Werror build to proceed. Reviewed by: emaste --- libexec/rtld-elf/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 108c1ac03644..407442f918ca 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -102,6 +102,10 @@ ${PROG_FULL}: ${VERSION_MAP} # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+= -Wno-redundant-decls +# GCC (6.4.0) doesn't grok the complicated lifetimes in reloc_non_plt(): +.if ${MACHINE_CPUARCH} == "amd64" +CFLAGS.reloc.c+=-Wno-maybe-uninitialized +.endif .if ${COMPILER_VERSION} < 40300 # Silence -Wshadow false positives in ancient GCC CFLAGS+= -Wno-shadow