Ignitus Boyone wrote 20.4.2018 :
I'm currently trying to build aarch64 cross compilers on a Dell Ubuntu
machine. I'm building from the official release tar balls for the
respective branches.
I've configured the trees out of source using the following commands
../configure --disable-multilib --build=x86_64-linux-gnu
--host=x86_64-linux-gnu -target=aarch64-linux
--prefix=/opt/utils/gcc-5.4-aarch64
--program-suffix=-5.4
../configure --disable-multilib --build=x86_64-linux-gnu
--host=x86_64-linux-gnu -target=aarch64-linux
--prefix=/opt/utils/gcc-7.2-aarch64
--program-suffix=-7.2
I did use contrib/download_prerequisites to pull the required libraries
prior to starting.
I don't believe this "required libraries" being true in the
crosscompiler cases. When
in the native case the required target libraries and headers are in
their native places,
for instance in '/lib64', '/lib', '/usr/lib64', '/usr/lib' and
'/usr/include', in the cross
case one needs to provide them somehow. For instance copying them from the
target system, here from the 'aarch64-linux' system in question. And
then installing
them into a suitable $SYSROOT and pointing to them via a
'--with-sysroot=$SYSROOT'
when configuring the GNU binutils and GCC sources.
Sometimes there isn't that already existing target system in the
beginning but the goal
is to create it from absolute scratch. How one does this is then a
highly political question.
The assumption however is that the target system, 'aarch64-linux-gnu'
here, already exists
and it already has those "required libraries" in its native places ready
to be copied onto the
cross host, 'x86_64-linux-gnu' here.
Or there already are pre-made 'aarch64-linux-gnu' distros from which one
could copy the
required "standard C library" for the target in a "suitable format"
('aarch64-linux-gnu'
target library binaries and 'aarch64-linux-gnu' target headers) in order
to get the "stage1"
crosscompiler with which to compile the "self-made" glibc for the
'aarch64-linux-gnu'
target and the Linux kernel for the "self-made" 'aarch64-linux-gnu'
system. This is the
easy way for "starting from scratch", following the "an existing hammer
can be used while
making a new hammer" method. The alternative method is to not accept
any existing
"temporary pre-made components" for the target system. Then things will
become much
more complicated. Lazy people like me have never cared to adsorb these
"revolutionary,
destroy the existing capitalistic world and start again from absolute
scratch" theories.
Currently while building I run in to a problem building
the target version of libgcc
The 'gcc' (binaries) part succeeds always but when the new 'xgcc', 'cc1'
etc will be used
to create the extra target libraries like 'libgcc', the assumed-to-exist
"target C library" will
usually be needed in order to see what things it will support.
Generally I don't know what on earth the 'aarch64-linux' means but my
first guess : "Linux
for 64-bit ARM" can be that. When made for the "Arch Linux" distro :
https://archlinuxarm.org/platforms/armv8/generic
I would assume this distro providing the needed "standard C library for
'arm64-linux-gnu'.
Debian uses a different target name in its install packages like :
http://ftp.funet.fi/pub/Linux/INSTALL/Debian/pool/main/g/glibc/libc-dev-bin_2.27-3_arm64.deb