Build cross compiler for Raspberry Pi

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

 



Hi all,

I am attempting to build the binutils/gcc/glibc toolchain to build a
cross compiled Linux from scratch for my Raspberry Pi. I succesfully
have compiled binutils, stage 1 of gcc and glibc:

For binutils 2.29:
$ configure --prefix=/opt/rpi --disable.nls
--target=arm-linux-gnueabihf --disable-multilib
$ make
$ make install

For gcc 7.2.0 (stage 1):
$ export PATH=/opt/rpi/bin:${PATH}
$ configure --prefix=/opt/rpi --target=arm-linux-gnueabihf
--enable-languages=c --without-headers --disable-nls
--disable-multilib --disable-threads --disable-shared
$ make all-gcc all-target-libgcc
$ make install-gcc install-target-libgcc

Get current kernel headers:
$ cd /opt/rpi/src
$ git clone https://github.com/raspberrypi/linux.git
$ cd linux
$ make headers_install ARCH=arm INSTALL_HDR_PATH=/opt/rpi/src/kernel-headers

For glibc 2.26:
$ configure --prefix=/opt/rpi --host=arm-linux-gnueabihf
--with-headers=/opt/rpi/src/kernel-headers/include --disable-multilib
$ make
$ make install

Until here all is ok, but I am a bit confused about how to compile
stage 2 of gcc. I have tested some configurations (found all over the
internet) but no one compiles ok the stage 2.

Any idea for how to compile the stage 2? I guess I should use the
"--with-sysroot" configuration option but I don't understand it.

Thanks in advance!


-- 
Avelino Herrera Morales
http://avelino.atlantes.org
https://twitter.com/avelinohm
https://facebook.com/avelinoherrera
https://plus.google.com/+AvelinoHerreraMorales



[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