svn commit: r356289 - head

Mark Millard marklmi at yahoo.com
Fri Jan 3 10:35:04 UTC 2020


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
> > 
> > Log:
> >   Look for cross toolchain makefiles in /usr/share/toolchains.
> >   
> >   The freebsd-binutils and freebsd-gcc* packages install toolchain
> >   makefiles to /usr/share/toolchains rather than LOCALBASE.
> 
> The short version is that you can do something like this to use GCC
> as the system compiler (/usr/bin/cc):
> 
> cd /usr/ports/base/binutils ; make install clean
> cd ../gcc6 ; make install clean
> 
> Then 'make CROSS_TOOLCHAIN=freebsd-gcc6 buildworld', etc.  If you aren't
> planning on doing cross-builds you can set CROSS_TOOLCHAIN in /etc/src.conf.
> 
> 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 at powerpc and devel/binutils at powerpc64 and
base/binutils at powerpc and base_binutils at 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.)

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the svn-src-head mailing list