compiling kernel with new GCC version

i had just installed gcc46 ,now i am trying to compile my kernel with this version for hack :D ,i added in bsd.own.mk this :
Code:
LIBDIR?=        /usr/lib \
                /usr/local/lib
INCLUDEDIR?=    /usr/include \
                /usr/local/include
the error i get from buildkernel :
Code:
cd /usr/obj/usr/src/sys/STABLE;  MAKESRCPATH=/usr/src/sys/dev/aic7xxx/aicasm  make SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF  -f /usr/src
/sys/dev/aic7xxx/aicasm/Makefile
Warning: Object directory not changed from original /usr/obj/usr/src/sys/STABLE
gcc46 -pipe -nostdinc -I/usr/include -I. -I/usr/src/sys/dev/aic7xxx/aicasm -std=gnu99  -Wsystem-headers -Werror -Wall -Wno-format-y2k -W 
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow 
-Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/src/sys/dev/aic7xxx
/aicasm/aicasm.c
gcc46: not found
*** Error code 127

Stop in /usr/obj/usr/src/sys/STABLE.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
 
That guide says that newer versions of GCC can be used but stays short of usage for building world and kernel.
I remember that this is still not possible. Tell me if I'm wrong about that.
 
FreeBSD's base system is a coherent whole, which needs to be built with its base system compilers, not external ones.
 
DutchDaemon said:
FreeBSD's base system is a coherent whole, which needs to be built with its base system compilers, not external ones.
Anything in the pipeline to change/update the base system compiler in near future?
 
SIFE said:
that is for ports not for kernel or build world .
Oops. You are right. My bad.

Erratus said:
Anything in the pipeline to change/update the base system compiler in near future?
There are efforts to use clang for building world, but as reported on the mailing lists, it needs more testing.
 
are you trying Mr DutchDaemon to say that is impossible to compile kernel with extranal compiler ,and where about this file "share/mk/sys.mk" .
 
Not impossible, it may work (as in: successfully compile). And then there's the inevitable forum post to which the answer is: "Any compiler flags in /etc/make.conf? Remove them and try again". The fact that FreeBSD allows you to use flags and external compilers doesn't mean they will actually work. The default compilers and flags will always work.
 
Erratus said:
Anything in the pipeline to change/update the base system compiler in near future?

Clang is being imported into the FreeBSD source tree this month. GCC 4.2.1 will remain in the source tree, and will remain the default compiler. However, there will be knobs you can set in /etc/make.conf and/or /etc/src.conf to use Clang to compile the world/kernel.
 
any suggestion to make this hack work ,i tryed to make some change in make.conf but this does not work .
 
SIFE said:
are you trying Mr DutchDaemon to say that is impossible to compile kernel with extranal compiler ,and where about this file "share/mk/sys.mk" .

There's work in the pipeline to allow for the use of external compiler toolchains to build the world/kernel/ports. It's not ready for public testing, but work is ongoing.

For some information, see the wiki.
 
Just for the record - I've successfully compiled kernel (9.0-CURRENT, about six months ago) with GCC 4.5 with this in /etc/make.conf:

Code:
CC= /usr/local/bin/gcc45
CXX= /usr/local/bin/g++45
CWARNFLAGS= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
-Wno-pointer-sign -D__FreeBSD_cc_version=0 \
-Wno-unused-function -Wno-inline -Wno-format \
-Wno-uninitialized -Wno-array-bounds -Wno-missing-prototypes
NO_WERROR= 1
 
Back
Top