PDA

View Full Version : How to cross-compile?



scorpio2002
August 23rd, 2007, 09:50 AM
Hi there! I'm looking for a way to build crosstool on my linux box. When I try to build it, I get this errors:


In file included from version.c:33:
/home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/build-glibc/csu/version-info.h:2:1: missing terminating " character
/home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/build-glibc/csu/version-info.h:3:1: missing terminating " character
make[2]: *** [/home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/build-glibc/csu/version.o] Error 1
make[2]: Leaving directory `/home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/glibc-2.3.6/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/glibc-2.3.6'
make: *** [lib] Error 2

Is there a workaround?
Does anybody do cross-compiling on ubuntu? How is it done?

dwhitney67
September 3rd, 2007, 06:12 AM
It appears that you are using Dan Kegel's cross-compiler build tool. You should attempt to contact him directly. Alternatively, you can try making a different version of the cross-compiler using one of the other combinations of gcc and glibc.

Btw, have you examined the version-info.h file? Perhaps it has a simple problem that you can fix yourself.

samjh
September 3rd, 2007, 03:16 PM
Have you looked at this?
http://www.kegel.com/crosstool/current/doc/crosstool-howto.html

winch
September 3rd, 2007, 06:39 PM
Many older versions of glibc have that problem when /bin/sh is dash instead of bash. I believe it's due to differences between how the two shells handle echo. Newer versions of glibc have had the "bashism" removed.

It's easy enough to edit the offending file by hand and add the terminating quotes. Or you can change /bin/sh to point to bash instead of dash.

https://wiki.ubuntu.com/DashAsBinSh has some info on why dash is used and how to switch back to bash.

spcurry
March 19th, 2008, 12:59 AM
I tried editing the offending file by hand and adding the terminating quotes, but this does not work because this file is automatically generated each time the script is run (so any changes I made were just overwritten).

I then changed /bin/sh to point to bash instead of dash, and this appears to have fixed the problem. Thanks winch!

FYI: here are the commands I executed to change /bin/sh to point to bash:
> sudo mv /bin/sh /bin/sh.old
> sudo ln -sf bash /bin/sh

ronaldvalenzuel
August 13th, 2009, 01:26 AM
thanks