Hook gcc 5.0 (pre-release) in build, unhook gcc 4.4
authorJohn Marino <draco@marino.st>
Tue, 10 Feb 2015 14:13:34 +0000 (15:13 +0100)
committerJohn Marino <draco@marino.st>
Tue, 10 Feb 2015 14:14:08 +0000 (15:14 +0100)
Effectively replace GCC 4.4 with the 1 February 2015 snapshot of the
pre-release GCC 5.0.  This compiler is in pretty good shape, but it is
not perfect.  It cannot fully build world if WORLD_CCCVER is set to
GCC50.  This compiler import is a work in progress.

* The old compiler has been unhooked.
* The gcc44 sources may be removed soon
* Obviously NO_GCC44 doesn't work anymore
* NO_GCC50 has been created and should work
* NO_CXX was never documented and has been removed
* NO_OBJC was not deemed worthwhile and it has been removed
* man pages have been updated accordingly
* default make.conf has been updated accordingly
* Per bsd.sys.mk, gcc50 behaves just like gcc47
* Actually, all CCVER starting with "gcc" now behave like gcc47
* The proper CCVER value is "gcc50".  If "gcc5" is specified, the
  dports compiler lang/gcc5 will be used.

Iterating: THIS IS AN EXPERIMENTAL COMPILER!  It's not ready for
prime-time yet.  Do NOT set WORLD_CCVER to "gcc50".

26 files changed:
Makefile.inc1
Makefile_upgrade.inc
etc/defaults/make.conf
etc/mtree/BSD.include.dist
etc/mtree/BSD.usr.dist
gnu/lib/Makefile
gnu/lib/gcc47/Makefile
gnu/usr.bin/Makefile
gnu/usr.bin/Makefile.cco
gnu/usr.bin/binutils222/gold/Makefile
gnu/usr.bin/binutils222/ld/Makefile
gnu/usr.bin/binutils224/gold/Makefile
gnu/usr.bin/binutils224/ld/Makefile
gnu/usr.bin/cc47/Makefile
gnu/usr.bin/cc47/Makefile.langs
gnu/usr.bin/cc47/cc_prep/Makefile
share/man/man5/make.conf.5
share/mk/Makefile
share/mk/bsd.README
share/mk/bsd.cpu.gcc50.mk [new file with mode: 0644]
share/mk/bsd.cpu.mk
share/mk/bsd.sys.mk
sys/conf/kern.pre.mk
sys/conf/kmod.mk
sys/dev/drm/radeon/Makefile
test/x86_64/Makefile

index 37d69ad..b6f793e 100644 (file)
@@ -901,25 +901,25 @@ bstrap-${_tool}!
 _share=        share/syscons/scrnmaps
 .endif
 
-_gcc_common_cross= gnu/usr.bin/gmp gnu/usr.bin/mpfr
-.if !defined(NO_GCC44)
-_gcc44_cross= gnu/usr.bin/cc44
-_gcc44_tools= gnu/usr.bin/cc44/cc_prep gnu/usr.bin/cc44/cc_tools
+_gcc_common_cross= lib/libz gnu/usr.bin/gmp gnu/usr.bin/mpfr gnu/usr.bin/mpc
+.if !defined(NO_GCC50)
+_gcc50_cross= gnu/usr.bin/cc50
+_gcc50_tools= gnu/usr.bin/cc50/cc_prep gnu/usr.bin/cc50/cc_tools
 .endif
-_gcc47_cross= lib/libz gnu/usr.bin/mpc gnu/usr.bin/cc47
+_gcc47_cross= gnu/usr.bin/cc47
 _gcc47_tools= gnu/usr.bin/cc47/cc_prep gnu/usr.bin/cc47/cc_tools
 _custom_cross= libexec/customcc
 _binutils= gnu/usr.bin/${WORLD_BINUTILSVER}
 
