Date: Thu, 1 Aug 2002 08:45:50 -0700 (PDT) From: Jesse Gross <jesse_gross@yahoo.com> To: Mikhail Teterin <mi+mx@aldan.algebra.com> Cc: John Baldwin <jhb@FreeBSD.org>, arch@FreeBSD.org Subject: Re: march/mcpu in bsd.cpu.mk Message-ID: <20020801154550.37460.qmail@web14107.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
On a similar note, relating to the addition of the new -march settings, for GCC, I have written a patch for -STABLE. Some ports use GCC 3.1 installed from the ports tree. However, the -march settings in CFLAGS are tuned by bsd.cpu.mk to be the flags that GCC 2.95 can handle. My patch checks whether GCC 3.1 is being used and if it is uses the best -march based on CPUTYPE in make.conf. Jesse Gross Index: bsd.cpu.mk =================================================================== RCS file: /home/ncvs/src/share/mk/bsd.cpu.mk,v retrieving revision 1.2.2.5 diff -u -3 -p -r1.2.2.5 bsd.cpu.mk --- bsd.cpu.mk 2002/07/19 08:09:32 1.2.2.5 +++ bsd.cpu.mk 2002/07/24 03:32:45 @@ -28,28 +28,66 @@ CPUTYPE = k7 .if !defined(NO_CPU_CFLAGS) || !defined(NO_CPU_COPTFLAGS) . if ${MACHINE_ARCH} == "i386" -. if ${CPUTYPE} == "k7" -_CPUCFLAGS = -march=k6 # gcc doesn't support athlon yet, but it will -. elif ${CPUTYPE} == "k6-2" +. if ${CC}==gcc31 && ${CXX}==g++31 # If GCC 3.1 is being used, new CPU targets can be used +. if ${CPUTYPE} == "athlon-xp" +_CPUCFLAGS = -march=athlon-xp +. elif ${CPUTYPE} == "athlon-mp" +_CPUCFLAGS = -march=athlon-mp +. elif ${CPUTYPE} == "athlon-4" +_CPUCFLAGS = -march=athlon-4 +. elif ${CPUTYPE} == "k7" +_CPUCFLAGS = -march=athlon +. elif ${CPUTYPE} == "k6-2" +_CPUCFLAGS = -march=k6-2 +. elif ${CPUTYPE} == "k6" _CPUCFLAGS = -march=k6 -. elif ${CPUTYPE} == "k6" +. elif ${CPUTYPE} == "k5" +_CPUCFLAGS = -march=pentium +. elif ${CPUTYPE} == "p4" +_CPUCFLAGS = -march=pentium4 +. elif ${CPUTYPE} == "p3" +_CPUCFLAGS = -march=pentium3 +. elif ${CPUTYPE} == "p2" +_CPUCFLAGS = -march=pentium2 +. elif ${CPUTYPE} == "i686" +_CPUCFLAGS = -march=pentiumpro +. elif ${CPUTYPE} == "i586/mmx" +_CPUCFLAGS = -march=pentium-mmx +. elif ${CPUTYPE} == "i586" +_CPUCFLAGS = -march=pentium +. elif ${CPUTYPE} == "i486" +_CPUCFLAGS = -march=i486 +. endif +. else +. if ${CPUTYPE} == "athlon-xp" +_CPUCFLAGS = -march=k6 +. elif ${CPUTYPE} == "athlon-mp" +_CPUCFLAGS = -march=k6 +. elif ${CPUTYPE} == "athlon-4" +_CPUCFLAGS = -march=k6 +. elif ${CPUTYPE} == "k7" +_CPUCFLAGS = -march=k6 +. elif ${CPUTYPE} == "k6-2" +_CPUCFLAGS = -march=k6 +. elif ${CPUTYPE} == "k6" _CPUCFLAGS = -march=k6 -. elif ${CPUTYPE} == "k5" +. elif ${CPUTYPE} == "k5" _CPUCFLAGS = -march=pentium -. elif ${CPUTYPE} == "p4" +. elif ${CPUTYPE} == "p4" _CPUCFLAGS = -march=pentiumpro -. elif ${CPUTYPE} == "p3" +. elif ${CPUTYPE} == "p3" _CPUCFLAGS = -march=pentiumpro -. elif ${CPUTYPE} == "p2" +. elif ${CPUTYPE} == "p2" _CPUCFLAGS = -march=pentiumpro -. elif ${CPUTYPE} == "i686" +. elif ${CPUTYPE} == "i686" _CPUCFLAGS = -march=pentiumpro -. elif ${CPUTYPE} == "i586/mmx" +. elif ${CPUTYPE} == "i586/mmx" _CPUCFLAGS = -march=pentium -. elif ${CPUTYPE} == "i586" +. elif ${CPUTYPE} == "i586" _CPUCFLAGS = -march=pentium -. elif ${CPUTYPE} == "i486" +. elif ${CPUTYPE} == "i486" _CPUCFLAGS = -march=i486 +. endif . endif . elif ${MACHINE_ARCH} == "alpha" . if ${CPUTYPE} == "ev6" __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020801154550.37460.qmail>