Re: Build cross compiler for Raspberry Pi

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

 



On 16-Aug-17 15:14, Avelino Herrera Morales wrote:
Hi Christer,

thankyou very much for your help. I have tested your changes:

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

For stage 1 of gcc 7.2.0:
$ 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

For linux kernel headers (following your suggestion):
$ cd linux
$ make headers_install ARCH=arm INSTALL_HDR_PATH=/opt/rpi/sysroot

For glibc 2.29 (following your suggestion):
$ configure --prefix=/usr --host=arm-linux-gnueabihf
--with-headers=/opt/rpi/sysroot/include --disable-multilib
$ make
$ make install DESTDIR=/opt/rpi/sysroot

Until this point everyting ok (I realized that now /opt/rpi/sysroot is
populated with /usr and the rest of standard folders and with include
files). The problem arises when compiling stage 2 of gcc using the
modifications you suggested (I use separated build folders for stages
1 and 2):

$ configure --prefix=/opt/rpi --target=arm-linux-gnueabihf
--enable-languages=c,c++ --disable-nls --disable-multilib
--with-sysroot=/opt/rpi/sysroot
$ make

The process terminates with the following output:

/opt/rpi/build/gcc-7.2.0-final/./gcc/xgcc
-B/opt/rpi/build/gcc-7.2.0-final/./gcc/
-B/opt/rpi/arm-linux-gnueabihf/bin/
-B/opt/rpi/arm-linux-gnueabihf/lib/ -isystem
/opt/rpi/arm-linux-gnueabihf/include -isystem
/opt/rpi/arm-linux-gnueabihf/sys-include    -g -O2 -O2  -g -O2
-DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition  -isystem ./include   -fPIC -fno-inline -g
-DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fPIC
-fno-inline -I. -I. -I../.././gcc -I../../../../src/gcc-7.2.0/libgcc
-I../../../../src/gcc-7.2.0/libgcc/.
-I../../../../src/gcc-7.2.0/libgcc/../gcc
-I../../../../src/gcc-7.2.0/libgcc/../include  -DHAVE_CC_TLS  -o
_muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c
../../../../src/gcc-7.2.0/libgcc/libgcc2.c -fvisibility=hidden
-DHIDE_EXPORTS
In file included from /opt/rpi/sysroot/usr/include/errno.h:28:0,
                  from ../../../../src/gcc-7.2.0/libgcc/../gcc/tsystem.h:93,
                  from ../../../../src/gcc-7.2.0/libgcc/libgcc2.c:27:
/opt/rpi/sysroot/usr/include/bits/errno.h:26:11: fatal error:
linux/errno.h: No such file or directory
  # include <linux/errno.h>

Any idea or suggestion?


Yes. Don't listen to me ;-)
The kernel headers should go to sysroot/usr(include) not sysroot/(include)
You can just move the ones in sysroot/include to sysroot/usr/include and you should be good to go.





[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