[PATCH] 2.4.0-test3-pre6, gcc 2.7.2.3/Athlon build broke

From: Barry K. Nathan (barryn@cx518206-b.irvn1.occa.home.com)
Date: Sat Jul 08 2000 - 02:28:15 EST


When compiling with gcc 2.7.2.3 and CONFIG_MK7, the compile fails as follows:

gcc -D__KERNEL__ -I/home/barryn/lsoft/kernels/buildspace/linux-2.4.0test3pre6/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -Werror -pipe -fno-strength-reduce -malign-functions=4 -fschedule-insns2 -mwide-multiply -fexpensive-optimizations -c -o init/main.o init/main.c
cc1: warnings being treated as errors
cc1: warning: instruction scheduling not supported on this target machine
make: *** [init/main.o] Error 1

At the bottom of this email is a patch that fixes this. (There are other
compile warnings which I don't try to fix in this patch, but at least this
patch fixes a warning that will hit each gcc invocation during the compile.)

-Barry K. Nathan <barryn@pobox.com>

--- linux-2.4.0test3pre6/arch/i386/Makefile Mon Jun 19 12:56:08 2000
+++ linux-2.4.0test3pre6bkn1/arch/i386/Makefile Sat Jul 8 00:01:01 2000
@@ -57,8 +57,17 @@
 CFLAGS += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; fi)
 endif
 
+# NOTE: The test below for -fschedule-insns2 is necessary to avoid unnecessary
+# warnings in GCC 2.7.x.
+#
+# GCC 2.7.x has neither -march=i686 nor -fschedule-insns2, while EGCS 1.1.2
+# and newer GCCs have both. So, for the sake of a faster kernel compile, the
+# two tests have been combined into one.
+#
+# If the two tests are separated, then the -fschedule-insns2 test *must* have
+# -Werror -- otherwise, the test will always pass and will be useless.
 ifdef CONFIG_MK7
-CFLAGS += $(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686"; fi) -malign-functions=4 -fschedule-insns2 -mwide-multiply -fexpensive-optimizations
+CFLAGS += $(shell if $(CC) -march=i686 -fschedule-insns2 -Werror -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686 -fschedule-insns2"; fi) -malign-functions=4 -mwide-multiply -fexpensive-optimizations
 endif
 
 ifdef CONFIG_MCRUSOE

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:08 EST