From: zrj Date: Wed, 19 Oct 2016 10:51:13 +0000 (+0300) Subject: gcc47: Allow gcc47 to compile itself at WORLD_CCOPTLEVEL=g. X-Git-Tag: v4.8.0rc~740 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/7450193e72af214945785854ecd0e5b6fe0f98c9 gcc47: Allow gcc47 to compile itself at WORLD_CCOPTLEVEL=g. Override supplied -Og when gcc47 is bootstrapping itself. -Og is very useful in some heavy debugging seasions so it is better to give developers an easy workaround than fail for a single part of buildworld. Only intended for WORLD_CCOPTLEVEL=g compilations to not require to explictly disable the alternative compiler (NO_ALTCOMPILER=true). Note that -Og is mostly -O1 with few optimizations disabled. --- diff --git a/gnu/lib/gcc47/Makefile.inc b/gnu/lib/gcc47/Makefile.inc index 4500118826..d4e53c7327 100644 --- a/gnu/lib/gcc47/Makefile.inc +++ b/gnu/lib/gcc47/Makefile.inc @@ -33,3 +33,9 @@ CFLAGS+= -I${GCCDIR}/gcc CFLAGS+= -I${GCCDIR}/gcc/config CFLAGS+= -I${GCCDIR}/gcc/config/${GCC_CPU} CFLAGS+= -I${CCDIR}/../gmp + +# only gcc 4.8 and later has support for -Og +.if defined(WORLD_CCOPTLEVEL) && ${WORLD_CCOPTLEVEL:Mg} && ${CCVER:Mgcc47} +WORLD_CCOPTLEVEL:= 1 +.MAKEFLAGS: WORLD_CCOPTLEVEL=1 +.endif diff --git a/gnu/usr.bin/cc47/Makefile.inc b/gnu/usr.bin/cc47/Makefile.inc index c536bf9fa9..b5f7e585c3 100644 --- a/gnu/usr.bin/cc47/Makefile.inc +++ b/gnu/usr.bin/cc47/Makefile.inc @@ -57,6 +57,12 @@ CFLAGS+= -DCROSS_COMPILE CWARNFLAGS+= -Wno-switch-bool .endif +# only gcc 4.8 and later has support for -Og +.if defined(WORLD_CCOPTLEVEL) && ${WORLD_CCOPTLEVEL:Mg} && ${CCVER:Mgcc47} +WORLD_CCOPTLEVEL:= 1 +.MAKEFLAGS: WORLD_CCOPTLEVEL=1 +.endif + .if defined(GCC_LANG_DIR) .PATH: ${GCCDIR}/${GCC_LANG_DIR} .endif