-BTOOLSDIRS= ${_gcc44_tools} ${_gcc47_tools} ${_share}
+BTOOLSDIRS= ${_gcc47_tools} ${_gcc50_tools} ${_share}
 
 build-tools: build-tools-targets
        touch ${BTOOLSDEST}/.build_done
 
 build-tools-targets: ${BTOOLSDIRS:S/^/btools-/}
 
-.ORDER: ${_gcc44_tools:S/^/btools-/}
 .ORDER: ${_gcc47_tools:S/^/btools-/}
+.ORDER: ${_gcc50_tools:S/^/btools-/}
 
 .for _tool in ${BTOOLSDIRS}
 btools-${_tool}!
@@ -941,7 +941,7 @@ _btxld=     usr.sbin/btxld
 CTOOLSDIRS= ${_btxld} ${_binutils} \
                usr.bin/objformat usr.bin/crunch/crunchide \
                ${_gcc_common_cross} \
-               ${_gcc44_cross} ${_gcc47_cross} ${_custom_cross}
+               ${_gcc47_cross} ${_gcc50_cross} ${_custom_cross}
 
 cross-tools: cross-tools-targets
        touch ${CTOOLSDEST}/.cross_done
@@ -978,10 +978,10 @@ libraries:
        cd ${.CURDIR}; \
            HOST_CCVER=${HOST_CCVER} CCVER=gcc47 \
                make -f Makefile.inc1 _startup_libs47;
-.if !defined(NO_GCC44)
+.if !defined(NO_GCC50)
        cd ${.CURDIR}; \
-           HOST_CCVER=${HOST_CCVER} CCVER=gcc44 \
-               make -f Makefile.inc1 _startup_libs44;
+           HOST_CCVER=${HOST_CCVER} CCVER=gcc50 \
+               make -f Makefile.inc1 _startup_libs50;
 .endif
        cd ${.CURDIR}; \
            make -f Makefile.inc1 _startup_libs; \
@@ -1001,10 +1001,12 @@ _startup_libs47=        gnu/usr.bin/cc47/cc_prep \
                        gnu/lib/gcc47/libgcc \
                        gnu/lib/gcc47/libgcc_eh \
                        gnu/lib/gcc47/libgcc_pic
-_startup_libs44=       gnu/usr.bin/cc44/cc_prep \
-                       gnu/usr.bin/cc44/cc_tools \
-                       gnu/lib/gcc44/csu \
-                       gnu/lib/gcc44/libgcc
+_startup_libs50=       gnu/usr.bin/cc50/cc_prep \
+                       gnu/usr.bin/cc50/cc_tools \
+                       gnu/lib/gcc50/csu \
+                       gnu/lib/gcc50/libgcc \
+                       gnu/lib/gcc50/libgcc_eh \
+                       gnu/lib/gcc50/libgcc_pic
 _startup_libs=         lib/csu lib/libc lib/libc_rtld
 
 _prebuild_libs=                lib/libbz2 lib/liblzma lib/libz
@@ -1036,7 +1038,7 @@ _prebuild_libs+= lib/libradius lib/libsbuf lib/libtacplus lib/libm \
 
 _generic_libs+=        usr.bin/flex/lib
 
-.for _lib in ${_startup_libs44} ${_startup_libs47} \
+.for _lib in ${_startup_libs47} ${_startup_libs50} \
                ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
 ${_lib}__L: .PHONY
 .if exists(${.CURDIR}/${_lib})
@@ -1050,7 +1052,7 @@ ${_lib}__L: .PHONY
 
 _startup_libs: ${_startup_libs:S/$/__L/}
 _startup_libs47: ${_startup_libs47:S/$/__L/}
-_startup_libs44: ${_startup_libs44:S/$/__L/}
+_startup_libs50: ${_startup_libs50:S/$/__L/}
 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
 _generic_libs: ${_generic_libs:S/$/__L/}
 
@@ -1058,7 +1060,7 @@ _generic_libs: ${_generic_libs:S/$/__L/}
 # races (e.g. generation of tconfig.h)
 #
 .ORDER: ${_startup_libs47:S/$/__L/}
