From: Matthew Dillon Date: Mon, 3 Sep 2018 17:25:35 +0000 (-0700) Subject: World - Change default compiler from gcc-5 to gcc-8 X-Git-Tag: v5.5.0~239 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/2a89766ae0591bf31ec51e6298cf4e4d050f4a1a World - Change default compiler from gcc-5 to gcc-8 * Change the default compiler from gcc-5 to gcc-8. gcc-5 will no longer be built by default. Setting WORLD_ALTCOMPILER=all will build all three as before. * Create CC hardlink for gcc80 so dports picks it up. gcc80 is now the default for dports instead of 50. * Adjust the Makefile's to make things easier the next time, though they could still use more work. --- diff --git a/Makefile.inc1 b/Makefile.inc1 index bfdb5a489d..84ae733d4a 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -108,7 +108,7 @@ DESTDIRBASE:= ${OBJTREE}${.CURDIR} .MAKEFLAGS:= ${.MAKEFLAGS:NDESTDIR=*} # This section sets the tools used to build the world/kernel -WORLD_CCVER?= gcc50 +WORLD_CCVER?= gcc80 WORLD_LDVER?= ld.gold WORLD_BINUTILSVER?= binutils227 @@ -884,56 +884,47 @@ bstrap-${_tool}! .warning undefined WORLD_ALTCOMPILER .endif -_gcc_common_cross= lib/libz gnu/usr.bin/gmp gnu/usr.bin/mpfr gnu/usr.bin/mpc +# gcc80 is now the default compiler. See sys.mk for WORLD_ALTCOMPILER default +# and this file for WORLD_CCVER. +# +_gcc47_cross= gnu/usr.bin/cc47 +_gcc47_tools= gnu/usr.bin/cc47/cc_prep gnu/usr.bin/cc47/cc_tools + _gcc50_cross= gnu/usr.bin/cc50 _gcc50_tools= gnu/usr.bin/cc50/cc_prep gnu/usr.bin/cc50/cc_tools + +_gcc80_cross= gnu/usr.bin/cc80 +_gcc80_tools= gnu/usr.bin/cc80/cc_prep gnu/usr.bin/cc80/cc_tools + +_gcc_common_cross= lib/libz gnu/usr.bin/gmp gnu/usr.bin/mpfr gnu/usr.bin/mpc + .if !defined(NO_ALTCOMPILER) . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47}) -_gcc47_cross= gnu/usr.bin/cc47 -_gcc47_tools= gnu/usr.bin/cc47/cc_prep gnu/usr.bin/cc47/cc_tools _altcompiler_cross+= ${_gcc47_cross} -_altcompiler_tools+= _gcc47_tools . endif -. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80}) -_gcc80_cross= gnu/usr.bin/cc80 -_gcc80_tools= gnu/usr.bin/cc80/cc_prep gnu/usr.bin/cc80/cc_tools -_altcompiler_cross+= ${_gcc80_cross} -_altcompiler_tools+= _gcc80_tools +.endif + +.if !defined(NO_ALTCOMPILER) +. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc50}) +_altcompiler_cross+= ${_gcc50_cross} . endif .endif + +#.if !defined(NO_ALTCOMPILER) +#. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80}) +#_altcompiler_cross+= ${_gcc80_cross} +_basecompiler_cross+= ${_gcc80_cross} +#. endif +#.endif + _custom_cross= libexec/customcc _binutils= gnu/usr.bin/${WORLD_BINUTILSVER} -# XXX obsolete -.if 0 -.for _atools in ${_altcompiler_tools} -BTOOLSDIRS+= ${${_atools}} -.endfor -BTOOLSDIRS+= ${_gcc50_tools} -.endif - build-tools: build-tools-targets touch ${BTOOLSDEST}/.build_done build-tools-targets: ${BTOOLSDIRS:S/^/btools-/} -.if 0 -.for _atools in ${_altcompiler_tools} -.ORDER: ${${_atools}:C/^/btools-/} -.endfor -.ORDER: ${_gcc50_tools:S/^/btools-/} - -.for _tool in ${BTOOLSDIRS} -btools-${_tool}! - ${ECHODIR} "===> ${_tool} (build-tools)"; \ - cd ${.CURDIR}/${_tool}; \ - make DIRPRFX=${_tool}/ obj && \ - make DIRPRFX=${_tool}/ depend && \ - make DIRPRFX=${_tool}/ all && \ - make DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install -.endfor -.endif - # # cross-tools: Build cross-building tools # @@ -943,7 +934,7 @@ CTOOLSDIRS= usr.bin/objformat CTOOLSDIRS+= ${_binutils} \ ${_gcc_common_cross} \ ${_altcompiler_cross} \ - ${_gcc50_cross} ${_custom_cross} + ${_basecompiler_cross} ${_custom_cross} cross-tools: cross-tools-targets touch ${CTOOLSDEST}/.cross_done @@ -976,16 +967,26 @@ hierarchy: # .makeenv does not work when bootstrapping from 4.x, so we must be sure # to specify the correct CCVER or 'cc' will not exec the correct compiler. # +# NOTE: Allow duplicate build for WORLD_ALTCOMPILER=all for WORLD_CCVER, +# It will already be built so it won't cost any extra time. Please +# list all compilers in the ALTCOMPILER sequence, including the base +# compile. +# libraries: cd ${.CURDIR}; \ - HOST_CCVER=${HOST_CCVER} CCVER=gcc50 \ - make -f Makefile.inc1 _startup_libs50 -DSYSBUILD -DLIBGCC_ONLY; + HOST_CCVER=${HOST_CCVER} CCVER=${WORLD_CCVER} \ + make -f Makefile.inc1 ${_startup_libs_base} -DSYSBUILD -DLIBGCC_ONLY; .if !defined(NO_ALTCOMPILER) . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47}) cd ${.CURDIR}; \ HOST_CCVER=${HOST_CCVER} CCVER=gcc47 \ make -f Makefile.inc1 _startup_libs47 -DSYSBUILD -DLIBGCC_ONLY; . endif +. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc50}) + cd ${.CURDIR}; \ + HOST_CCVER=${HOST_CCVER} CCVER=gcc50 \ + make -f Makefile.inc1 _startup_libs50 -DSYSBUILD -DLIBGCC_ONLY; +. endif . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80}) cd ${.CURDIR}; \ HOST_CCVER=${HOST_CCVER} CCVER=gcc80 \ @@ -1004,35 +1005,48 @@ libraries: # shared libraries for ELF. The target for _startup_libsXX is # specifically built using gccXX. # -.if !defined(NO_ALTCOMPILER) _startup_libs47= gnu/usr.bin/cc47/cc_prep \ gnu/usr.bin/cc47/cc_tools \ gnu/lib/gcc47/csu \ gnu/lib/gcc47/libgcc \ gnu/lib/gcc47/libgcc_eh \ gnu/lib/gcc47/libgcc_pic -. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47}) -_startup_libs_alt+= _startup_libs47 -. endif -.endif + _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_libs80= gnu/usr.bin/cc80/cc_prep \ gnu/usr.bin/cc80/cc_tools \ gnu/lib/gcc80/csu \ gnu/lib/gcc80/libgcc \ gnu/lib/gcc80/libgcc_eh \ gnu/lib/gcc80/libgcc_pic + +# gcc80 is now the default compiler. See sys.mk for WORLD_ALTCOMPILER default. +# .if !defined(NO_ALTCOMPILER) -. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80}) -_startup_libs_alt+= _startup_libs80 +. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47}) +_startup_libs_alt+= _startup_libs47 . endif .endif +.if !defined(NO_ALTCOMPILER) +. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc50}) +_startup_libs_alt+= _startup_libs50 +. endif +.endif + +#.if !defined(NO_ALTCOMPILER) +#. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80}) +#_startup_libs_alt+= _startup_libs80 +_startup_libs_base+= _startup_libs80 +#. endif +#.endif + _startup_libs= lib/csu lib/libc lib/libc_rtld lib/libc__L: lib/csu__L @@ -1069,11 +1083,11 @@ lib/libdevattr__L: lib/libprop__L _generic_libs+= usr.bin/flex/lib -.for _alib in ${_startup_libs_alt} +.for _alib in ${_startup_libs_alt} ${_startup_libs_base} __startup_alibs+= ${${_alib}} .endfor -.for _lib in ${__startup_alibs} ${_startup_libs50} \ +.for _lib in ${__startup_alibs} \ ${_startup_libs} ${_prebuild_libs} ${_generic_libs} ${_lib}__L: .PHONY .if exists(${.CURDIR}/${_lib}) @@ -1092,21 +1106,18 @@ ${_lib}__L: .PHONY .endfor _startup_libs: ${_startup_libs:S/$/__L/} -.for _alib in ${_startup_libs_alt} +.for _alib in ${_startup_libs_alt} ${_startup_libs_base} ${_alib}: ${${_alib}:C/$/__L/} .endfor -_startup_libs50: ${_startup_libs50: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) # -.for _alib in ${_startup_libs_alt} +.for _alib in ${_startup_libs_base} ${_startup_libs_alt} .ORDER: ${${_alib}:C/$/__L/} .endfor -.ORDER: ${_startup_libs50:S/$/__L/} -#.ORDER: ${_startup_libs:S/$/__L/} # uncomment if there are missing dependencies .if 0 diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile index ae2f11edeb..940963ad32 100644 --- a/gnu/lib/Makefile +++ b/gnu/lib/Makefile @@ -1,14 +1,31 @@ -SUBDIR= gcc50 libcryptsetup libdevmapper libdialog libluks liblvm + +# gcc80 is now the default. See sys.mk for WORLD_ALTCOMPILER default. +# +# (duplicate WORLD_CCVER for ALTCOMPILER == all is already built and +# takes no extra time) +# +SUBDIR+= ${WORLD_CCVER} .if !defined(NO_ALTCOMPILER) . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47}) SUBDIR+= gcc47 . endif -. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80}) -SUBDIR+= gcc80 +.endif + +.if !defined(NO_ALTCOMPILER) +. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc50}) +SUBDIR+= gcc50 . endif .endif + +#.if !defined(NO_ALTCOMPILER) +#. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80}) +SUBDIR+= gcc80 +#. endif +#.endif + +SUBDIR+= libcryptsetup libdevmapper libdialog libluks liblvm SUBDIR_ORDERED= .include diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile index 0f20baa670..b483dad759 100644 --- a/gnu/usr.bin/Makefile +++ b/gnu/usr.bin/Makefile @@ -20,20 +20,32 @@ SUBDIR+= ${BU_BACKUP} SUBDIR+= gmp SUBDIR+= mpfr SUBDIR+= mpc -SUBDIR+= cc50 +# gcc80 is now the default, see sys.mk for WORLD_ALTCOMPILER default +# +# .if !defined(NO_ALTCOMPILER) . if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc47}) SUBDIR+= cc47 _altcompiler_dirs+= cc47 . endif -. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80}) -SUBDIR+= cc80 -_altcompiler_dirs+= cc80 +.endif + +.if !defined(NO_ALTCOMPILER) +. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc50}) +SUBDIR+= cc50 +_altcompiler_dirs+= cc50 . endif .endif -.ORDER: ${BU_PRIMARY} gmp mpfr mpc cc50 ${_altcompiler_dirs} +#.if !defined(NO_ALTCOMPILER) +#. if defined(WORLD_ALTCOMPILER) && (${WORLD_ALTCOMPILER} == "all" || ${WORLD_ALTCOMPILER:Mgcc80}) +SUBDIR+= cc80 +_compiler_dir= cc80 +#. endif +#.endif + +.ORDER: ${BU_PRIMARY} gmp mpfr mpc ${_compiler_dir} ${_altcompiler_dirs} # maximum parallelism # diff --git a/gnu/usr.bin/cc80/drivers/c++/Makefile b/gnu/usr.bin/cc80/drivers/c++/Makefile index 4892a09694..6f7ab47652 100644 --- a/gnu/usr.bin/cc80/drivers/c++/Makefile +++ b/gnu/usr.bin/cc80/drivers/c++/Makefile @@ -6,7 +6,7 @@ GCC_LANG_DIR= gcc/cp PROG_CXX= c++ LINKS= ${BINDIR}/c++ ${BINDIR}/g++ # Enable this SGI compat once gcc80 becomes default (DPorts anchor) -#LINKS+= ${BINDIR}/c++ ${BINDIR}/CC +LINKS+= ${BINDIR}/c++ ${BINDIR}/CC MAN= # man pages installed by cc (MLINK) SRCS= ${GCC_SRCS} g++spec.c ${EXTRA_GCC_SRCS} diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index faa624d01b..2af97d76d9 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -14,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= gcc50 +_DEFAULT_CCVER= gcc80 _DEFAULT_BINUTILSVER= binutils227 CCVER ?= ${_DEFAULT_CCVER} diff --git a/usr.bin/objformat/objformat.c b/usr.bin/objformat/objformat.c index b658bca0af..eb7ee8acc7 100644 --- a/usr.bin/objformat/objformat.c +++ b/usr.bin/objformat/objformat.c @@ -37,7 +37,7 @@ #include #ifndef CCVER_DEFAULT -#define CCVER_DEFAULT "gcc50" +#define CCVER_DEFAULT "gcc80" #endif #ifndef BINUTILSVER_DEFAULT