How I can get a cross compiler under Ubuntu for sparc target?
I want to compile my c and c++ program, working in Ubuntu, for sparc architecture? How i can do this? Can I use mingw32 cross compiler?
You need to compile a gcc cross compiler. The first step is to download the source code for gcc, bin-utils (gnu as, ld, etc), and the standard library for the platform.
Once you have the necessary source code(s) you need to configure, make, and then install the cross compiler without clobbering your host gcc.
./configure --target=$TARGET --prefix=$PREFIX
make
make install
Rinse and repeat for bin-utils. I believe you'll have to pass in the location of the source for the standard library to configure, but I don't know what the argument is. I've just done this for OS dev where you don't really need it. Look into newlib if you're having trouble with this.
$TARGET is obviously the target platform, for you it'll be a string like sparc-elf or sparc64-elf, but it depends.
$PREFIX is where your cross compiler will be located. It will be named something like $TARGET-gcc. So this is optional, just make sure it ends up on your path.
http://www.netgull.com/gcc/releases/gcc-4.6.2/
http://ftp.gnu.org/gnu/binutils/
http://sourceware.org/newlib/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With