Compiling the kernel using GCC

From: Aijaz Baig <aijazbaig1_at_gmail.com>
Date: Sat, 26 Aug 2017 15:11:11 +0530
Has anyone been able to successfully compile the kernel using GCC as
against CLANG the default compiler on most later versions of FreeBSD? I was
able to successfully buildworld. After which I reboot and now /usr/bin/cc
points to GCC as requested. However kernel fails to link
Here is my src.conf:

COPTFLAGS+= -O0 -pipe -Wno-attributes -Wno-redundant-decls
WERROR="-Wno-error"
WITHOUT_CLANG="yes"
WITHOUT_CLANG_IS_CC="yes"
WITHOUT_CLANG_BOOTSTRAP="yes"
WITH_GCC_BOOTSTRAP="yes"
WITH_GCC="yes"
WITH_GNUCXX="yes"
WITHOUT_JAIL="yes"
WITHOUT_WIRELESS="yes"
WITHOUT_WIRELESS_SUPPORT="yes"
WITHOUT_WPA_SUPPLICANT_EAPOL="yes"
WITHOUT_CDDL="yes"

It fails here:
>>> stage 3.1: building everything
--------------------------------------------------------------
cd /usr/obj/usr/src/sys/AIJAZ-DEBUG; COMPILER_VERSION=40201
COMPILER_FEATURES= COMPILER_TYPE=gcc COMPILER_FREEBSD_VERSION=1200001
MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=amd64 MACHINE=amd64 CPUTYPE= CC="cc
-isystem /usr/obj/usr/src/tmp/usr/include -L/usr/obj/usr/src/tmp/usr/lib
-B/usr/obj/usr/src/tmp/usr/lib --sysroot=/usr/obj/usr/src/tmp
-B/usr/obj/usr/src/tmp/usr/bin" CXX="c++  -isystem
/usr/obj/usr/src/tmp/usr/include -L/usr/obj/usr/src/tmp/usr/lib
-B/usr/obj/usr/src/tmp/usr/lib --sysroot=/usr/obj/usr/src/tmp
-B/usr/obj/usr/src/tmp/usr/bin" CPP="cpp -isystem
/usr/obj/usr/src/tmp/usr/include -L/usr/obj/usr/src/tmp/usr/lib
-B/usr/obj/usr/src/tmp/usr/lib --sysroot=/usr/obj/usr/src/tmp
-B/usr/obj/usr/src/tmp/usr/bin" AS="as" AR="ar" LD="ld" LLVM_LINK="" NM=nm
OBJCOPY="objcopy" RANLIB=ranlib STRINGS= SIZE="size" INSTALL="sh
/usr/src/tools/install.sh"
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin
make  -D KERNFAST -m /usr/src/share/mk  KERNEL=kernel all -DNO_MODULES_OBJ
linking kernel.full
ck_array.o: In function `ck_cc_popcount':
/usr/src/sys/contrib/ck/include/gcc/ck_cc.h:139: undefined reference to
`__popcountdi2'
ck_barrier_centralized.o: In function `ck_cc_popcount':
/usr/src/sys/contrib/ck/include/gcc/ck_cc.h:139: undefined reference to
`__popcountdi2'
ck_barrier_combining.o: In function `ck_cc_popcount':
/usr/src/sys/contrib/ck/include/gcc/ck_cc.h:139: undefined reference to
`__popcountdi2'
ck_barrier_dissemination.o: In function `ck_cc_popcount':
/usr/src/sys/contrib/ck/include/gcc/ck_cc.h:139: undefined reference to
`__popcountdi2'
ck_barrier_mcs.o: In function `ck_cc_popcount':
/usr/src/sys/contrib/ck/include/gcc/ck_cc.h:139: undefined reference to
`__popcountdi2'
ck_barrier_tournament.o:/usr/src/sys/contrib/ck/include/gcc/ck_cc.h:139:
more undefined references to `__popcountdi2' follow
*** Error code 1

Stop.
make[2]: stopped in /usr/obj/usr/src/sys/AIJAZ-DEBUG
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src

Is there something else I am missing?
Aijaz Baig
Received on Sat Aug 26 2017 - 07:41:12 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:13 UTC