gcc cross compilation for powerpc7448 - gcc

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
`

Related

g++ with -m32 --coverage profile .gcda: Cannot open

When I'm trying to compile my C/C++ software using gcc/g++ with -m32 option on RedHat 6.10 which is a 64bit OS, we have a Dell isilon file system exporting 64 bit file ID's we get a run-time error using code coverage compile options. I wrote a simple main() test app test.cpp and compile with the following compile options.
g++ --coverage -m32 test.cpp -o test
When I run the 32bit executable we get a run-time error relating to our file system exporting 64bit file ID's vs 32 bit. We don't want to change to a 32bit file ID export.
./test
profiling:test.gcda: Cannot open
If we compile the app without the -m32 option the problem goes away. However, I need to compile with -m32 for other reasons outside the scope of this discussion.
gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
RedHat 6.10 64bit OS
Thank you for any help.
It appears that a later version of gcc has fixed this problem. I now know that gcc version 8.2.0 compiles properly and doesn't have the error about not being able to find the .gcda file. This makes sense since the Dell isilon system is newer and the gcc compiler version we've been using with RedHat 6.10 is quite old.

How to change compiler of OpenMPI

I have OpenMPI which is using gcc to compile. I need to cross compile from an x86_64 host architecture to an aarch64 target architecture. Instead of using gcc to compile, I want to use aarch64-linux-gnu-gcc to cross compile.
Anyone know how to change the compiler from gcc to aarch64-linux-gnu-gcc?
Thanks in advance.
openmpi allows using their mpi-wrappers (i.e., mpicc, mpic++, ...) with a different compiler by specifying:
OMPI_CC=COMPILER_NAME_OR_PATH
OMPI_CXX=COMPILER_NAME_OR_PATH
e.g.,
OMPI_CC=clang
OMPI_CXX=clang++
or
OMPI_CC=/usr/bin/gcc-11
OMPI_CXX=/usr/bin/g++-11
In some cases, you might need to export these variables by prepending the export keyword.

How to cross compile solaris 32-bit

We are currently building our Go executables for several platforms including Solaris 64-bit. We have requests for a 32-bit Solaris executable version as well and I am unable to get this to work (the person who setup the Solaris 64-bit cross compiler is gone and unreachable).
I tried just setting -m32 flag on go build using our existing solaris cross compilation, but that didn't work, so I am attempting to build a Solaris 32-bit specific cross compiler.
I googled and found some vague examples, so I am following this process:
Copy headers and libraries from a 32-bit Solaris machine to my Linux build machine.
D/L and build binutils and gcc pointing SYSROOT to the downloaded 32-bit Solaris headers and libraries where:
$TARGET=sparc-sun-solaris2.10
$SYSROOT=/path/to/solaris32/includes
$PREFIX=/path/to/gcc-output
binutils-2.31/configure -target=$TARGET --prefix=$PREFIX -with-sysroot=$SYSROOT -v
gcc-8.2.0/configure --target=$TARGET --with-gnu-as --with-gnu-ld --prefix=$PREFIX -with-sysroot=$SYSROOT --disable-libgcj --enable-languages=c,c++,go -v
Create a symlink to gogcc and put GCC on the path
Compile a trivial test go program like this:
go build --compiler gccgo --gccgoflags "-m32 -O3 -static-libgo -Wl,-dy -lnsl -lsocket -lrt -lsendfile" -o ${GOTOOLS}/${BINARIES}/${PROJECT_NAME}/test/solaris_sparc32 test/main.go
This fails as follows:
go build: when using gccgo toolchain, please pass compiler flags using -gccgoflags, not -gcflags
command-line-arguments
gccgo: error: may not use both -m32 and -m64
Clearly I don't know what I'm doing. Can anyone point me in the right direction?
Solaris 32-bit does not appear to be supported, according to the list of supported OS/arch targets:
The valid combinations of $GOOS and $GOARCH are:
$GOOS $GOARCH
...
solaris amd64
...
That is, Solaris 64-bit is explicitly listed as a supported platform but Solaris 32-bit is not listed.
As such, there is good reason to believe that go programs will not run reliably on Solaris 32-bit systems and you probably should not agree to support that platform (if you do happen to get that cross compilation working) mainly because the go team itself does not support it!

Build gcc for running on arm

I have some issue with Linaro gcc. Durig build arm image gcc package was included. But as result gcc command work but there are no headers and no crtl1.o.
Could someone suggest me how build image with full working gcc toolchain for arm.
P.S. I don't need crossplatform compiler on linux target. It should be working gcc on arm platform (on board).

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