-.ORDER: ${_startup_libs44:S/$/__L/}
+.ORDER: ${_startup_libs50:S/$/__L/}
 .ORDER: ${_startup_libs:S/$/__L/}
 .ORDER: ${_prebuild_libs:S/$/__L/}
 .ORDER: ${_generic_libs:S/$/__L/}
index ae2e3ac..7a4d835 100644 (file)
@@ -2796,6 +2796,19 @@ TO_REMOVE+=/usr/share/man/cat9/posix4.9.gz
 TO_REMOVE+=/usr/share/man/man9/posix4.9.gz
 TO_REMOVE+=/usr/share/man/cat9/p1003_1b.9.gz
 TO_REMOVE+=/usr/share/man/man9/p1003_1b.9.gz
+TO_REMOVE+=/usr/include/c++/4.4
+TO_REMOVE+=/usr/lib/gcc44
+TO_REMOVE+=/usr/libexec/gcc44
+TO_REMOVE+=/usr/libdata/gcc44
+TO_REMOVE+=/usr/share/man/man1/cpp44.1.gz
+TO_REMOVE+=/usr/share/man/man1/g++44.1.gz
+TO_REMOVE+=/usr/share/man/man1/gcc44.1.gz
+TO_REMOVE+=/usr/share/man/man1/gcov44.1.gz
+TO_REMOVE+=/usr/share/mk/bsd.cpu.gcc44.mk
+TO_REMOVE+=/usr/share/info/cpp44.info.gz
+TO_REMOVE+=/usr/share/info/cppinternals44.info.gz
+TO_REMOVE+=/usr/share/info/gcc44.info.gz
+TO_REMOVE+=/usr/share/info/gccint44.info.gz
 
 .if ${MACHINE_ARCH} == "x86_64"
 TO_REMOVE+=/usr/sbin/stlstats
index bdcc5c4..2aafdbc 100644 (file)
@@ -105,13 +105,12 @@ 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_GCC44=     true    # do not build gcc-4.4
+#NO_GCC50=     true    # do not build GCC 5.0
 #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
 #NO_MAILWRAPPER=true   # do not build the mailwrapper(8) MTA selector
 #NO_MODULES=   true    # do not build modules with the kernel
-#NO_OBJC=      true    # do not build Objective C support
 #NO_OPENSSH=   true    # do not build OpenSSH
 #NO_OPENSSL=   true    # do not build OpenSSL (implies NO_OPENSSH)
 #NO_SENDMAIL=  true    # do not build sendmail and related programs
index b0ed47a..5dec996 100644 (file)
         ..
     ..
     c++
-        4.4
+        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
             ..
         ..
-        4.7
+        5.0
             backward
             ..
             bits
             ..
             decimal
             ..
+            experimental
+            ..
             ext
                 pb_ds
                     detail
-                        branch_policy
+                        bin_search_tree_
                         ..
                         binary_heap_
                         ..
-                        binomial_heap_base_
-                        ..
                         binomial_heap_
                         ..
-                        bin_search_tree_
+                        binomial_heap_base_
+                        ..
+                        branch_policy
                         ..
                         cc_hash_table_map_
                         ..
                     ..
                 ..
             ..
+            parallel
+            ..
             profile
                 impl
                 ..
index a2481ad..78bf5c3 100644 (file)
         ..
         engines
         ..
-        gcc44
+        gcc47
+            plugin
+                include
+                    c-family
+                    ..
+                    objc
+                    ..
+                    config
+                        i386
+                        ..
+                    ..
+                    cp
+                    ..
+                ..
+            ..
             profile
             ..
         ..
-        gcc47
+        gcc50
             plugin
                 include
                     c-family
         ..
     ..
     libdata
-        gcc44
+        gcc47
             objc
             ..
+            ssp
+            ..
         ..
-        gcc47
+        gcc50
             objc
             ..
             ssp
         ..
         custom
         ..
-        gcc44
-        ..
         gcc47
         ..
