RFC: Compile some files with -fno-strict-aliasing
Andreas Jaeger
aj@suse.de
Fri Jul 1 20:27:00 GMT 2011
gcc produces a number of strict aliasing warnings building glibc and we're
using the following patch for this.
Is this patch acceptable? In that case I resubmit with ChangeLog and copyright
year updated - otherwise please tell me how to improve it,
Andreas
Index: elf/Makefile
===================================================================
--- elf/Makefile.orig
+++ elf/Makefile
@@ -133,6 +133,7 @@ include ../Makeconfig
ifeq ($(unwind-find-fde),yes)
routines += unwind-dw2-fde-glibc
shared-only-routines += unwind-dw2-fde-glibc
+CFLAGS-unwind-dw2-fde-glibc.c = -fno-strict-aliasing
endif
before-compile = $(objpfx)trusted-dirs.h
Index: inet/Makefile
===================================================================
--- inet/Makefile.orig
+++ inet/Makefile
@@ -57,6 +57,8 @@ tests := htontest test_ifindex tst-ntoa
include ../Rules
+CFLAGS-tst-inet6_rth.c = -fno-strict-aliasing
+
ifeq ($(have-thread-library),yes)
CFLAGS-gethstbyad_r.c = -DUSE_NSCD=1 -fexceptions
Index: nis/Makefile
===================================================================
--- nis/Makefile.orig
+++ nis/Makefile
@@ -69,6 +69,8 @@ libnss_nisplus-inhibit-o = $(filter-out
include ../Rules
+CFLAGS-nis_findserv.c = -fno-strict-aliasing
+CFLAGS-ypclnt.c = -fno-strict-aliasing
$(objpfx)libnss_compat.so: $(objpfx)libnsl.so$(libnsl.so-version)
$(objpfx)libnss_nis.so: $(objpfx)libnsl.so$(libnsl.so-version) \
Index: nss/Makefile
===================================================================
--- nss/Makefile.orig
+++ nss/Makefile
@@ -75,6 +75,7 @@ endif
include ../Rules
+CFLAGS-files-hosts.c = -fno-strict-aliasing
ifeq (yes,$(build-static-nss))
$(objpfx)getent: $(objpfx)libnss_files.a
Index: resolv/Makefile
===================================================================
--- resolv/Makefile.orig
+++ resolv/Makefile
@@ -77,6 +77,7 @@ CPPFLAGS += -Dgethostbyname=res_gethostb
-Dgetnetbyaddr=res_getnetbyaddr
CFLAGS-res_hconf.c = -fexceptions
+CFLAGS-res_send.c = -fno-strict-aliasing
# The BIND code elicits some harmless warnings.
+cflags += -Wno-strict-prototypes -Wno-write-strings
Index: sunrpc/Makefile
===================================================================
--- sunrpc/Makefile.orig 2011-05-25 20:00:57.381005790 +0200
+++ sunrpc/Makefile 2011-06-15 14:57:37.657361569 +0200
@@ -129,6 +129,10 @@
CPPFLAGS += -D_RPC_THREAD_SAFE_
+CFLAGS-clnt_tcp.c = -fno-strict-aliasing
+CFLAGS-clnt_udp.c = -fno-strict-aliasing
+CFLAGS-clnt_unix.c = -fno-strict-aliasing
+
include ../Rules
$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) \
Index: sysdeps/powerpc/powerpc64/elf/Makefile
===================================================================
--- sysdeps/powerpc/powerpc64/elf/Makefile.orig
+++ sysdeps/powerpc/powerpc64/elf/Makefile
@@ -9,3 +9,5 @@ CFLAGS-rtld-mempcpy.os = $(no-special-re
CFLAGS-rtld-memmove.os = $(no-special-regs)
CFLAGS-rtld-memchr.os = $(no-special-regs)
CFLAGS-rtld-strnlen.os = $(no-special-regs)
+
+CFLAGS-gmon-start.c = -fno-strict-aliasing
--
Andreas Jaeger, Program Manager openSUSE
aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
More information about the Libc-alpha
mailing list