gcc47: Allow gcc47 to compile itself at WORLD_CCOPTLEVEL=g.
authorzrj <rimvydas.jasinskas@gmail.com>
Wed, 19 Oct 2016 10:51:13 +0000 (13:51 +0300)
committerzrj <zrj@dragonflybsd.org>
Mon, 24 Oct 2016 11:55:35 +0000 (14:55 +0300)
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.

gnu/lib/gcc47/Makefile.inc
gnu/usr.bin/cc47/Makefile.inc

index 4500118..d4e53c7 100644 (file)
@@ -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
index c536bf9..b5f7e58 100644 (file)
@@ -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