How to compile a program using gcc for linux ( Kernel 2.6.9 )-ppc architecture from a freeBSD based x86 machine?
How to compile a program using gcc for linux ( Kernel 2.6.9 )-ppc architecture from a freeBSD based x86 machine?
You'd have to get the gcc and binutils source code onto your machine, and then use ./configure to set up the processor and OS architectures for the cross compiler.
There's a bunch of options for gcc's configure documented here: http://gcc.gnu.org/install/configure.html
The ones you want would include:
For compilation speed, you may want to use:Code:--prefix=<somedir> // To put your compiler in a specific place different from where a new native compiler goes. --with-cpu=cpu (ppc variant)
That way, it doesn't compile the Fortran, ADA, Java, Pascal and whatever other languages it may support.Code:--enable_languages=C,C++
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
A tried a large varity of combinations of the options and I can't build it, i will need moore specific help. I wasted too many days. Is any crosscompiler ready out of the box for ppc
I do suspect that gcc by default on openBSD will cross compile.
you would have to have a makefile that xplicitlye requires an executable for the target platform though.
Originally Posted by Jeff Henager
"xplicitlye" -> "explicitly" [Just thought I'd mentioned this because I couldn't figure it out at first.]
Perhaps -- but to PPC? (You know -- Apple.)I do suspect that gcc by default on openBSD will cross compile.
If you can't get it to work, you might be able to use an emulator such as VirtualBox to emulate the PPC system, and run GCC on that. I've never tried this, but it might work.
Do you actually have access to a PPC system? If so, there are lots of ways you could do this, not to mention simply SSH'ing to the PPC machine (assuming the computers are networked) and compiling from there. At the least, you could copy the PPC machine's installation of GCC onto your FreeBSD one and use an emulator from there. (This is assuming that the PPC computer, if it even exists, has a compiler installed.)
[edit] You want more specific instructions? Give more specific descriptions of what went wrong. Did you get an error from make? Did GCC build, but just not compile anything? Perhaps it built and works, but actually generates FreeBSD executables?
There's lots of stuff around about this sort of thing. Keep looking.
- http://www.google.ca/search?hl=en&q=...G=Search&meta=
- http://vmlinux.org/crash/mirror/www.objsw.com/CrossGCC/
- http://www.google.ca/search?hl=en&q=...G=Search&meta=
- http://www.sable.mcgill.ca/~dbelan2/...erpc-i686.html
- http://sources.redhat.com/ml/crossgc.../msg00023.html
[/edit]
Last edited by dwks; 07-02-2008 at 01:13 PM.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
thanks dkws, my bad laptop keyboard used for that post.
[ way to low a pressure for a keystroke ]
ppc virtualization is problematical.
I have watched someone testing it with every vm tool he can get and they all fail in some fashion for usable ppc system.
and yup, you will get ppc as a build option if you have cross compiling supported.
Originally Posted by Jeff Henager