LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 05-31-2009, 10:36 AM   #1
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14

Rep: Reputation: 0
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
 
Old 06-01-2009, 03:12 AM   #2
Mr-Bisquit
Member
 
Registered: Feb 2009
Distribution: FreeBSD, OpenBSD, NetBSD, Debian, Fedora
Posts: 770
Blog Entries: 52

Rep: Reputation: 68
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.
 
Old 06-01-2009, 05:09 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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/
.....

Last edited by knudfl; 06-01-2009 at 06:21 AM. Reason: virtual box was removed
 
Old 06-01-2009, 05:55 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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.
 
Old 06-01-2009, 06:19 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Sorry, my mistake.

Qemu + Sun xVM Server are mentioned here
http://en.wikipedia.org/wiki/Compari...rtual_machines

.....
 
Old 06-01-2009, 07:11 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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
 
Old 06-02-2009, 03:30 AM   #7
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlliagre View Post
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
Well, I need this linux in order to use it with Sun's SAM simulation for the OpenSparc T2 machine - and correct me if I'm wrong here, but that's a 64-bit machine, so 32-bit architecture isn't good enough for me.

Thanks,
Mintz Yuval
 
Old 06-02-2009, 06:27 PM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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 ?
 
Old 06-03-2009, 01:29 AM   #9
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlliagre View Post
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 ?

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
 
Old 06-03-2009, 02:34 AM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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.
 
Old 06-04-2009, 01:48 AM   #11
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14

Original Poster
Rep: Reputation: 0
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

Last edited by mintzyuval; 06-04-2009 at 01:50 AM.
 
  


Reply

Tags
sparc



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Info on compiling Solaris kernel algernon_z Solaris / OpenSolaris 1 03-15-2007 12:17 AM
Help compiling Flex on Solaris 5.9 bx.s Solaris / OpenSolaris 5 08-14-2006 07:41 PM
Problem Compiling in Solaris x86 Koven Solaris / OpenSolaris 1 01-13-2006 01:05 AM
[SOLVED] Problems compiling Linux apps on Solaris 10 spook2 Solaris / OpenSolaris 4 03-12-2005 10:12 AM
compiling and configuring sendmail on solaris 9 linux_ub Linux - Networking 1 11-09-2004 04:17 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 05:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration