how to compile c code for vle powerpc using gnu gcc - gcc

i want to compile my c code in vle PowerPc instructions. how can i do so using gnu gcc or codebench csgnu gcc? i tried -eabi=vle but the resulting code did not contain valid vle instructions.
thanx

There are currently the following third-party GCC VLE toolchains available: NXP (S32), Mentro (CodeSourcery) and STM (SPC5-Studio).
Try -mvle

Related

Intel MPI 2019 always using gcc version 4.9.3

Is there a way to specify the GCC version in intel MPI while I use the mpicc command to compile a program?
Working now.
The make the mpicc for Intel MPI to pick a specific gcc I used the option -gcc-name=path/bin/g++.
mpicc -gcc-name=path/bin/g++ text.cpp

gcc cross compilation for powerpc7448

I want to cross compile the gcc for powerpc7448, and after this I want to run one simple program and get the elf from the cross compiled gcc for powerpc7448,I am using the linux OS,could anyone please suggest me the steps, cross compilation gcc for powerpc7448(any link) and what are all the components are required for cross compilation,Thanks in advance.
Try ELDK cross compiler toolchain (linux distributions) for PowerPC:
ftp://ftp.denx.de/pub/eldk/4.2/ppc-linux-x86/distribution/README.html
Check Eldk version 4.2.
Help: https://www.denx.de/wiki/ELDK-5/WebHome
ppc_74xx-gcc from eldk can be used to compile for your platform.
`
$ ppc_74xx-gcc -c myfile.c
`

C code to MIPS assembly using llvm

I'd like translate my c codes to mips assembly using llvm. How can i do it? I'm on Mac. So llc command does not work.
Thanks
The clang on your MacOS system won't compile for mips by default, you'll need to build your own.
You can look here: http://llvm.org/docs/GettingStarted.html for directions on building up llvm.
After that you can use clang to compile C to mips assembly by doing something like:
clang -target mipsel-linux-gnu foo.c -S -o -
which will compile the file "foo.c" to 32-bit mips assembly for the linux operating system and output it to the console.

cannot compile C program with GCC on Mac and -masm=intel

I'm trying to compile a C program that has some inline assembly code in Intel format. I'm using GCC 4.9 (installed via Homebrew) on Mac 10.9, and the compiler flags:
gcc-4.9 -m32 -masm=intel -std=gnu99 get_rating.c
Unfortunately I get an error:
error: -masm=intel not supported in this configuration
I've tried many different combinations of the flags, but I keep getting that error. I can't leave out the -masm=intel flag, because the code I'm trying to compile uses Intel.
How can I compile the program? Is it at all possible on my Mac (version 10.9) or do I need to run a virtual machine?
The GCC docs state that Darwin does not support intel, so it seems you are out of luck with the direct approach. Virtual machine as you suggested, cross compiling, converting the assembler to att, and replacing the assembler with C are among your options - which is best for you you'll have to figure out.
HTH

C/C++ to MIPS Assembly

I know that to compile to assembly, I should use the -Soption with gcc or g++, but how do I get MIPS assembly?
I tried
g++ -march=mips2 dll.c
but that gives the error
dll.c:1:0: error: bad value (mips2) for -march= switch
I saw a suggestion of the compile command mips_gcc, but I can't find how to install that compiler.
I'm using Ubuntu 64-bit, if that helps.
You need a version of gcc that is built as a MIPS cross compiler. You can download the free Mentor/Codesourcery MIPS gnu/gcc cross compilation tool chain from here. This toolchain is available for both Windows and Linux.
After downloading, installing and adding the tool chain to your path you would say:
mips-linux-gnu-g++ -march=mips32r2 -S dll.c
to compile your code to MIPS32R2 assembly.
UPDATE 8/2017:
It looks like Sourcery CodeBench free cross compiler for MIPS is no longer available at Mentor's site.
Try the free toolchain at Imagination's site.

Resources