+        gcc50
+        ..
         lpr
             ru
             ..
index 1e47406..1bd50e9 100644 (file)
@@ -1,8 +1,8 @@
 # The libobjc header conflict between base compilers has been resolved
 # Maximum parallelism can be restored by setting SUBDIR_ORDERED to null
 
-.if !defined(NO_GCC44)
-SUBDIR= gcc44
+.if !defined(NO_GCC50)
+SUBDIR= gcc50
 .endif
 
 SUBDIR+= gcc47
index d9bdd3e..edabf42 100644 (file)
@@ -1,6 +1,8 @@
 # csu and libgcc* are normally built earlier by the _startup_libs47 target
 # libsupc++ must be built after libstdc++, everything else can be parallel
 
+SUBDIR_ORDERED= libstdc++ libsupc++
+
 SUBDIR+=       csu
 SUBDIR+=       libgcc
 SUBDIR+=       libgcc_eh
@@ -9,17 +11,8 @@ SUBDIR+=      libgcov
 SUBDIR+=       libssp
 SUBDIR+=       libssp_nonshared
 SUBDIR+=       libgomp
-
-.if !defined(NO_CXX)
 SUBDIR+=       libstdc++
 SUBDIR+=       libsupc++
-SUBDIR_ORDERED= libstdc++ libsupc++
-.else
-SUBDIR_ORDERED=
-.endif
-
-.if !defined(NO_OBJC)
 SUBDIR+=       libobjc
-.endif
 
 .include <bsd.subdir.mk>
index 0a1489e..32774c6 100644 (file)
@@ -22,11 +22,11 @@ SUBDIR+= mpfr
 SUBDIR+= mpc
 SUBDIR+= cc47
 
-.if defined(NO_GCC44)
+.if defined(NO_GCC50)
 .ORDER: ${BU_PRIMARY} gmp mpfr mpc cc47
 .else
-SUBDIR+= cc44
-.ORDER: ${BU_PRIMARY} gmp mpfr mpc cc47 cc44
+SUBDIR+= cc50
+.ORDER: ${BU_PRIMARY} gmp mpfr mpc cc47 cc50
 .endif
 
 # maximum parallelism
index ea3d297..f7c4e14 100644 (file)
@@ -5,13 +5,13 @@
 # The same approach is used for the two sets of binutils
 
 CC_PRIMARY=    gcc47
-CC_BACKUP=     gcc44
+CC_BACKUP=     gcc50
 
 .if defined(COMPVERSION)
 .if (${COMPVERSION} == ${CC_PRIMARY})
 IS_PRIMARY=    1
 MANPAGEVER=    47
 .elif (${COMPVERSION} == ${CC_BACKUP})
-MANPAGEVER=    44
+MANPAGEVER=    50
 .endif
 .endif
index a096a52..67bfd7f 100644 (file)
@@ -19,4 +19,8 @@ LDADD+=       ${RELTOP}/libiberty/libiberty.a
 DPADD+=        ${LIBZ}
 LDADD+=        -lz
 
+# link-time optimization requires dlopen() which means ld cannot be built
+# statically and also support -plugin, not even for cross-tools.
+.undef NOSHARED
+
 .include <bsd.prog.mk>
index 4354f4d..36f3caa 100644 (file)
@@ -36,8 +36,8 @@ CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
 CFLAGS+= -DENABLE_PLUGINS -DHAVE_CONFIG_H
 CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${USRDATA_PREFIX}\"
 # link-time optimization requires dlopen() which means ld cannot be built
-# statically (e.g. NOSHARED=yes) and also support -plugin.
-#NOSHARED?= yes
+# statically and also support -plugin, not even for cross-tools.
+.undef NOSHARED
 
 CLEANDIRS+=    ldscripts tmpdir
 CLEANFILES+=   ldemul-list.h stringify.sed
index d9f2eb1..720e22d 100644 (file)
@@ -20,4 +20,8 @@ LDADD+=       ${RELTOP}/libiberty/libiberty.a
 DPADD+=        ${LIBZ}
 LDADD+=        -lz
 
