How can I get cross-compiler under Ubuntu for sparc target?

How can I get cross-compiler under Ubuntu for sparc target?

I want to compile my c and C ++ program running in Ubuntu for sparc architecture? How can i do this? Can I use the mingw32 cross compiler?

+4
source share
5 answers

You need to compile the 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, create, and then install the cross-compiler without merging your gcc host.

./configure --target=$TARGET --prefix=$PREFIX make make install 

Rinse and repeat for bin-utils. I believe that you will need to pass the source location for the standard library to configure, but I do not know what the argument is. I just did it for dev OS where you really don't need it. Take a look at newlib if you are having problems with this.

$ TARGET is obviously the target platform, for you it will be a string such as sparc-elf or sparc64-elf, but it depends.

$ PREFIX is where your cross-compiler will be located. It will be called something like $ TARGET-gcc. So this is optional, just make sure it ends in your path.

http://www.netgull.com/gcc/releases/gcc-4.6.2/

http://ftp.gnu.org/gnu/binutils/

http://sourceware.org/newlib/

+3
source

β€œW” in β€œMingW” means Windows, so you cannot use it.

Check out this page on how to make a version of GCC that cross-compiles into SPARC.

+3
source

Create it yourself from the sources or download ready-made binaries, for example from here or from.

+1
source

You can use one of the cross-compilers from emdebian .

If you get strange errors regarding missing inclusions, you stumbled upon a version that does not depend on kernel headers, in which case you also need to manually install linux-libc-dev-sparc-cross .

+1
source

One of the easiest ways to get a working cross-compiler for Sparc V8 is to use Buildroot. Here is a short tutorial on installing cross-compiler and testing executable files on Qemu emulator.

+1
source

Source: https://habr.com/ru/post/1395234/


All Articles