Permalink
Browse files

Switch on gcc47 and switch off gcc41

Replace GCC 4.1 with GCC 4.7.  The primary compiler remains GCC 4.4
and the source and makefiles for GCC 4.1 remain intact so it can be
brought back if necessary.  All references to GCC 4.1 in documentation
where updated to reflect version 4.7.

A full world build is probably required after this point.
  • Loading branch information...
1 parent b450dd3 commit f0140465f072dacd8b485e76b254a999329a1d3c @jrmarino jrmarino committed Sep 29, 2012
View
37 Makefile.inc1
@@ -805,24 +805,25 @@ bstrap-${_tool}!
_share= share/syscons/scrnmaps
.endif
-.if !defined(NO_GCC41)
-_gcc41_cross= gnu/usr.bin/cc41
-_gcc41_tools= gnu/usr.bin/cc41/cc_prep gnu/usr.bin/cc41/cc_tools
-.endif
-_gcc44_cross= gnu/usr.bin/gmp gnu/usr.bin/mpfr gnu/usr.bin/cc44
+_gcc_common_cross= gnu/usr.bin/gmp gnu/usr.bin/mpfr
+_gcc44_cross= gnu/usr.bin/cc44
_gcc44_tools= gnu/usr.bin/cc44/cc_prep gnu/usr.bin/cc44/cc_tools
+.if !defined(NO_GCC47)
+_gcc47_cross= lib/libz gnu/usr.bin/mpc gnu/lib/gcc47/csu gnu/usr.bin/cc47
+_gcc47_tools= gnu/usr.bin/cc47/cc_prep gnu/usr.bin/cc47/cc_tools
+.endif
_custom_cross= libexec/customcc
_binutils= gnu/usr.bin/${WORLD_BINUTILSVER}
-BTOOLSDIRS= ${_gcc41_tools} ${_gcc44_tools} ${_share}
+BTOOLSDIRS= ${_gcc44_tools} ${_gcc47_tools} ${_share}
build-tools: build-tools-targets
touch ${BTOOLSDEST}/.build_done
build-tools-targets: ${BTOOLSDIRS:S/^/btools-/}
-.ORDER: ${_gcc41_tools:S/^/btools-/}
.ORDER: ${_gcc44_tools:S/^/btools-/}
+.ORDER: ${_gcc47_tools:S/^/btools-/}
.for _tool in ${BTOOLSDIRS}
btools-${_tool}!
@@ -841,8 +842,8 @@ btools-${_tool}!
_btxld= usr.sbin/btxld
.endif
-CTOOLSDIRS= ${_btxld} ${_binutils} usr.bin/objformat \
- ${_gcc41_cross} ${_gcc44_cross} ${_custom_cross}
+CTOOLSDIRS= ${_btxld} ${_binutils} usr.bin/objformat ${_gcc_common_cross} \
+ ${_gcc44_cross} ${_gcc47_cross} ${_custom_cross}
cross-tools: cross-tools-targets
touch ${CTOOLSDEST}/.cross_done
@@ -876,10 +877,10 @@ hierarchy:
# to specify the correct CCVER or 'cc' will not exec the correct compiler.
#
libraries:
-.if !defined(NO_GCC41)
+.if !defined(NO_GCC47)
cd ${.CURDIR}; \
- HOST_CCVER=${HOST_CCVER} CCVER=gcc41 \
- ${MAKE} -f Makefile.inc1 _startup_libs41;
+ HOST_CCVER=${HOST_CCVER} CCVER=gcc47 \
+ ${MAKE} -f Makefile.inc1 _startup_libs47;
.endif
cd ${.CURDIR}; \
HOST_CCVER=${HOST_CCVER} CCVER=gcc44 \
@@ -896,7 +897,10 @@ libraries:
# shared libraries for ELF. The target for _startup_libsXX is
# specifically built using gccXX.
#
-_startup_libs41= gnu/lib/gcc41/csu gnu/lib/gcc41/libgcc
+_startup_libs47= gnu/lib/gcc47/csu \
+ gnu/lib/gcc47/libgcc \
+ gnu/lib/gcc47/libgcc_eh \
+ gnu/lib/gcc47/libgcc_pic
_startup_libs44= gnu/lib/gcc44/csu gnu/lib/gcc44/libgcc
_startup_libs= lib/csu lib/libc lib/libc_rtld
@@ -928,7 +932,7 @@ _generic_libs+= secure/lib
_generic_libs+= usr.bin/lex/lib
-.for _lib in ${_startup_libs41} ${_startup_libs44} \
+.for _lib in ${_startup_libs44} ${_startup_libs47} \
${_startup_libs} ${_prebuild_libs} ${_generic_libs}
${_lib}__L: .PHONY
.if exists(${.CURDIR}/${_lib})
@@ -941,15 +945,15 @@ ${_lib}__L: .PHONY
.endfor
_startup_libs: ${_startup_libs:S/$/__L/}
-_startup_libs41: ${_startup_libs41:S/$/__L/}
+_startup_libs47: ${_startup_libs47:S/$/__L/}
_startup_libs44: ${_startup_libs44:S/$/__L/}
_prebuild_libs: ${_prebuild_libs:S/$/__L/}
_generic_libs: ${_generic_libs:S/$/__L/}
# library targets must be ordered because there are inter-library
# races (e.g. generation of tconfig.h)
#
-.ORDER: ${_startup_libs41:S/$/__L/}
+.ORDER: ${_startup_libs47:S/$/__L/}
.ORDER: ${_startup_libs44:S/$/__L/}
.ORDER: ${_startup_libs:S/$/__L/}
.ORDER: ${_prebuild_libs:S/$/__L/}
@@ -1002,4 +1006,3 @@ xmakeenv:
@echo '${XMAKEENV} /bin/sh'
.include <bsd.subdir.mk>
-
View
9 Makefile_upgrade.inc
@@ -2041,6 +2041,15 @@ TO_REMOVE+=/usr/include/machine/ultrasound.h
TO_REMOVE+=/usr/include/bus/pci/pcidevs_data.h
TO_REMOVE+=/usr/share/man/cat4/i386/apm.4.gz
TO_REMOVE+=/usr/share/man/man4/i386/apm.4.gz
+TO_REMOVE+=/usr/include/c++/4.1
+TO_REMOVE+=/usr/lib/gcc41
+TO_REMOVE+=/usr/libexec/gcc41
+TO_REMOVE+=/usr/libdata/gcc41
+TO_REMOVE+=/usr/share/man/man1/cpp41.1.gz
+TO_REMOVE+=/usr/share/man/man1/g++41.1.gz
+TO_REMOVE+=/usr/share/man/man1/gcc41.1.gz
+TO_REMOVE+=/usr/share/man/man1/gcov41.1.gz
+TO_REMOVE+=/usr/share/mk/bsd.cpu.gcc41.mk
.if ${MACHINE_ARCH} == "x86_64"
TO_REMOVE+=/usr/libdata/stallion/2681.sys
View
6 etc/defaults/compilers.conf
@@ -18,12 +18,6 @@ gcc46_CC=/usr/pkg/bin/gnatgcc
gcc46_CPP=/usr/pkg/bin/gnatcpp
gcc46_CXX=/usr/pkg/bin/gnatc++
-# gcc-aux (i.e. gcc 4.7) from pkgsrc
-#
-gcc47_CC=/usr/pkg/gcc-aux/bin/gcc
-gcc47_CPP=/usr/pkg/gcc-aux/bin/cpp
-gcc47_CXX=/usr/pkg/gcc-aux/bin/c++
-
# pcc from pkgsrc
#
pcc_CC=/usr/pkg/bin/pcc
View
2 etc/defaults/make.conf
@@ -102,7 +102,7 @@ THREAD_LIB?= thread_xu
#NO_CRYPT= true # do not build crypto code
#NO_CVS= true # do not build CVS
#NO_GAMES= true # do not enter the games subdirectory
-#NO_GCC41= true # do not build gcc-4.1
+#NO_GCC47= true # do not build gcc-4.7
#NO_GDB= true # do not build GDB
#NO_LIBC_R= true # do not build libc_r (re-entrant version of libc)
#NO_LPR= true # do not build lpr and related programs
View
66 etc/mtree/BSD.include.dist
@@ -26,7 +26,7 @@
..
..
c++
- 4.1
+ 4.4
backward
..
bits
@@ -37,19 +37,77 @@
..
tr1
..
- ..
- 4.4
+ tr1_impl
+ ..
+ ..
+ 4.7
backward
..
bits
..
debug
..
+ decimal
+ ..
ext
+ pb_ds
+ detail
+ branch_policy
+ ..
+ binary_heap_
+ ..
+ binomial_heap_base_
+ ..
+ binomial_heap_
+ ..
+ bin_search_tree_
+ ..
+ cc_hash_table_map_
+ ..
+ eq_fn
+ ..
+ gp_hash_table_map_
+ ..
+ hash_fn
+ ..
+ left_child_next_sibling_heap_
+ ..
+ list_update_map_
+ ..
+ list_update_policy
+ ..
+ ov_tree_map_
+ ..
+ pairing_heap_
+ ..
+ pat_trie_
+ ..
+ rb_tree_map_
+ ..
+ rc_binomial_heap_
+ ..
+ resize_policy
+ ..
+ splay_tree_
+ ..
+ thin_heap_
+ ..
+ tree_policy
+ ..
+ trie_policy
+ ..
+ unordered_iterator
+ ..
+ ..
+ ..
+ ..
+ profile
+ impl
+ ..
..
tr1
..
- tr1_impl
+ tr2
..
..
..
View
14 etc/mtree/BSD.usr.dist
@@ -18,13 +18,11 @@
..
engines
..
- gcc41
- debug
- ..
+ gcc44
profile
..
..
- gcc44
+ gcc47
profile
..
..
@@ -44,10 +42,10 @@
..
..
libdata
- gcc41
- ..
gcc44
..
+ gcc47
+ ..
lint
..
stallion
@@ -68,10 +66,10 @@
..
custom
..
- gcc41
- ..
gcc44
..
+ gcc47
+ ..
lpr
ru
..
View
10 gnu/lib/Makefile
@@ -1,13 +1,11 @@
-# $FreeBSD: src/gnu/lib/Makefile,v 1.25.2.4 2001/01/06 23:16:53 obrien Exp $
-
SUBDIR= gcc44 libcryptsetup libdevmapper libdialog libluks liblvm
-.if !defined(NO_GCC41)
-SUBDIR+= gcc41
+.if !defined(NO_GCC47)
+SUBDIR+= gcc47
-# FIXME: libobjc in gcc41 and gcc44 can collide installing header files
+# FIXME: libobjc in gcc44 and gcc47 can collide installing header files
#
-SUBDIR_ORDERED= gcc41 gcc44
+SUBDIR_ORDERED= gcc44 gcc47
.endif
View
16 gnu/usr.bin/Makefile
@@ -17,13 +17,21 @@ SUBDIR+= ${BU_PRIMARY}
SUBDIR+= ${BU_BACKUP}
.endif
-.if !defined(NO_GCC41)
-SUBDIR+= cc41
-.ORDER: ${BU_PRIMARY} cc41
+SUBDIR+= gmp
+SUBDIR+= mpfr
+
+.if !defined(NO_GCC47)
+SUBDIR+= mpc
.endif
-SUBDIR+= gmp mpfr cc44
+SUBDIR+= cc44
+
+.if !defined(NO_GCC47)
+SUBDIR+= cc47
+.ORDER: ${BU_PRIMARY} gmp mpfr mpc cc44 cc47
+.else
.ORDER: ${BU_PRIMARY} gmp mpfr cc44
+.endif
# maximum parallelism
#
View
4 lib/libc/Makefile
@@ -13,10 +13,6 @@ AINC= -I${.OBJDIR} -I${.CURDIR}/${MACHINE_ARCH}
CLEANFILES+=tags
PRECIOUSLIB= yes
-.if ${CCVER} == "gcc41" || ${CCVER} == "gcc44"
-DPADD+= ${LIBGCC}
-LDADD+= -lgcc
-.endif
LDFLAGS+= -nodefaultlibs
#
View
8 libexec/customcc/cc.sh
@@ -73,14 +73,6 @@ elif [ "${CCVER}" = "gcc46" ]; then
-iwithprefixbefore /usr/include \
-isystem /usr/pkg/include/c++/${GCC46VER} \
-isystem /usr/pkg/include/c++/${GCC46VER}/${GCC46MAC}"
-elif [ "${CCVER}" = "gcc47" ]; then
- GCC47VER=`/usr/pkg/gcc-aux/bin/c++ -dumpversion`
- GCC47MAC=`/usr/pkg/gcc-aux/bin/c++ -dumpmachine`
- INCOPT="-nostdinc \
- -iprefix @@INCPREFIX@@ \
- -iwithprefixbefore /usr/include \
- -isystem /usr/pkg/gcc-aux/include/c++/${GCC47VER} \
- -isystem /usr/pkg/gcc-aux/include/c++/${GCC47VER}/${GCC47MAC}"
fi
. /etc/defaults/compilers.conf
View
8 share/man/man5/compilers.conf.5
@@ -29,7 +29,7 @@
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 9, 2012
+.Dd September 29, 2012
.Dt COMPILERS.CONF 5
.Os
.Sh NAME
@@ -96,7 +96,7 @@ To build world and kernel, use the following instructions:
cd /usr/src
fetch http://leaf.dragonflybsd.org/~swildner/world_clang.diff
patch -p1 <world_clang.diff
-env WORLD_CCVER=clang make -DNO_GCC44 buildworld
+env WORLD_CCVER=clang make -DNO_GCC47 buildworld
env WORLD_CCVER=clang make buildkernel KERNCONF=MYCONF
.Ed
.Pp
@@ -113,9 +113,7 @@ Currently, defaults are provided for
.Xr pkgsrc 7 Ap s
.Pa lang/gnat-aux ) ,
.Nm gcc47
-(installed from
-.Xr pkgsrc 7 Ap s
-.Pa lang/gcc-aux )
+(base compiler)
and
.Nm pcc
(installed from
View
8 share/man/man5/make.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD: src/share/man/man5/make.conf.5,v 1.12.2.30 2003/05/18 17:05:55 brueffer Exp $
.\"
-.Dd December 15, 2011
+.Dd September 29, 2012
.Dt MAKE.CONF 5
.Os
.Sh NAME
@@ -118,7 +118,7 @@ We currently recommend that an override NOT be set in
Currently accepted values for compilers which are part of
.Dx
are
-.Dq gcc41
+.Dq gcc47
and
.Dq gcc44
(default).
@@ -341,9 +341,9 @@ Set to not build CVS.
.It Va NO_GAMES
.Pq Vt bool
Set to not build games.
-.It Va NO_GCC41
+.It Va NO_GCC47
.Pq Vt bool
-Set to not build the older version of GCC (4.1).
+Set to not build the newer version of GCC (4.7).
.It Va NO_GDB
.Pq Vt bool
Set to not build
View
2 share/mk/Makefile
@@ -3,7 +3,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/8/93
FILES= bsd.README
-FILES+= bsd.cpu.mk bsd.cpu.gcc41.mk bsd.cpu.custom.mk
+FILES+= bsd.cpu.mk bsd.cpu.gcc47.mk bsd.cpu.custom.mk
FILES+= bsd.cpu.gcc44.mk
FILES+= bsd.dep.mk bsd.doc.mk bsd.files.mk bsd.patch.mk
FILES+= bsd.incs.mk bsd.info.mk bsd.init.mk
View
2 share/mk/bsd.README
@@ -18,7 +18,7 @@ files. In most cases it is only interesting to include bsd.prog.mk or
bsd.lib.mk.
bsd.cpu.custom.mk - handle CPU flags for custom compilers
-bsd.cpu.gcc41.mk - handle GCC 4.1 specific CPU flags & variables
+bsd.cpu.gcc47.mk - handle GCC 4.7 specific CPU flags & variables
bsd.cpu.gcc44.mk - handle GCC 4.4 specific CPU flags & variables
bsd.cpu.mk - handle CPU flags & variables
bsd.dep.mk - handle Makefile dependencies
View
125 share/mk/bsd.cpu.gcc41.mk
@@ -1,125 +0,0 @@
-# $DragonFly: src/share/mk/bsd.cpu.gcc41.mk,v 1.4 2008/01/05 13:37:15 corecode Exp $
-
-# Set default CPU compile flags and baseline CPUTYPE for each arch. The
-# compile flags must support the minimum CPU type for each architecture but
-# may tune support for more advanced processors.
-
-.if !defined(CPUTYPE) || empty(CPUTYPE)
-_CPUCFLAGS =
-. if ${MACHINE_ARCH} == "i386"
-MACHINE_CPU = i486
-. elif ${MACHINE_ARCH} == "x86_64"
-MACHINE_CPU = x86_64 sse2 sse
-. endif
-.else
-
-# Handle aliases (not documented in make.conf to avoid user confusion
-# between e.g. i586 and pentium)
-
-. if ${MACHINE_ARCH} == "i386"
-. if ${CPUTYPE} == "nocona"
-CPUTYPE = prescott
-. elif ${CPUTYPE} == "core" || ${CPUTYPE} == "core2"
-CPUTYPE = prescott
-. elif ${CPUTYPE} == "p4"
-CPUTYPE = pentium4
-. elif ${CPUTYPE} == "p4m"
-CPUTYPE = pentium4m
-. elif ${CPUTYPE} == "p3"
-CPUTYPE = pentium3
-. elif ${CPUTYPE} == "p3m"
-CPUTYPE = pentium3m
-. elif ${CPUTYPE} == "p-m"
-CPUTYPE = pentium-m
-. elif ${CPUTYPE} == "p2"
-CPUTYPE = pentium2
-. elif ${CPUTYPE} == "i686"
-CPUTYPE = pentiumpro
-. elif ${CPUTYPE} == "i586/mmx"
-CPUTYPE = pentium-mmx
-. elif ${CPUTYPE} == "i586"
-CPUTYPE = pentium
-. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \
- ${CPUTYPE} == "k8"
-CPUTYPE = athlon-mp
-. elif ${CPUTYPE} == "k7"
-CPUTYPE = athlon
-. endif
-. elif ${MACHINE_ARCH} == "x86_64"
-. if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2"
-CPUTYPE = nocona
-. endif
-. endif
-
-###############################################################################
-# Logic to set up correct gcc optimization flag. This must be included
-# after /etc/make.conf so it can react to the local value of CPUTYPE
-# defined therein. Consult:
-# http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
-# http://gcc.gnu.org/onlinedocs/gcc/IA-64-Options.html
-# http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
-# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
-# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
-
-. if ${MACHINE_ARCH} == "i386"
-. if ${CPUTYPE} == "crusoe"
-_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
-. elif ${CPUTYPE} == "k5"
-_CPUCFLAGS = -march=pentium
-. else
-_CPUCFLAGS = -march=${CPUTYPE}
-. endif # GCC on 'i386'
-. elif ${MACHINE_ARCH} == "x86_64"
-_CPUCFLAGS = -march=${CPUTYPE}
-. endif
-
-# Set up the list of CPU features based on the CPU type. This is an
-# unordered list to make it easy for client makefiles to test for the
-# presence of a CPU feature.
-
-. if ${MACHINE_ARCH} == "i386"
-. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64"
-MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386
-. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \
- ${CPUTYPE} == "athlon-4"
-MACHINE_CPU = athlon-xp athlon k7 3dnow sse mmx k6 k5 i586 i486 i386
-. elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird"
-MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386
-. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2"
-MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
-. elif ${CPUTYPE} == "k6"
-MACHINE_CPU = mmx k6 k5 i586 i486 i386
-. elif ${CPUTYPE} == "k5"
-MACHINE_CPU = k5 i586 i486 i386
-. elif ${CPUTYPE} == "c3"
-MACHINE_CPU = 3dnow mmx i586 i486 i386
-. elif ${CPUTYPE} == "c3-2"
-MACHINE_CPU = sse mmx i586 i486 i386
-. elif ${CPUTYPE} == "prescott"
-MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386
-. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m"
-MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
-. elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m"
-MACHINE_CPU = sse i686 mmx i586 i486 i386
-. elif ${CPUTYPE} == "pentium2"
-MACHINE_CPU = i686 mmx i586 i486 i386
-. elif ${CPUTYPE} == "pentiumpro"
-MACHINE_CPU = i686 i586 i486 i386
-. elif ${CPUTYPE} == "pentium-mmx"
-MACHINE_CPU = mmx i586 i486 i386
-. elif ${CPUTYPE} == "pentium"
-MACHINE_CPU = i586 i486 i386
-. elif ${CPUTYPE} == "i486"
-MACHINE_CPU = i486 i386
-. elif ${CPUTYPE} == "i386"
-MACHINE_CPU = i386
-. endif
-. elif ${MACHINE_ARCH} == "x86_64"
-. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8"
-MACHINE_CPU = k8 3dnow
-. elif ${CPUTYPE} == "nocona"
-MACHINE_CPU = sse3
-. endif
-MACHINE_CPU += x86_64 sse2 sse mmx
-. endif
-.endif
View
152 share/mk/bsd.cpu.gcc47.mk
@@ -0,0 +1,152 @@
+# Set default CPU compile flags and baseline CPUTYPE for each arch. The
+# compile flags must support the minimum CPU type for each architecture but
+# may tune support for more advanced processors.
+
+.if !defined(CPUTYPE) || empty(CPUTYPE) || ${CPUTYPE} == "native"
+
+. if defined(CPUTYPE) && !empty(CPUTYPE) && ${CPUTYPE} == "native"
+_CPUCFLAGS = -march=native
+. else
+_CPUCFLAGS =
+. endif
+
+.else
+
+_CPUCFLAGS_FIXUP =
+
+# Old CPUTYPE compat shim
+. if ${CPUTYPE} == "i586" \
+ || ${CPUTYPE} == "k5"
+CPUTYPE = pentium
+. elif ${CPUTYPE} == "i586/mmx"
+CPUTYPE = pentium-mmx
+. elif ${CPUTYPE} == "p2"
+CPUTYPE = pentium2
+. elif ${CPUTYPE} == "pentium3m" \
+ || ${CPUTYPE} == "p3m" \
+ || ${CPUTYPE} == "p3" \
+ || ${CPUTYPE} == "c3-2"
+CPUTYPE = pentium3
+. elif ${CPUTYPE} == "pentium4m" \
+ || ${CPUTYPE} == "pentium-m" \
+ || ${CPUTYPE} == "p-m" \
+ || ${CPUTYPE} == "p4"\
+ || ${CPUTYPE} == "p4m"
+CPUTYPE = pentium4
+. elif ${CPUTYPE} == "crusoe"
+CPUTYPE = pentiumpro
+_CPUCFLAGS_FIXUP = -falign-functions=0 -falign-jumps=0 -falign-loops=0
+. elif ${CPUTYPE} == "i686"
+CPUTYPE = pentiumpro
+. elif ${CPUTYPE} == "k6-2"
+CPUTYPE = k6-3
+. elif ${CPUTYPE} == "k7" \
+ || ${CPUTYPE} == "athlon-tbird"
+CPUTYPE = athlon
+. elif ${CPUTYPE} == "athlon-mp" \
+ || ${CPUTYPE} == "athlon-4"
+CPUTYPE = athlon-xp
+. elif ${CPUTYPE} == "k8" \
+ || ${CPUTYPE} == "opteron" \
+ || ${CPUTYPE} == "athlon-fx"
+CPUTYPE = athlon64
+. elif ${CPUTYPE} == "k8-sse3" \
+ || ${CPUTYPE} == "opteron-sse3"
+CPUTYPE = athlon64-sse3
+. elif ${CPUTYPE} == "amdfam10"
+CPUTYPE = barcelona
+. elif ${CPUTYPE} == "c3"
+CPUTYPE = winchip2
+. elif ${CPUTYPE} == "core"
+CPUTYPE = nocona
+. elif ${CPUTYPE} == "corei7-avx" \
+ || ${CPUTYPE} == "corei7-avx-i" \
+ || ${CPUTYPE} == "corei7-avx2"
+CPUTYPE = corei7
+. elif ${CPUTYPE} == "atom"
+CPUTYPE = core2
+. elif ${CPUTYPE} == "bdver2"
+CPUTYPE = bdver1
+. elif ${CPUTYPE} == "btver1"
+CPUTYPE = barcelona
+. endif
+
+###############################################################################
+# Logic to set up correct gcc optimization flag. This must be included
+# after /etc/make.conf so it can react to the local value of CPUTYPE
+# defined therein. Consult:
+# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
+
+_CPUCFLAGS = -march=${CPUTYPE} ${_CPUCFLAGS_FIXUP}
+
+# Set up the list of CPU features based on the CPU type. This is an
+# unordered list to make it easy for client makefiles to test for the
+# presence of a CPU feature.
+
+. if ${MACHINE_ARCH} == "i386"
+. if ${CPUTYPE} == "bdver1"
+MACHINE_CPU = abm 3dnow mmx sse4.2 sse4.1 sse3 sse2 sse \
+ athlon-xp athlon k7 k6 k5 i586
+. elif ${CPUTYPE} == "barcelona"
+MACHINE_CPU = abm 3dnow mmx sse4a sse3 sse2 sse \
+ athlon-xp athlon k7 k6 k5 i586
+. elif ${CPUTYPE} == "athlon64-sse3"
+MACHINE_CPU = 3dnow mmx sse3 sse2 sse athlon-xp athlon k7 k6 k5 i586
+. elif ${CPUTYPE} == "athlon64"
+MACHINE_CPU = 3dnow mmx sse2 sse athlon-xp athlon k7 k6 k5 i586
+. elif ${CPUTYPE} == "athlon-xp"
+MACHINE_CPU = 3dnow mmx sse athlon-xp athlon k7 k6 k5 i586
+. elif ${CPUTYPE} == "athlon"
+MACHINE_CPU = 3dnow mmx athlon k7 k6 k5 i586
+. elif ${CPUTYPE} == "k6-3"
+MACHINE_CPU = 3dnow mmx k6 k5 i586
+. elif ${CPUTYPE} == "k6"
+MACHINE_CPU = mmx k6 k5 i586
+. elif ${CPUTYPE} == "geode"
+MACHINE_CPU = 3dnow mmx i686 i586
+. elif ${CPUTYPE} == "corei7"
+MACHINE_CPU = sse4.2 sse4.1 ssse3 sse3 sse2 sse mmx i686 i586
+. elif ${CPUTYPE} == "core2"
+MACHINE_CPU = ssse3 sse3 sse2 sse mmx i686 i586
+. elif ${CPUTYPE} == "nocona"
+MACHINE_CPU = sse3 sse2 sse mmx i686 i586
+. elif ${CPUTYPE} == "prescott"
+MACHINE_CPU = sse3 sse2 sse mmx i686 i586
+. elif ${CPUTYPE} == "pentium4"
+MACHINE_CPU = sse2 sse mmx i686 i586
+. elif ${CPUTYPE} == "pentium3"
+MACHINE_CPU = sse mmx i686 i586
+. elif ${CPUTYPE} == "pentium2"
+MACHINE_CPU = mmx i686 i586
+. elif ${CPUTYPE} == "pentiumpro"
+MACHINE_CPU = i686 i586
+. elif ${CPUTYPE} == "winchip2"
+MACHINE_CPU = 3dnow mmx
+. elif ${CPUTYPE} == "winchip-c6"
+MACHINE_CPU = mmx
+. elif ${CPUTYPE} == "pentium-mmx"
+MACHINE_CPU = mmx i586
+. elif ${CPUTYPE} == "pentium"
+MACHINE_CPU = i586
+. endif
+MACHINE_CPU += i386 i486
+. elif ${MACHINE_ARCH} == "x86_64"
+. if ${CPUTYPE} == "bdver1"
+MACHINE_CPU = k8 abm 3dnow sse4.2 sse4.1 sse3
+. elif ${CPUTYPE} == "barcelona"
+MACHINE_CPU = k8 abm 3dnow sse4a sse3
+. elif ${CPUTYPE} == "athlon64-sse3"
+MACHINE_CPU = k8 3dnow sse3
+. elif ${CPUTYPE} == "athlon64"
+MACHINE_CPU = k8 3dnow
+. elif ${CPUTYPE} == "corei7"
+MACHINE_CPU = sse4.2 sse4.1 ssse3 sse3
+. elif ${CPUTYPE} == "core2"
+MACHINE_CPU = ssse3 sse3
+. elif ${CPUTYPE} == "nocona"
+MACHINE_CPU = sse3
+. endif
+MACHINE_CPU += sse2 sse mmx x86_64
+. endif
+
+.endif
View
4 share/mk/bsd.cpu.mk
@@ -39,8 +39,8 @@ CPUTYPE= ${FORCE_CPUTYPE}
. if ${CCVER_BSD_CPU_MK} != ""
. include "${CCVER_BSD_CPU_MK}"
. endif
-.elif ${CCVER} == "gcc41"
-. include <bsd.cpu.gcc41.mk>
+.elif ${CCVER} == "gcc47"
+. include <bsd.cpu.gcc47.mk>
.elif ${CCVER} == "gcc44"
. include <bsd.cpu.gcc44.mk>
.else
View
4 share/mk/bsd.sys.mk
@@ -24,7 +24,7 @@ CFLAGS += -std=${CSTD}
. if defined(WARNS)
. if ${WARNS} >= 1
CWARNFLAGS += -Wsystem-headers
-. if !defined(NO_WERROR) && (${CCVER} == "gcc41" || ${CCVER} == "gcc44")
+. if !defined(NO_WERROR) && (${CCVER} == "gcc47" || ${CCVER} == "gcc44")
CWARNFLAGS += -Werror
. endif
. endif
@@ -56,7 +56,7 @@ WFORMAT = 1
. if defined(WFORMAT)
. if ${WFORMAT} > 0
CWARNFLAGS += -Wformat=2 -Wno-format-extra-args
-. if !defined(NO_WERROR) && (${CCVER} == "gcc41" || ${CCVER} == "gcc44")
+. if !defined(NO_WERROR) && (${CCVER} == "gcc47" || ${CCVER} == "gcc44")
CWARNFLAGS += -Werror
. endif
. endif
View
8 test/x86_64/Makefile
@@ -122,7 +122,7 @@ world32: checkq
world64: checkq
cd ${SRCDIR} && \
- make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 NO_GCC41=1 \
+ make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 NO_GCC47=1 \
buildworld
kernel64: checkq
@@ -135,7 +135,7 @@ kernel64: checkq
#
quickworld64: checkq
cd ${SRCDIR} && \
- make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 NO_GCC41=1 \
+ make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 NO_GCC47=1 \
quickworld
quickkernel64: checkq
@@ -176,7 +176,7 @@ umount: check
install64: mount
cd ${SRCDIR} && \
make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 \
- DESTDIR=${QEMUDIR}/root NO_GCC41=1 installworld
+ DESTDIR=${QEMUDIR}/root NO_GCC47=1 installworld
cd ${SRCDIR}/etc && \
make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 \
DESTDIR=${QEMUDIR}/root distribution
@@ -201,7 +201,7 @@ reinstall64: mount
@echo " 64 bit kernel"
cd ${SRCDIR} && \
make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 \
- DESTDIR=${QEMUDIR}/root NO_GCC41=1 installworld
+ DESTDIR=${QEMUDIR}/root NO_GCC47=1 installworld
reinstallkernel64: mount
cd ${SRCDIR} && \

0 comments on commit f014046

Please sign in to comment.