On Fri, Jan 24, 2014 at 2:49 AM, Sinan UNAN <[email protected]> wrote: > Hi all, > > I just start to study embedded linux via my beaglebone. I installed debian > wheezy 7.3 on it sd card. Nowadays I am studying cross-compiling with my > board. > > MY HOST Machine is crunchbang waldrof 32bit > Target machine is debian-wheezy-7.3 for beaglebone > > What did I do for cross-compiling up to date is? > > First I installed latest sourcey codebench to my host. And I write basic > hello.c program on my host. I compiled with gcc and run it successfully on > my host. Then I compiled it with my makefile which defines compiler as > arm-none-linux-gnueabi-gcc. > > MAKEFILE is as below > CC=$(CROSS_COMPILE)gcc > hello_world: hello.c > ${CC} -g hello.c -o hello > > > I didn't give any error. then I sent it to my beaglebone card via SSH. When > I tried to run ./hello, it gives erros "no such a file or directory". I was > root user on beagle board and the "hello" file was in the right folder. > > root@arm:/home/hello# ./hello.o > bash: ./hello.o: No such file or directory > > I tried chmod a+x hello. But it doesn't solve the problem. WHAT SHOULD I DO > TO FIX SOURCERY CODEBENCH? > > MY SECOND ATTEMPT: > > On my second attempt I install binutils-arm-none-eabi, gcc-arm-none-eabi, > g++-arm-none-eabi from debian testing repository (jessie). I changed my make > file to use arm-none-eabi-gcc compiler. When I tried to compile it, it gives > error: cant find stdio.h > > sinanyus@crunchbang:~/workspace/hello$ make CROSS_COMPILE=arm-none-eabi- > arm-none-eabi-gcc -g hello.c -o hello > hello.c:1:19: fatal error: stdio.h: No such file or directory > #include <stdio.h> > ^ > compilation terminated. > make: *** [hello_world] Error 1 > > Yes it tells me its missing, and I should check where it search for stdio.h > > sinanyus@crunchbang:~/workspace/hello$ arm-none-eabi-gcc -v > Using built-in specs. > COLLECT_GCC=arm-none-eabi-gcc > COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-none-eabi/4.8.2/lto-wrapper > Target: arm-none-eabi > Configured with: ../gcc-4.8.2/configure --build=i486-linux-gnu --prefix=/usr > --includedir='/usr/lib/include' --mandir='/usr/lib/share/man' > --infodir='/usr/lib/share/info' --sysconfdir=/etc --localstatedir=/var > --libexecdir='/usr/lib/lib/gcc-arm-none-eabi' --disable-maintainer-mode > --disable-dependency-tracking --enable-languages=c,c++ --prefix=/usr/lib > --infodir=/usr/share/doc/gcc-arm-none-eabi/info --mandir=/usr/share/man > --htmldir=/usr/share/doc/gcc-arm-none-eabi/html > --pdfdir=/usr/share/doc/gcc-arm-none-eabi/pdf --bindir=/usr/bin > --libexecdir=/usr/lib --libdir=/usr/lib --with-system-zlib --enable-multilib > --disable-decimal-float --disable-libffi --disable-libgomp > --disable-libmudflap --disable-libquadmath --disable-libssp > --disable-libstdcxx-pch --disable-libstdc++-v3 --disable-nls > --disable-shared --disable-threads --disable-tls --disable-plugin > --build=i486-linux-gnu --host=i486-linux-gnu --target=arm-none-eabi > --with-gnu-as --with-gnu-ld --with-headers=no --without-newlib > --with-pkgversion=4.8.2-13+6 --without-included-gettext > --with-multilib-list=armv6-m,armv7-m,armv7e-m,armv7-r CFLAGS='-g -O2 > -fstack-protector --param=ssp-buffer-size=4 -Wformat' > CPPFLAGS=-D_FORTIFY_SOURCE=2 CXXFLAGS='-g -O2 -fstack-protector > --param=ssp-buffer-size=4 -Wformat' FFLAGS='-g -O2' LDFLAGS=-Wl,-z,relro > AR_FOR_TARGET=arm-none-eabi-ar AS_FOR_TARGET=arm-none-eabi-as > LD_FOR_TARGET=arm-none-eabi-ld NM_FOR_TARGET=arm-none-eabi-nm > OBJDUMP_FOR_TARGET=arm-none-eabi-objdump > RANLIB_FOR_TARGET=arm-none-eabi-ranlib > READELF_FOR_TARGET=arm-none-eabi-readelf > STRIP_FOR_TARGET=arm-none-eabi-strip > Thread model: single > gcc version 4.8.2 (4.8.2-13+6) > > So there is no usr/lib/include file on my system but I got usr/include file > which comes with libc-dev. > > CAN I USE usr/include FILES? IF YES HOW SHOULD I CONFIGURE ARM-NONE-EABI-GCC > or MAKEFILE? > OR WHICH PACKAGE SHOULD I INSTALL?
In Debian: "gnueabi" = "armel" "gnueabihf" = "armhf" Aka.. use the correct "gnueabihf" cross compiler.. Regards, -- Robert Nelson http://www.rcn-ee.com/ -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
