Date: Fri, 3 Jan 2020 02:34:56 -0800 From: Mark Millard <marklmi@yahoo.com> To: John Baldwin <jhb@freebsd.org>, svn-src-head@freebsd.org Cc: FreeBSD Toolchain <freebsd-toolchain@freebsd.org> Subject: Re: svn commit: r356289 - head Message-ID: <C39C3A87-44E7-4F34-975D-D3078F275B3A@yahoo.com> References: <C39C3A87-44E7-4F34-975D-D3078F275B3A.ref@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin jhb at FreeBSD.org wrote on Thu Jan 2 21:41:07 UTC 2020 : > On 1/2/20 1:34 PM, John Baldwin wrote: > > Author: jhb > > Date: Thu Jan 2 21:34:44 2020 > > New Revision: 356289 > > URL: https://svnweb.freebsd.org/changeset/base/356289 > >=20 > > Log: > > Look for cross toolchain makefiles in /usr/share/toolchains. > > =20 > > The freebsd-binutils and freebsd-gcc* packages install toolchain > > makefiles to /usr/share/toolchains rather than LOCALBASE. >=20 > The short version is that you can do something like this to use GCC > as the system compiler (/usr/bin/cc): >=20 > cd /usr/ports/base/binutils ; make install clean > cd ../gcc6 ; make install clean >=20 > Then 'make CROSS_TOOLCHAIN=3Dfreebsd-gcc6 buildworld', etc. If you = aren't > planning on doing cross-builds you can set CROSS_TOOLCHAIN in = /etc/src.conf. >=20 > As described elsewhere, the base/* packages can be cross-built (along > with pkg), so for any architectures not yet using clang we could = fairly > easily provide a cross-built package repo (though that architecture = list > is becoming rather small). I will probably add a base/gcc9 port once = we > can build a full system with gcc9. Just an FYI from some experiments that I did recently: devel/binutils@powerpc and devel/binutils@powerpc64 and base/binutils@powerpc and base_binutils@powerpc64 do not put out the same content as lld or the old toolchain's ld (still used normally for 32-bit powerpc). buildkernel runs to completion but the result crashes from the kernel sseflf-loading and what was produced not matching. For example, binutils put out very few ABS symbols compared to lld/old-ld and classifies the kernel as ET_EXEC, not ET_DYN, because of the non-zero VirtAddr in: Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg = Align . . . LOAD 0x000000 0x00100000 0x00100000 0xd9786c 0x1083648 RWE = 0x10000 . . . (I'm not claiming that is all there is that matters.) These points are true using system-clang as the compiler. (I've only cross-built so far.) I do not know if other architectures have similar issues or not. But, it appears that in some cases, there is more work to allowing the GNU linker to be used, for at least buildkernel . I do not know if there is an intent to support a (modern) GNU binutils ld (in addition to lld) or not. So it may be that the effort would not be put in. (I'm not claiming which side(s) would change if the effort was put in.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C39C3A87-44E7-4F34-975D-D3078F275B3A>