LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-11-2021, 10:58 AM   #1
n00b_noob
Member
 
Registered: Sep 2020
Posts: 436

Rep: Reputation: Disabled
Post What are the processes of porting an application?


Hello,
If someone wants to porting an application from an operating system to another operating system, then he\she must rewrite that program from scratch?
I'm thankful if users share their experiences.

Thank you.
 
Old 02-11-2021, 11:41 AM   #2
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
I would say, have a look first in the language the application is written and if the same language is available in the target system. Then adapt. What application do you mean? a python / Cpp / .. in linux and move it to Windows?
 
Old 02-11-2021, 07:42 PM   #3
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
@floppy_stuttgart I don't think the OP has porting from Linux to Windows in mind, given the fact the question is asked in the Solaris forum.

@n00b_noob No, the very idea of porting software from an OS to another OS is precisely to avoid rewriting all from scratch. Porting code means adapting the non portable portion of the source code to the target environment. Depending on how different the APIs and libraries are between the original and new system, some parts might need to be fully rewritten from scratch, or left out.
 
1 members found this post helpful.
Old 02-12-2021, 12:59 PM   #4
n00b_noob
Member
 
Registered: Sep 2020
Posts: 436

Original Poster
Rep: Reputation: Disabled
Application written in C.
In Linux, I extracted it and run "./configure" file, but on Solaris, must I do the same processes and when I get any error then try to fix it?
 
Old 02-13-2021, 05:49 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by n00b_noob View Post
Application written in C.
In Linux, I extracted it and run "./configure" file, but on Solaris, must I do the same processes and when I get any error then try to fix it?
Have you tried?
 
Old 01-19-2023, 12:03 AM   #6
ddbtek
LQ Newbie
 
Registered: Oct 2010
Location: United States of America
Distribution: rhel, suse, centos, etc.
Posts: 10

Rep: Reputation: 3
Talking porting software from one OS to another is not typically feasible because of link-loader and binary incompatibilities

Hello,

Typically you cannot "port" software between dissimilar operating systems because dependencies in dynamically (runtime) linked libraries and the actual construction of the binary executable itself is incompatible.

The only case I know of where this true binary compatibilities, external libraries, etc., is between the SCO UNIX x86 environment and the Solaris x86 environment. Apparently Solaris x86 is actually SCO UNIX x86 and has full binary compatbility including linked libraries via the loader/linker.

I've written compilers, interpreters, operating systems and advanced communication platforms on dozens of operating systems.

Thanks,
David
 
Old 01-19-2023, 02:55 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,789

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
Quote:
Originally Posted by n00b_noob View Post
Application written in C.
In Linux, I extracted it and run "./configure" file, but on Solaris, must I do the same processes and when I get any error then try to fix it?
the "portability" depends on the code itself, in simple cases you can just try to build it and fix the errors. In difficult cases probably you need to rewrite part of the code and also the build system (makefiles or whatever is used). There is no general answer.
What kind of Solaris is it and what kind of software is it? (by the way a lot of linux tools are already ported to Solaris, there was a sunfreeware.net site, but it is now http://unixpackages.com/)
 
Old 01-19-2023, 05:13 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,251

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
You might get some pointers from the guys at slackware Arm, but you will probably find bits of code that worked just fine on the Sparc CPU but puke on x86_64. Likewise there will be differences in the toolchain. Joerg Schilling(sp?) the maintainer of cdrtools used to give long rants on the inferiority of the linux libc on the LKML and in the cdrtools documentation. I imagine the fact that all users of cdrtools were linux users gave him headaches.
 
Old 02-05-2023, 12:18 PM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by n00b_noob View Post
Application written in C.
In Linux, I extracted it and run "./configure" file, but on Solaris, must I do the same processes and when I get any error then try to fix it?
That's typically how it's done, yes.
 
Old 02-21-2023, 12:30 PM   #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
Quote:
Originally Posted by ddbtek View Post
Typically you cannot "port" software between dissimilar operating systems because dependencies in dynamically (runtime) linked libraries and the actual construction of the binary executable itself is incompatible.
You seem to be confusing porting and running. You run binaries but you port code. Porting is the process to adapt source code and possibly build utilities to the target environment. Sometimes, no change is required and a simple recompilation is sufficient, but fully portable code is rarer and rarer. POSIX was an attempt to allow portability but isn't a thing developer take into account that much nowadays.

Quote:
The only case I know of where this true binary compatibilities, external libraries, etc., is between the SCO UNIX x86 environment and the Solaris x86 environment. Apparently Solaris x86 is actually SCO UNIX x86 and has full binary compatibility including linked libraries via the loader/linker.
Solaris 10 for x86 used to provide binary compatibility with Linux in its early days (lx branded zones), but that didn't last because the supported kernel was too old and 32 bit only. This is similar to Windows WSL1 that allows running Linux binaries on top of a Windows kernel without using at all an actual Linux kernel.
 
Old 02-22-2023, 04:20 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,251

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
n00b_noob, you should state what you are trying to do. Then comments can deal with your problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Porting and tuning applications for Linux on Power, Part 2: 15 Porting and tuning tools for Linux on Power LXer Syndicated Linux News 0 05-18-2018 01:05 PM
porting Window Application to Linux sjcoder Programming 3 12-18-2005 04:48 PM
Porting Solaris Application to Linux CaptainRon Solaris / OpenSolaris 5 10-01-2005 02:29 AM
Huge Porting application question el_scrub Programming 5 06-10-2004 06:05 AM
Porting win32 application into Linux sergeyy Linux - Software 1 06-23-2003 08:57 AM

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

All times are GMT -5. The time now is 12:02 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