From f0140465f072dacd8b485e76b254a999329a1d3c Mon Sep 17 00:00:00 2001 From: John Marino Date: Sat, 29 Sep 2012 22:47:42 +0200 Subject: [PATCH] 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. --- Makefile.inc1 | 37 ++++---- Makefile_upgrade.inc | 9 ++ etc/defaults/compilers.conf | 6 -- etc/defaults/make.conf | 2 +- etc/mtree/BSD.include.dist | 66 +++++++++++++- etc/mtree/BSD.usr.dist | 14 ++- gnu/lib/Makefile | 10 +-- gnu/usr.bin/Makefile | 16 +++- lib/libc/Makefile | 4 - libexec/customcc/cc.sh | 8 -- share/man/man5/compilers.conf.5 | 8 +- share/man/man5/make.conf.5 | 8 +- share/mk/Makefile | 2 +- share/mk/bsd.README | 2 +- share/mk/bsd.cpu.gcc41.mk | 125 -------------------------- share/mk/bsd.cpu.gcc47.mk | 152 ++++++++++++++++++++++++++++++++ share/mk/bsd.cpu.mk | 4 +- share/mk/bsd.sys.mk | 4 +- test/x86_64/Makefile | 8 +- 19 files changed, 283 insertions(+), 202 deletions(-) delete mode 100644 share/mk/bsd.cpu.gcc41.mk create mode 100644 share/mk/bsd.cpu.gcc47.mk diff --git a/Makefile.inc1 b/Makefile.inc1 index da2a3c86b4..dab1f3f65b 100644 --- a/Makefile.inc1 +++ b/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,7 +945,7 @@ ${_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/} @@ -949,7 +953,7 @@ _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 - diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc index 44014afbea..d49a4629f2 100644 --- a/Makefile_upgrade.inc +++ b/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 diff --git a/etc/defaults/compilers.conf b/etc/defaults/compilers.conf index 63f6f46278..3630d043b2 100644 --- a/etc/defaults/compilers.conf +++ b/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 diff --git a/etc/defaults/make.conf b/etc/defaults/make.conf index 2f66840916..ee55e5a72d 100644 --- a/etc/defaults/make.conf +++ b/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 diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index 3a52ee9345..e1796d0849 100644 --- a/etc/mtree/BSD.include.dist +++ b/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 .. .. .. diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 2680846409..57ccec0848 100644 --- a/etc/mtree/BSD.usr.dist +++ b/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 .. diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile index b1b0741230..7bb32683f4 100644 --- a/gnu/lib/Makefile +++ b/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 diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile index 9d5d59ba4a..cc52fa7171 100644 --- a/gnu/usr.bin/Makefile +++ b/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 # diff --git a/lib/libc/Makefile b/lib/libc/Makefile index e3c747aa54..661869e32b 100644 --- a/lib/libc/Makefile +++ b/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 # diff --git a/libexec/customcc/cc.sh b/libexec/customcc/cc.sh index eab25544cc..b3a2024715 100644 --- a/libexec/customcc/cc.sh +++ b/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 diff --git a/share/man/man5/compilers.conf.5 b/share/man/man5/compilers.conf.5 index c234ec1008..4179302728 100644 --- a/share/man/man5/compilers.conf.5 +++ b/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 +.elif ${CCVER} == "gcc47" +. include .elif ${CCVER} == "gcc44" . include .else diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 3cd9bdbf7f..a554735ded 100644 --- a/share/mk/bsd.sys.mk +++ b/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 diff --git a/test/x86_64/Makefile b/test/x86_64/Makefile index b7acd9c637..bed469781b 100644 --- a/test/x86_64/Makefile +++ b/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} && \ -- 2.41.0