Module Name:    src
Committed By:   tsutsui
Date:           Sat Dec 24 04:59:00 UTC 2011

Modified Files:
        src/lib/libc/net: Makefile.inc

Log Message:
Specify "-fno-tree-ter" to getaddrinfo.c and gethnamaddr.c on arm and gcc45
for workaround of a possible optimazation bug.

On my W-ZERO3 and Zaurus, hostname lookup against CNAME by some commands
(ping(8), ftp(1) etc.) fails even though nslookup(8) returns a proper name
against the same CNAME, after NetBSD/arm ports has been switched to
gcc 4.5 since 201110311420Z (i.e 201110310000Z binaries worked but
201111010000Z ones not).

Building getaddrinfo.c and gethnamaddr.c in libc with "-O2 -fno-tree-ter"
(or using objects built by old gcc 4.1) seems to fix this issue.

Accroding to nonaka@, the following gcc bugzilla test case also fails
with -O2 but works with -O2 -fno-tree-ter on NetBSD/zaurus 5.99.57:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48863#c4
but CNAME lookup didn't fail on his environment even without this workaround.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/lib/libc/net/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/Makefile.inc
diff -u src/lib/libc/net/Makefile.inc:1.78 src/lib/libc/net/Makefile.inc:1.79
--- src/lib/libc/net/Makefile.inc:1.78	Fri Oct  2 02:45:29 2009
+++ src/lib/libc/net/Makefile.inc	Sat Dec 24 04:59:00 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.78 2009/10/02 02:45:29 tsarna Exp $
+#	$NetBSD: Makefile.inc,v 1.79 2011/12/24 04:59:00 tsutsui Exp $
 #	@(#)Makefile.inc	8.2 (Berkeley) 9/5/93
 
 # net sources
@@ -41,6 +41,11 @@ nslexer.c: nslexer.l nsparser.h
 
 .include "${ARCHDIR}/net/Makefile.inc"
 
+.if defined(HAVE_GCC) && ${HAVE_GCC} == "45" && ${MACHINE_CPU} == "arm"   
+COPTS.getaddrinfo.c+=	-fno-tree-ter
+COPTS.gethnamaddr.c+=	-fno-tree-ter
+.endif
+
 MAN+=	byteorder.3 ethers.3 gethostbyname.3 getifaddrs.3 \
 	getnetent.3 getprotoent.3 getpeereid.3 \
 	getservent.3 inet.3 inet_net.3 iso_addr.3 linkaddr.3 \

Reply via email to