Tue Mar 29 21:23:05 2016 UTC ()
crt0-common.c is miscompiled by gcc 5.3 on evbarm with -O2 so use -O1.  Do
this for all non-x86 arches.


(skrll)
diff -r1.26 -r1.27 src/lib/csu/common/Makefile.inc

cvs diff -r1.26 -r1.27 src/lib/csu/common/Makefile.inc (expand / switch to context diff)
--- src/lib/csu/common/Makefile.inc 2016/03/27 00:03:06 1.26
+++ src/lib/csu/common/Makefile.inc 2016/03/29 21:23:05 1.27
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.26 2016/03/27 00:03:06 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.27 2016/03/29 21:23:05 skrll Exp $
 
 .include <bsd.own.mk>
 
@@ -20,6 +20,7 @@
 # XXXGCC5   emits "clr %g1; call %g1", which is effectively jumping to zero.
 . if defined(HAVE_GCC) && ${HAVE_GCC} == 53 && \
      ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "amd64"
+CFLAGS.crt0-common.c+=	-O1
 CFLAGS.crtbeginS.c+=	-O1
 . endif
 .endif
@@ -88,7 +89,7 @@
 crt0.o: crt0.S crt0-common.c
 	${_MKTARGET_COMPILE}
 	${COMPILE.S} ${ARCHDIR}/crt0.S -o ${.TARGET}.S.o
-	${COMPILE.c} ${MY_PICFLAGS} ${COMMON_DIR}/crt0-common.c -o ${.TARGET}.c.o
+	${COMPILE.c} ${CFLAGS.crt0-common.c} ${MY_PICFLAGS} ${COMMON_DIR}/crt0-common.c -o ${.TARGET}.c.o
 	${LD} -r -o ${.TARGET}.o ${.TARGET}.S.o ${.TARGET}.c.o
 	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}.o ${.TARGET} 
 	rm -f ${.TARGET}.S.o ${.TARGET}.c.o ${.TARGET}.o