This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building a cross-compiler for a Raspberry Pi


On 03/15/2016 10:51 AM, YuGiOhJCJ Mailing-List wrote:
> These are the steps I follow in order to build a cross-compiler:
> 1) I build binutils for the target
> 2) I install the headers from a library (that is specific)
> 3) I build a minimal gcc for the target (only C language supported)
> 4) I build a library for the target (that is specific)
> 5) I build a full gcc for the target (C and C++ languages supported)
> 
> For the step 2), it must be skipped for some targets:
> * If the target is avr, it must be skipped
> * If the target is i686-w64-mingw32, it must be done
> 
> For the step 2) and 4), the library I use depends on the target:
> * If the target is avr, I use avr-libc [1]
> * If the target is i686-w64-mingw32, I use mingw-w64 [2]
> 
> This method works fine for avr and i686-w64-mingw32, so I am
> wondering why it does not work for my armv6l-unknown-linux-gnueabihf
> machine too.

Because you need the target libraries.  It's not just libc itelf, but
also ld.so and possibly some others such as libdl.so.

Each GNU/Linux system has its dynamic libraries, and you should make
sure that you are building GCC against the correct versions installed
on your target system.

> I guess it is because I don't know which specific library I can use
> for the steps 2) and 4).
> Maybe newlib [3] is what I am looking for.
> 
> Can you tell me if my method is correct and if newlib could be what
> I am looking for?

Newlib is wrong for any GNU/Linux system.  You want an appropriately-
configured glibc.

It's my turn to ask a question.  Why do you want to make this so
difficult, when you could simply build a cross compiler and be
finished already?

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]