Even with POSIX functionality in common between the SolarisTM Operating System (Solaris OS) and Linux, and compliance of Linux to the Linux Standard Base (LSB) 2.0, there can still be challenges when porting applications from Linux to the Solaris OS. A porting guide from Sun outlines issues and presents tools to assist with migration.
The guide uses Red Hat Enterprise Linux 3 (RHEL3) and Red Hat Enterprise Linux 4 (RHEL4) as the representative Linux environments.
Solaris 10 OS ships with hundreds of standard Linux commands, tools, utilities and services. These packages are built from the same open source code base that feeds Linux and are distributed as a part of the Solaris companion CD. They can be installed to the directory /usr/sfw. The porting guide provides a list of popular open source tools that are supported in Solaris 10 OS and Linux.
"Given that the Solaris 10 OS already provides a very significant Linux baseline in terms of platform services, commands, tools, libraries and software development environment, the task of porting an application to the Solaris OS then boils down to the actual code that needs to be modified."
The porting issues covered in the guide include:
- Processor Architectural Issues: Little-Endian vs. Big-Endian, Application Data Storage, storage order and alignment, read write structures, 32-bit and 64-bit issues
- Multithreaded programming: Semaphores (implementation details can vary significantly and present porting issues). There is a table that maps between comparable Solaris threads and POSIX threads.
Because Linux programmers often use GNU compilers and Solaris developers have used SunTM Studio compilers, there can be problems when porting an application. Compiler differences are covered in Chapter 4 of the guide, including a table of command-line options that are equivalent between GNU tools and Sun Studio software. Also find a discussion of CVS versus RCS, application building, the make utility, software packaging, the pkgadd format, Linux development tools, CoolThreadsTM tools, graphical applications, porting using the LAMP stack, and memory management.
See the porting guide for full details.
[...read more...]