Re: 1 of 1,851 Trouble compiling aarch64 cross builds of gcc5.4 and 7.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23 April 2018 at 18:37, Kai Ruottu wrote:
>
>
> 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.

contrib/download_prerequisites only fetches the sources for GMP, MPFR,
MPC and ISL. They're all needed for the host, not the target, so
saying to copy anything into the sysroot instead of using that script
is wrong.

You might want/need to copy libraries and headers into the sysroot for
cross compilers, but that is orthogonal to the use of
contrib/download_prerequisites.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux