Solved devel/kBuild strange (for me) build error



Like in the subject.

It happen on a virtualbox host.

@gcc47 -c -O2 -g -O3 -m32 -I/usr/ports/devel/kBuild/work/kBuild-0.1.9998/src/kmk/glob -I/usr/ports/devel/kBuild/work/kBuild-0.1.9998/out/freebsd.x86/release/obj/kmk -I/usr/ports/devel/kBuild/work/kBuild-0.1.9998/src/kmk -I/usr/ports/devel/kBuild/work/kBuild-0.1.9998/src/lib -I/usr/ports/devel/kBuild/work/kBuild-0.1.9998/src/kmk/glob -I/usr/local/include -DKBUILD_VERSION_MAJOR=0 -DKBUILD_VERSION_MINOR=1 -DKBUILD_VERSION_PATCH=9998 -DKBUILD_OS_FREEBSD -DKBUILD_ARCH_X86 -DHAVE_CONFIG_H -DKBUILD_SVN_REV=0 -DKBUILD_TYPE=\"release\" -DKMK -DNDEBUG -Wp,-MD,/usr/ports/devel/kBuild/work/kBuild-0.1.9998/out/freebsd.x86/release/obj/kmkmissing/kmkbuiltin/setmode.o.dep -Wp,-MT,/usr/ports/devel/kBuild/work/kBuild-0.1.9998/out/freebsd.x86/release/obj/kmkmissing/kmkbuiltin/setmode.o -Wp,-MP -o /usr/ports/devel/kBuild/work/kBuild-0.1.9998/out/freebsd.x86/release/obj/kmkmissing/kmkbuiltin/setmode.o /usr/ports/devel/kBuild/work/kBuild-0.1.9998/src/kmk/kmkbuiltin/setmode.c
kmk: *** Waiting for unfinished jobs....
kmk: Leaving directory `/usr/ports/devel/kBuild/work/kBuild-0.1.9998'
kmk: Entering directory `/usr/ports/devel/kBuild/work/kBuild-0.1.9998'
kmk: *** Exiting with status 2
gmake[2]: *** [bootstrap.gmk:221: /usr/ports/devel/kBuild/work/kBuild-0.1.9998/out/freebsd.x86/release/bootstrap/ts-stage2-build] Error 2
gmake[2]: uscita dalla directory "/usr/ports/devel/kBuild/work/kBuild-0.1.9998"
./kBuild/ info: rc=2: gmake -f bootstrap.gmk
*** Error code 2

make[1]: stopped in /usr/ports/devel/kBuild
*** Error code 1

make: stopped in /usr/ports/devel/kBuild

Ideas? Thankx in advance.
As usual, I solve my problems by myself and I try to be usefull to the community - often not usefull to me - posting the solution.

In this case, a perfectly working Virtualbox FreeBSD11-RELEASE machine constantly upgraded and updated, there was a leftover gcc-4.7.4 compiled again an old version of base system FreeBSD files (10.2-RELEASE] picked up by mistake by devel/kBuild Makefile (pretty broken IMHO) so the build fails.

In that system correct and perfectly built gcc port was 4.9.4. Simply deleting the offending old gcc package solved the problem.

So be carefull when you do see a failed build and check for leftovers compilers coming up for mistake.

BTW, in that case, pkg autoremove didin't find any mistake and didn't listed gcc-4.7.4 as a package to be autoremoved or broken (and it was broken becouse linked to then upgraded 10.2-RELEASE