![]() |
Compiling Linux on Solaris
Hey,
I'll try to explain my problem in short: I need to compile a Linux (exact version not too important, using the latest stable branch) binary for the sparc (OpenSparc) architecture. The thing is: 1. I don't have a decent cross compilier from AMD64 -> Sparc that can create the image on a given AMD64 computer (I've tried, the toolchain created an erroneous binary file). 2. The only Sparc-Machine in my disposal has Solaris installed on it. So, when I try to compile linux on the Solaris machine I get several errors, all regarding either defines that don't exist (relocation defines for ARM and MIPS in elf.h header), or are linux specific (for example strsep/asprintf). Although all the errors I've encountered so far are superficial problems that I can correct, I fear I'll encounter many more errors along the way, some of them harder-to-fix than those. Did anyone already managed such a feat (compiling linux on a solaris machine)? if so, could he give me some tips on how he managed it? Thanks, Mintz Yuval |
Have you tried compiling in a VM for the target architecture?
Maybe use a FreeBSD tool? I know it sounds silly buty I am assuming that the compatibility works both ways. |
Some suggestions :
EDIT-EDIT : Set up a VM like Mr-Bisquit said. Install "Debian for Sparc" in the VM. Or install "Debian for Sparc" on a spare harddisk on the Sparc computer. Both options will make it easy to compile your application. Debian for Sparc http://cdimage.debian.org/debian-cd/5.0.1/sparc/iso-cd/ ..... |
These are good guesses, unfortunately as far as I know, unless you have an UltraSPARC T CPU and then could experiment with Linux LDOMs ( http://www.sun.com/servers/coolthreads/ldoms/index.jsp ), there are no virtual machines on top of the SPARC CPU that would support a Linux installation. Virtual-Box is x86/x64 only.
|
Sorry, my mistake.
Qemu + Sun xVM Server are mentioned here http://en.wikipedia.org/wiki/Compari...rtual_machines ..... |
Sun xVM server uses Xen which is x86 only too.
Qemu might work as it is reported to support SPARC in 32 bit mode. http://www.nongnu.org/qemu/status.html |
Quote:
Thanks, Mintz Yuval |
Userland 32 bit binaries run on 64 bit but I'm confused by your reply.
If you want to build a Linux binary in order to run it on a SPARC simulator, that means you already have a Linux OS running on it, do you ? Then why won't you compile that binary on that environment ? Or are you trying to port the lx brand on Sparc ? |
Quote:
I'll try to make things clearer - SAM runs on an AMD64 with solaris installed on it (SAM wouldn't normally compile and run on a system running Linux OS). The linux I want to compile is for usage as a guest OS in the simulation - but I don't have a running Linux OS at this point. Thanks, Mintz Yuval |
So you want to compile the whole linux kernel and Gnu userland, not a single linux binary and boot that kernel on SAM ?
That's quite ambitious. I would suggest to use a real SPARC machine for the builds. You'll probably find some cheap ones on ebay or similar. |
Thanks everybody - I managed to finish the changes in the linux code in order to allow it to compile without its gnu-specific functionality and linux-specific definition on a Sparc Architecture (regarding last reply, I stated I already have a Sparc machine in my disposal, only with solaris on it).
Hope it will go well... If not, I'll install a distribution of linux on a different partition, and compile the code there. Thanks, Mintz Yuval |
All times are GMT -5. The time now is 11:09 PM. |