Jonathan Wakely kirjoitti 23.4.2018 klo 19.20:
On 21 April 2018 at 08:43, Kai Ruottu wrote:
Ignitus Boyone wrote 20.4.2018 :
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.
Are you sure about that? Using contrib/download_prerequisites should
work for cross-compilers too, shouldn't it?
The GMP, MPFR and MPC libs are needed by the host compiler, not the
target, so copying them from the target machine isn't going to work.
Yes, it works for the "compiler" if one means with that the result from
"make all-gcc",
producing ONLY the compiler binaries. But the problem with
crosscompilers is that
the target C library binaries and the target headers aren't
automatically available like
they are available in the native compiler case. Copying the target C
library stuff into
a SYSROOT should still be the practice in the "system target" cases like
Sun Solaris2.x
and Linux distros (Fedora, CentOS, Ubuntu, SuSE, Tizen,...) being the
target system.
With "embedded target" cases the practice is to build the target C
library, 'newlib',
for the target system during the GCC build just like those GMP, MPFR and
MPC libs
for the host system. Simply via putting the 'newlib' and 'libgloss'
sources onto the
main GCC source directory. Whether "contrib/download_prerequisites"
works in
these cases I don't know. My guess is that it doesn't download the
current newlib
sources and symlink/add the 'newlib' and 'libgloss' stuff into the GCC
sources. When
the target is one of those "embedded" cases like '*-elf', '*-eabi' etc.
Ok, in this 'aarch64-linux-gnu' case getting it clear what is the
"target system" would
be the first thing. Is it some Ubuntu distro for 64-bit ARM or what?
Where and which
are its install packages for the the glibc and kernel headers installed
on the target
system? Probably only the shared runtime libraries are there so copying
from it
would give only parts of the needed stuff, no development headers and
development
libraries (startups and static libraries). Maybe this?
https://packages.ubuntu.com/en/trusty/gcc-aarch64-linux-gnu