LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   What are the processes of porting an application? (https://www.linuxquestions.org/questions/solaris-opensolaris-20/what-are-the-processes-of-porting-an-application-4175690327/)

n00b_noob 02-11-2021 10:58 AM

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.

floppy_stuttgart 02-11-2021 11:41 AM

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?

jlliagre 02-11-2021 07:42 PM

@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.

n00b_noob 02-12-2021 12:59 PM

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?

ondoho 02-13-2021 05:49 AM

Quote:

Originally Posted by n00b_noob (Post 6219555)
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?

ddbtek 01-19-2023 12:03 AM

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

pan64 01-19-2023 02:55 AM

Quote:

Originally Posted by n00b_noob (Post 6219555)
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/)

business_kid 01-19-2023 05:13 AM

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.

dugan 02-05-2023 12:18 PM

Quote:

Originally Posted by n00b_noob (Post 6219555)
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.

jlliagre 02-21-2023 12:30 PM

Quote:

Originally Posted by ddbtek (Post 6405358)
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.

business_kid 02-22-2023 04:20 AM

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


All times are GMT -5. The time now is 11:43 PM.