From 30c91f0ce501323cf8a9dfdfe46d8c79c7d419b1 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 4 Mar 2011 12:19:25 +0100 Subject: [PATCH] At long last, switch us to using GCC 4.4 as the default compiler. [I've put some notes into UPGRADING which I quote here.] That means that any settings that set CCVER to 'gcc44' are not needed anymore. Instead, CCVER can be set to 'gcc41' to go back to using GCC 4.1. The NO_GCC44 options has been removed and will not affect the build anymore. There is now a NO_GCC41 option that will prevent GCC 4.1 from building in a similar fashion. Also, we recommend to do a full buildworld/buildkernel for upgrading. Thanks-to: sephe, Max Herrgard and everybody else who helped with testing and fixing. --- Makefile.inc1 | 11 +++++------ UPDATING | 15 +++++++++++++++ etc/defaults/make.conf | 4 ++-- gnu/lib/Makefile | 6 +++--- gnu/usr.bin/Makefile | 5 ++--- gnu/usr.bin/cc41/cc/Makefile | 3 --- gnu/usr.bin/cc44/cc/Makefile | 5 +++++ share/man/man5/make.conf.5 | 11 ++++++----- share/mk/bsd.cpu.mk | 3 +-- share/mk/bsd.sys.mk | 5 ++--- sys/conf/kern.pre.mk | 3 +-- test/x86_64/Makefile | 8 ++++---- usr.bin/objformat/objformat.c | 3 +-- 13 files changed, 47 insertions(+), 35 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index e7e31c50ee..bfcc8c2419 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1,6 +1,5 @@ # # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $ -# $DragonFly: src/Makefile.inc1,v 1.118 2008/06/24 20:22:30 thomas Exp $ # # Build-time options are documented in make.conf(5). # @@ -120,7 +119,7 @@ DESTDIRBASE?= ${OBJTREE}${.CURDIR} .MAKEFLAGS:= ${.MAKEFLAGS:NDESTDIR=*} # This sets the compiler we use to build the world/kernel with -WORLD_CCVER?= gcc41 +WORLD_CCVER?= gcc44 WORLD_BINUTILSVER?= binutils217 # temporary until everybody has converted to x86_64 @@ -794,12 +793,12 @@ bootstrap-tools: _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 -.if !defined(NO_GCC44) +.endif _gcc44_cross= gnu/usr.bin/cc44 _gcc44_tools= gnu/usr.bin/cc44/cc_prep gnu/usr.bin/cc44/cc_tools -.endif _custom_cross= libexec/customcc _binutils= gnu/usr.bin/${WORLD_BINUTILSVER} @@ -851,14 +850,14 @@ hierarchy: # to specify the correct CCVER or 'cc' will not exec the correct compiler. # libraries: +.if !defined(NO_GCC41) cd ${.CURDIR}; \ HOST_CCVER=${HOST_CCVER} CCVER=gcc41 \ ${MAKE} -f Makefile.inc1 _startup_libs41; -.if !defined(NO_GCC44) +.endif cd ${.CURDIR}; \ HOST_CCVER=${HOST_CCVER} CCVER=gcc44 \ ${MAKE} -f Makefile.inc1 _startup_libs44; -.endif cd ${.CURDIR}; \ ${MAKE} -f Makefile.inc1 _startup_libs; \ ${MAKE} -f Makefile.inc1 _prebuild_libs; \ diff --git a/UPDATING b/UPDATING index 04f43eb0b0..1198a7fa3d 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,21 @@ + UPGRADING DRAGONFLY FROM 2.8 to later versions + +-----------------------------------------------------------------------+ +GCC 4.4 +------- + +GCC 4.4 has been made DragonFly's default compiler. + +That means that any settings that set CCVER to 'gcc44' are not needed +anymore. Instead, CCVER can be set to 'gcc41' to go back to using +GCC 4.1. + +The NO_GCC44 options has been removed and will not affect the build +anymore. There is now a NO_GCC41 option that will prevent GCC 4.1 from +building in a similar fashion. + +Also, we recommend to do a full buildworld/buildkernel for upgrading. + pkg_radd settings ----------------- diff --git a/etc/defaults/make.conf b/etc/defaults/make.conf index dbd6b9d67a..d5242125be 100644 --- a/etc/defaults/make.conf +++ b/etc/defaults/make.conf @@ -40,7 +40,7 @@ # an experimental compiler might be broken at any time. We currently # recommend that an override NOT be set in /etc/make.conf. # -#CCVER?=gcc41 # (use GCC 4.1, default) +#CCVER?=gcc44 # (use GCC 4.4, default) # # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings above -O (-O2, ...) are not recommended @@ -101,7 +101,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_GCC44= true # do not build gcc-4.4 +#NO_GCC41= true # do not build gcc-4.1 #NO_GDB= true # do not build GDB #NO_I4B= true # do not build isdn4bsd package #NO_IPFILTER= true # do not build IP Filter package diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile index d3a79a95e1..d65b58f298 100644 --- a/gnu/lib/Makefile +++ b/gnu/lib/Makefile @@ -1,9 +1,9 @@ # $FreeBSD: src/gnu/lib/Makefile,v 1.25.2.4 2001/01/06 23:16:53 obrien Exp $ -SUBDIR= gcc41 libcryptsetup libdevmapper libdialog libluks liblvm libregex +SUBDIR= gcc44 libcryptsetup libdevmapper libdialog libluks liblvm libregex -.if !defined(NO_GCC44) -SUBDIR+= gcc44 +.if !defined(NO_GCC41) +SUBDIR+= gcc41 .endif .include diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile index b5405130ab..ca6855d119 100644 --- a/gnu/usr.bin/Makefile +++ b/gnu/usr.bin/Makefile @@ -1,5 +1,4 @@ # $FreeBSD: src/gnu/usr.bin/Makefile,v 1.51 2000/01/16 00:11:34 obrien Exp $ -# $DragonFly: src/gnu/usr.bin/Makefile,v 1.32 2007/09/05 21:40:10 pavalos Exp $ SUBDIR= dialog diff diff3 grep groff man rcs sdiff sort texinfo @@ -14,12 +13,12 @@ SUBDIR+=gdb SUBDIR+= binutils217 SUBDIR+= binutils220 +.if !defined(NO_GCC41) SUBDIR+= cc41 .ORDER: binutils217 cc41 +.endif -.if !defined(NO_GCC44) SUBDIR+= cc44 .ORDER: binutils217 cc44 -.endif .include diff --git a/gnu/usr.bin/cc41/cc/Makefile b/gnu/usr.bin/cc41/cc/Makefile index 55fef22417..77abe0e83b 100644 --- a/gnu/usr.bin/cc41/cc/Makefile +++ b/gnu/usr.bin/cc41/cc/Makefile @@ -1,5 +1,3 @@ -# $DragonFly: src/gnu/usr.bin/cc41/cc/Makefile,v 1.2 2007/09/08 09:48:59 swildner Exp $ - .include "../Makefile.inc" .include "../cc_tools/Makefile.tools" .include "../Makefile.langs" @@ -7,7 +5,6 @@ PROG= cc LINKS= ${BINDIR}/cc ${BINDIR}/gcc MAN= gcc41.1 -MLINKS= gcc41.1 cc.1 gcc41.1 c++.1 gcc41.1 g++.1 gcc41.1 gcc.1 gcc41.1 CC.1 SRCS= gcc.c gccspec.c intl.c prefix.c version.c diff --git a/gnu/usr.bin/cc44/cc/Makefile b/gnu/usr.bin/cc44/cc/Makefile index 7369d73256..2799353ccb 100644 --- a/gnu/usr.bin/cc44/cc/Makefile +++ b/gnu/usr.bin/cc44/cc/Makefile @@ -4,6 +4,11 @@ PROG= cc LINKS= ${BINDIR}/cc ${BINDIR}/gcc MAN= gcc${GCCSHORTVER}.1 +MLINKS= gcc${GCCSHORTVER}.1 cc.1 \ + gcc${GCCSHORTVER}.1 c++.1 \ + gcc${GCCSHORTVER}.1 g++.1 \ + gcc${GCCSHORTVER}.1 gcc.1 \ + gcc${GCCSHORTVER}.1 CC.1 .if ${GCCDOCSUFFIX} != ${GCCSHORTVER} MLINKS= gcc${GCCSHORTVER}.1 cc${GCCDOCSUFFIX}.1 diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5 index 7bf00b303e..1faef84f38 100644 --- a/share/man/man5/make.conf.5 +++ b/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 May 5, 2010 +.Dd March 4, 2011 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -119,8 +119,9 @@ Currently accepted values for compilers which are part of .Dx are .Dq gcc41 -(default) and -.Dq gcc44 . +and +.Dq gcc44 +(default). All other values will handled according to the settings in .Xr compilers.conf 5 . .It Va BINUTILSVER @@ -349,9 +350,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_GCC41 .Pq Vt bool -Set to not build the newer version of GCC (4.4). +Set to not build the older version of GCC (4.1). .It Va NO_GDB .Pq Vt bool Set to not build diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index e2cb7ab244..8ea6b385e5 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -1,5 +1,4 @@ # $FreeBSD: src/share/mk/bsd.cpu.mk,v 1.2.2.5 2002/07/19 08:09:32 ru Exp $ -# $DragonFly: src/share/mk/bsd.cpu.mk,v 1.16 2007/09/26 22:14:17 dillon Exp $ # include compiler-specific bsd.cpu.mk. Note that CCVER may or may not # be passed as an environment variable. If not set we make it consistent @@ -15,7 +14,7 @@ # If the host system does not have the desired compiler for HOST_CCVER # we back off to something it probably does have. -_DEFAULT_CCVER= gcc41 +_DEFAULT_CCVER= gcc44 CCVER ?= ${_DEFAULT_CCVER} _CCVER := ${CCVER} diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 5f4e0f49b7..9c76250fe6 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -1,5 +1,4 @@ # $FreeBSD: src/share/mk/bsd.sys.mk,v 1.3.2.5 2002/07/03 16:59:14 des Exp $ -# $DragonFly: src/share/mk/bsd.sys.mk,v 1.12 2008/11/14 15:04:42 swildner Exp $ # # This file contains common settings used for building DragonFly # sources. @@ -25,7 +24,7 @@ CFLAGS += -std=${CSTD} . if defined(WARNS) . if ${WARNS} >= 1 CWARNFLAGS += -Wsystem-headers -. if !defined(NO_WERROR) && ${CCVER} == "gcc41" +. if !defined(NO_WERROR) && (${CCVER} == "gcc41" || ${CCVER} == "gcc44") CWARNFLAGS += -Werror . endif . endif @@ -57,7 +56,7 @@ WFORMAT = 1 . if defined(WFORMAT) . if ${WFORMAT} > 0 CWARNFLAGS += -Wformat=2 -Wno-format-extra-args -. if !defined(NO_WERROR) && ${CCVER} == "gcc41" +. if !defined(NO_WERROR) && (${CCVER} == "gcc41" || ${CCVER} == "gcc44") CWARNFLAGS += -Werror . endif . endif diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 357f0b10bc..d203b80a98 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -1,4 +1,3 @@ -# $DragonFly: src/sys/conf/kern.pre.mk,v 1.8 2008/11/17 11:55:19 swildner Exp $ # # This Makefile covers the top part of the MI kernel build instructions # @@ -84,7 +83,7 @@ PROFILE_C= ${CC} -c ${CFLAGS} ${.IMPSRC} NORMAL_M= awk -f $S/tools/makeobjops.awk -- -c $<; \ ${CC} -c ${CFLAGS} ${PROF} ${.PREFIX}.c -.if !defined(NO_WERROR) && ${CCVER} == "gcc41" +.if !defined(NO_WERROR) && (${CCVER} == "gcc41" || ${CCVER} == "gcc44") WERROR=-Werror .endif diff --git a/test/x86_64/Makefile b/test/x86_64/Makefile index 9ad42ffc8b..b7acd9c637 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_GCC44=1 \ + make -j 4 TARGET_ARCH=x86_64 TARGET_PLATFORM=pc64 NO_GCC41=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_GCC41=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_GCC41=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_GCC41=1 installworld reinstallkernel64: mount cd ${SRCDIR} && \ diff --git a/usr.bin/objformat/objformat.c b/usr.bin/objformat/objformat.c index b8f1db44f1..c7a95e2958 100644 --- a/usr.bin/objformat/objformat.c +++ b/usr.bin/objformat/objformat.c @@ -25,7 +25,6 @@ * SUCH DAMAGE. * * $FreeBSD: src/usr.bin/objformat/objformat.c,v 1.6 1998/10/24 02:01:30 jdp Exp $ - * $DragonFly: src/usr.bin/objformat/objformat.c,v 1.25 2008/05/14 15:02:48 hasso Exp $ */ #include @@ -36,7 +35,7 @@ #include #ifndef CCVER_DEFAULT -#define CCVER_DEFAULT "gcc41" +#define CCVER_DEFAULT "gcc44" #endif #ifndef BINUTILSVER_DEFAULT -- 2.41.0