+# link-time optimization requires dlopen() which means ld cannot be built
+# statically and also support -plugin, not even for cross-tools.
+.undef NOSHARED
+
 .include <bsd.prog.mk>
index 4354f4d..36f3caa 100644 (file)
@@ -36,8 +36,8 @@ CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
 CFLAGS+= -DENABLE_PLUGINS -DHAVE_CONFIG_H
 CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${USRDATA_PREFIX}\"
 # link-time optimization requires dlopen() which means ld cannot be built
-# statically (e.g. NOSHARED=yes) and also support -plugin.
-#NOSHARED?= yes
+# statically and also support -plugin, not even for cross-tools.
+.undef NOSHARED
 
 CLEANDIRS+=    ldscripts tmpdir
 CLEANFILES+=   ldemul-list.h stringify.sed
index c4f3ed4..75fe034 100644 (file)
@@ -12,13 +12,9 @@ SUBDIR+=     cc
 SUBDIR+=       doc
 SUBDIR+=       cpp
 SUBDIR+=       gcov
-.if !defined(NO_CXX)
 SUBDIR+=       cc1plus
 SUBDIR+=       c++
-.endif
-.if !defined(NO_OBJC)
 SUBDIR+=       cc1obj
-.endif
 
 .ORDER: ${SUBDIR}
 
index 0ed188b..aca5598 100644 (file)
@@ -2,12 +2,8 @@
 
 COMPVERSION=   gcc47
 
-.if !defined(NO_CXX)
 lang_tree_files+=      cp/cp-tree.def
-.endif
-.if !defined(NO_OBJC)
 lang_tree_files+=      objc/objc-tree.def
-.endif
 
 optionsfiles=  ${GCCDIR}/gcc/c-family/c.opt
 optionsfiles+= ${GCCDIR}/gcc/common.opt
@@ -16,13 +12,9 @@ optionsfiles+=       ${GCCDIR}/gcc/config/${GCC_CPU}/${GCC_CPU}.opt
 optionsfiles+=  ${GCCDIR}/gcc/config/rpath.opt
 optionsfiles+=  ${GCCDIR}/gcc/config/freebsd.opt
 
-LANG_SPECS_FILES=      lto/lang-specs.h
-.if !defined(NO_CXX)
-LANG_SPECS_FILES+=     cp/lang-specs.h
-.endif
-.if !defined(NO_OBJC)
+LANG_SPECS_FILES=      lto/lang-specs.h \
+                       cp/lang-specs.h
 LANG_SPECS_FILES+=     objc/lang-specs.h
-.endif
 
 # Object files for gcc driver.
 GCC_SRCS = gcc.c ggc-none.c
@@ -83,7 +75,6 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
   $(srcdir)/target-globals.h \
   $(srcdir)/ipa-inline.h \
 
-.if !defined(NO_CXX)
 GTFILES_CPP= \
   [cp] \
   $(srcdir)/cp/rtti.c \
@@ -114,7 +105,6 @@ GTFILES_CPP= \
   $(srcdir)/cp/cp-lang.c \
   $(srcdir)/cp/except.c
 GTFILES+= ${GTFILES_CPP}
-.endif
 
 GTFILES_LTO= \
   [lto] \
@@ -123,7 +113,6 @@ GTFILES_LTO= \
   $(srcdir)/lto/lto.c 
 GTFILES+= ${GTFILES_LTO}
 
-.if !defined(NO_OBJC)
 GTFILES_OBJC= \
   [objc] \
   $(srcdir)/objc/objc-map.h \
@@ -177,7 +166,6 @@ GTFILES_OBJC= \
   $(srcdir)/objc/objc-next-runtime-abi-02.c \
   $(srcdir)/c-family/c-cppbuiltin.c 
 GTFILES+= ${GTFILES_OBJC}
-.endif
 
 # C
 GTFILES_C+= \
