Step 3 porting Solaris to LinuxJava belongs to this category

Source: Internet
Author: User
3. Porting Solaris to LinuxJava belongs to this category-general Linux technology-Linux programming and kernel information. The following is a detailed description. If the application only uses standard language components and standard libraries, and does not have to run under SolarisS on the iSCSI processor, porting is easier. For example, Java applications generally fall into this category. On the other hand, if the application does not use the POSIX service C program on Solaris, or relies on third-party products not available on Linux, it will be much more difficult to migrate data. When porting an application, in many cases, it is better to replace unportable methods and attachments with portability. You will replace the Solaris build tool with the GNU tool and use the POSIX-compatible thread library to replace the corresponding library in Solaris. Because these tools and interfaces can also be found on Solaris, you can continue to use Solaris freely, and even continue to grasp the Solaris market after porting the development platform to Linux.

   Build C/C ++ applications using GNU on Solaris

The GCC (GNU Compiler Collection) Toolkit includes a C Compiler and a C ++ Compiler. Since there are GNU compilers and make utilities in Solaris and Linux, it is relatively easy to use these tools to build applications.

First, download the GNU tool and install it on Solaris. Then, try using the GNU gmake utility instead of the Solaris make utility to build the application. Because the GNU gmake utility is different from the Solaris make Utility, some error messages generated by the GNU gmake utility are displayed based on the components used in your make file. Use the link of the above make tool documentation to identify the problem areas in the make file and adjust the make file accordingly. Once you change the make file to gmake, change the name of the called C compiler from cc to gcc in the make file, change the name of the C ++ compiler from CC to g ++.

Then re-build the application. The error messages that will be encountered during the build process (if any) can be divided into two categories: the command line option problem and the code problem. Identify the messages generated by the differences between the command line options accepted by the GNU and Sun compilers. Except for a few basic options (such as "-c" and "-g"), most of the options accepted by the compiler are different.

Next, you can process the remaining error messages and warning information related to the code. A simple way to process these messages is to capture them in a file and check them one by one. Use the link to the compiler documentation above to understand and handle different problems between compilers. When porting to Linux and linking applications to open-source libraries, pay attention to the licenses and copyrights related to these libraries. New C/C ++ applications will at least be linked to the gnu c/C ++ Runtime Library, which is protected by the GNU "copyleft" license. If the migrated software has a proprietary property and you plan to sell it immediately after building it using the GNU tool, therefore, it is best to carefully understand the terms and conditions stipulated in the GNU General Public License and the GNU General Public License. Once the software is linked to a database protected by these licenses, certain terms and conditions in the GNU license will be applied to your software.

   Build and test applications on Linux

There is an uncommon situation where the transplanted application has an attachment specific to the iSCSI hardware. At this time, the first step becomes an important intermediate stage in the porting process. It enables Solaris developers to familiarize themselves with the Linux environment without giving up the underlying iSCSI hardware and without modifying the specific part of the program specific to the Linux. Download the Linux version that can be run on your Sun hardware, install the operating system, and use the provided GNU tool to re-build the application. Because the application was built using GCC in step 1, therefore, the differences that will be encountered in step 1 will be limited to the differences between the runtime application programming interface (API) between Solaris and Linux.

   Build and test applications for other hardware

In the last step of the migration process, obtain and install Linux on the target hardware you selected. You can directly use Linux servers including IBM intel IA32-based product series (including NetVista, IntelliStation, Netfinity) and IBM eServer xSeries. You can also use Linux for IBM pSeries and zSeries. You can purchase or download the popular Red Hat Linux distribution for x86 at a low price, and it is easy to install and set up on almost any intel processor-based PC. In addition, you must install the compilers and tools to be used.

   Other considerations

System Management in general, managing Linux is almost the same as managing any other UNIX operating system, but there are some differences between some specific commands and tasks. IBM and UNIXGuide have released a comparison chart, these differences are summarized, including not only the differences between Solaris and Linux, but also the differences between AIX and other versions of UNIX. Experienced Solaris System Administrators can fully adapt to Linux without having to spend too much effort.

Source Code management for developers who are currently using Sun Forte TeamWare or SCCS (Source Code Control System, Source Code Control System) on Solaris and want to continue using Source Code management systems like SCCS, they can try to use gnu cssc (Compatibly Stupid Source Control) to open the clone version of SCCS. CVS (Concurrent Versions System) is a popular source code management System in Linux.

There are many common and popular third-party tools, utilities, and libraries on Solaris, which can be used on Linux. Given the increasing popularity of Linux, the number of third-party vendors supporting Linux is growing every day.

64-bit computing Red Hat and many other publishers provide a 64-bit version of Linux for Compaq/DEC Alpha. You can learn more about this Linux on the AlphaLinux Web site. The 64-bit Solaris and 64-bit Linux/Alpha both use the LP64 data model, which can bring good compatibility. Soon, Intel's Apsara 64-bit processor was able to use a 64-bit version of Linux. You can learn more about this Linux on the IA-64 Linux Project Web site, and a Linux that supports the IBM 64-bit PowerPC architecture is under development. Note that although the SuSE Linux/UltraSPARC kernel runs in 64-Bit mode, SuSE Linux/UltraSPARC does not currently support 64-bit user space applications.

The end (Endian) grid, Sun or UltraSPARC processors, stores integers in the Big Endian format. If you want to port your application to a Linux (such as Linux or Intel) version of Little Endian, you must solve any problems related to the end format in the application, the application can run correctly. You can also choose to use Linux/PowerPC, Linux/zSeries, or Linux/iSCSI for applications. These are all big-end platforms other than Linux/Intel.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.