LinuxQuestions.org
Help answer threads with 0 replies.
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 08-06-2003, 10:31 AM   #1
Garfalala
LQ Newbie
 
Registered: Aug 2003
Location: NA
Posts: 4

Rep: Reputation: 0
Question Compilation compatibility between Linux and Solaris


A collaborator sent me an executable binary of a C++ program compiled under Solaris SunOS 5.8 but it seems to be impossible to run it under my station which is under Red Hat 9.0.

Is there any solution to make it compatible ?

Thanks for all replies.
 
Old 08-06-2003, 01:37 PM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You'll need to recompile it on a Linux system or use a cross-compiler.
 
Old 08-07-2003, 03:26 AM   #3
fishsponge
Member
 
Registered: Apr 2003
Location: Cambridge, UK
Distribution: Debian/Solaris
Posts: 147

Rep: Reputation: 15
the reason for this is a combination between the binary executable format, and the CPU architecture used... here are the file types for the same binary executable on x86 Debian Linux and SPARC Sun Solaris 9:
Code:
bash-2.05$ uname -a
SunOS sr-egmp03-02 5.9 Generic_112233-05 sun4u sparc SUNW,Sun-Fire
bash-2.05$ file ypcat
ypcat:          ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
bash-2.05$
Code:
hobbs@turnip:/usr/bin$ uname -a
Linux turnip 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i686 unknown
hobbs@turnip:/usr/bin$ file ypcat
ypcat: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped
hobbs@turnip:/usr/bin$
you can see that Solaris uses:

"ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped"

...and debian uses:

"ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, stripped"

different formats...
 
Old 08-07-2003, 03:33 AM   #4
Garfalala
LQ Newbie
 
Registered: Aug 2003
Location: NA
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for the details, fishsponge. I suspected this was this kind of problem. I just thought there was a way to get through this. Never mind, I'll try to get the source, now !
 
Old 08-07-2003, 04:10 AM   #5
fishsponge
Member
 
Registered: Apr 2003
Location: Cambridge, UK
Distribution: Debian/Solaris
Posts: 147

Rep: Reputation: 15
cool... thanks to stickman too, as it was him/her who provided the actual answer
 
  


Reply



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
openssh compilation solaris simquest Linux - Software 5 04-27-2007 09:09 AM
Program compatibility between solaris and Linux?? jimmey Programming 6 06-24-2005 02:45 AM
Compilation compatibility between Linux and Solaris Garfalala Linux - Software 0 08-06-2003 10:23 AM
Linux+Solaris : How can Linux login tu Solaris alnizam Solaris / OpenSolaris 2 06-04-2003 01:06 PM
Linux+Solaris : How can linux login to Solaris alnizam Linux - Software 2 05-28-2003 10:39 PM

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

All times are GMT -5. The time now is 07:29 PM.

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