index 8708cd7..ce0eeff 100644 (file)
@@ -4,12 +4,8 @@
 CONTRIBDIR=    ${GCCDIR}/gcc
 
 LANG1=c
-.if !defined(NO_CXX)
 LANG2=, c++
-.endif
-.if !defined(NO_OBJC)
 LANG3=, objc
-.endif
 LANG4=, LTO
 
 version.c: ${CONTRIBDIR}/version.c Makefile ../Makefile.inc
index 64cee6a..ba51615 100644 (file)
@@ -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 gcc44
+.Dq gcc50
 and
 .Dq gcc47
 (default).
@@ -392,9 +392,9 @@ Set to not build CVS.
 .It Va NO_GAMES
 .Pq Vt bool
 Set to not build games.
-.It Va NO_GCC44
+.It Va NO_GCC50
 .Pq Vt bool
-Set to not build the older version of GCC (4.4).
+Set to not build the alternative version of GCC (5.0).
 .It Va NO_GDB
 .Pq Vt bool
 Set to not build
@@ -415,9 +415,6 @@ and related programs.
 Set to not build the
 .Xr mailwrapper 8
 MTA selector.
-.It Va NO_OBJC
-.Pq Vt bool
-Set to not build Objective C support.
 .It Va NO_OPENSSH
 .Pq Vt bool
 Set to not build OpenSSH.
index b7e7dab..2905751 100644 (file)
@@ -3,7 +3,7 @@
 
 FILES= bsd.README
 FILES+=        bsd.cpu.mk bsd.cpu.gcc47.mk bsd.cpu.custom.mk
-FILES+=        bsd.cpu.gcc44.mk
+FILES+=        bsd.cpu.gcc50.mk
 FILES+=        bsd.dep.mk bsd.doc.mk bsd.files.mk bsd.patch.mk
 FILES+=        bsd.incs.mk bsd.info.mk bsd.init.mk
 FILES+=        bsd.kmod.mk bsd.hostlib.mk
index b073aae..96060e9 100644 (file)
@@ -18,7 +18,7 @@ bsd.lib.mk.
 
 bsd.cpu.custom.mk      - handle CPU flags for custom compilers
 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.gcc50.mk       - handle GCC 5.0 specific CPU flags & variables
 bsd.cpu.mk             - handle CPU flags & variables
 bsd.dep.mk             - handle Makefile dependencies
 bsd.doc.mk             - building troff system documents
diff --git a/share/mk/bsd.cpu.gcc50.mk b/share/mk/bsd.cpu.gcc50.mk
new file mode 100644 (file)
index 0000000..839c92c
--- /dev/null
@@ -0,0 +1,158 @@
+# 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
+
+. if ${MACHINE_ARCH} == "i386"
+MACHINE_CPU = i486 i386
+. elif ${MACHINE_ARCH} == "x86_64"
+MACHINE_CPU = x86_64 sse2 sse mmx
+. 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
index 43005c3..4a08eb6 100644 (file)
@@ -41,8 +41,8 @@ CPUTYPE= ${FORCE_CPUTYPE}
 .  endif
 .elif ${CCVER} == gcc47
 .  include <bsd.cpu.gcc47.mk>
-.elif ${CCVER} == gcc44
-.  include <bsd.cpu.gcc44.mk>
+.elif ${CCVER} == gcc50
+.  include <bsd.cpu.gcc50.mk>
 .else
 .  include <bsd.cpu.custom.mk>
 .endif
index aa805eb..f24e9ae 100644 (file)
@@ -24,7 +24,7 @@ CFLAGS                += -std=${CSTD}
 . if defined(WARNS)
 .  if ${WARNS} >= 1
 CWARNFLAGS     +=      -Wmissing-include-dirs -Wsystem-headers
-.   if !defined(NO_WERROR) && (${CCVER} == "gcc44" || ${CCVER} == "gcc47")
+.   if !defined(NO_WERROR) && ${CCVER:Mgcc*}
 CWARNFLAGS     +=      -Werror
 .   endif
 .  endif
@@ -47,7 +47,7 @@ CWARNFLAGS    +=      -Wchar-subscripts -Winline -Wnested-externs\
 .  if ${WARNS} >= 2 && ${WARNS} <= 4
 # XXX Delete -Wmaybe-uninitialized by default for now -- the compiler doesn't
 # XXX always get it right.
-.   if ${CCVER} == "gcc47"
+.   if ${CCVER:Mgcc*}
 CWARNFLAGS     +=      -Wno-maybe-uninitialized
 .   else
 CWARNFLAGS     +=      -Wno-uninitialized
@@ -56,10 +56,10 @@ CWARNFLAGS  +=      -Wno-uninitialized
 # Activate gcc47's -Wunused-but-set-variable (which is in -Wall) and
 # -Wunused-but-set-parameter (which is in -Wextra) only at WARNS >= 4
 # (which is the level when also -Wunused-parameter comes into play).
-.  if ${WARNS} >= 2 && ${WARNS} <= 3 && ${CCVER} == "gcc47"
+.  if ${WARNS} >= 2 && ${WARNS} <= 3 && ${CCVER:Mgcc*}
 CWARNFLAGS     +=      -Wno-unused-but-set-variable
 .  endif
-.  if ${WARNS} == 3 && ${CCVER} == "gcc47"
+.  if ${WARNS} == 3 && ${CCVER:Mgcc*}
 CWARNFLAGS     +=      -Wno-unused-but-set-parameter
 .  endif
 . endif
@@ -70,7 +70,7 @@ WFORMAT               =       1
 . if defined(WFORMAT)
 .  if ${WFORMAT} > 0
 CWARNFLAGS     +=      -Wformat=2 -Wno-format-extra-args
-.   if !defined(NO_WERROR) && (${CCVER} == "gcc47" || ${CCVER} == "gcc44")
+.   if !defined(NO_WERROR) && ${CCVER:Mgcc*}
 CWARNFLAGS     +=      -Werror
 .   endif
 .  endif
index 31de669..8a66a93 100644 (file)
@@ -85,7 +85,7 @@ NORMAL_M= awk -f $S/tools/makeobjops.awk -- -c $<; \
 NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC}
 NORMAL_FWO= ${LD} -b binary -d -warn-common -r -o ${.TARGET} ${.ALLSRC:M*.fw}
 
-.if !defined(NO_WERROR) && (${CCVER} == "gcc44" || ${CCVER} == "gcc47")
+.if !defined(NO_WERROR) && (${CCVER} == "gcc47" || ${CCVER} == "gcc50")
 WERROR=-Werror
 .endif
 
index b18a81b..a862dfe 100644 (file)
@@ -77,7 +77,7 @@ KMODMODE?=    ${BINMODE}
 
 .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
 
-.if !defined(NO_WERROR) && (${CCVER} == "gcc44" || ${CCVER} == "gcc47")
+.if !defined(NO_WERROR) && (${CCVER} == "gcc47" || ${CCVER} == "gcc50")
 WERROR=-Werror
 .endif
 
index 21a7f28..a092fe2 100644 (file)
@@ -105,8 +105,4 @@ CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/source/include
 
 CFLAGS+= -I${SYSDIR}/dev/drm/include
 
-.if ${CCVER} == "gcc44"
-CFLAGS+= -fms-extensions
-.endif
-
 .include <bsd.kmod.mk>
index 7eb588c..b451ec2 100644 (file)
@@ -122,7 +122,7 @@ world32: checkq
 
 world64: checkq
        cd ${SRCDIR} && \
-           make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 NO_GCC44=1 \
+           make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 NO_GCC50=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_GCC44=1 \
+           make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 NO_GCC50=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_GCC44=1 installworld
+                DESTDIR=${QEMUDIR}/root NO_GCC50=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_GCC44=1 installworld
+                DESTDIR=${QEMUDIR}/root NO_GCC50=1 installworld
 
 reinstallkernel64: mount
        cd ${SRCDIR} && \