Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Aug 2017 21:51:52 -0700
From:      Ryan Libby <rlibby@gmail.com>
To:        Aijaz Baig <aijazbaig1@gmail.com>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>,  FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Compiling the kernel using GCC
Message-ID:  <CAHgpiFyq2Y3n_M-v0OFDfMu6H1WoKQ%2BzroTf3h0p3-s70xMDRw@mail.gmail.com>
In-Reply-To: <CAHB2L%2BdNhMArMVGkVPY2=z49X-jgscHDGw8ydYKh4NncsSVBbQ@mail.gmail.com>
References:  <CAHB2L%2BdNhMArMVGkVPY2=z49X-jgscHDGw8ydYKh4NncsSVBbQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 26, 2017 at 2:41 AM, Aijaz Baig <aijazbaig1@gmail.com> wrote:
> 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
[...]
> 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'
[...]

Do you need ck?  Can you share your KERNCONF?  And the branch and
revision you are building?

I have been building an amd64 GENERIC kernel on head with various gccs.
I think that does not build ck.  The main method I have been focusing on
for now is

make CROSS_TOOLCHAIN=amd64-gcc TARGET=amd64 TARGET_ARCH=amd64 buildkernel

with the amd64-xtoolchain-gcc-0.2 package installed.  But I have also
built kernel-only successfully with gcc 6 with src.conf e.g. as below.

% cat /etc/src.conf.gcc6
WITH_GCC=yes
WITH_GCC_BOOTSTRAP=yes
WITH_GCC_IS_CC=yes
WITHOUT_CLANG=yes
WITHOUT_CLANG_BOOTSTRAP=yes
WITHOUT_CLANG_IS_CC=yes
WITHOUT_FORMAT_EXTENSIONS=yes
CC=/usr/local/bin/gcc6
CXX=/usr/local/bin/g++6



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHgpiFyq2Y3n_M-v0OFDfMu6H1WoKQ%2BzroTf3h0p3-s70xMDRw>