Oracle® Linux

Porting Guide for Release 6

Oracle Legal Notices

E52461-01

February 2014

Abstract

This guide describes how to resolve common issues that arise when migrating applications to Oracle Linux. It describes potential similarities and differences in architecture, system calls, tools, utilities, development environments, and operating system features. Wherever possible, solutions and workarounds are suggested for addressing porting issues that commonly arise.

Document generated on: 2014-02-17 (revision: 1677)


Table of Contents

Preface
1 Introduction
1.1 Similarities and Differences Between Oracle Linux and UNIX Operating Systems
1.2 Tools and Development Environment
1.3 GNU Utilities, Popular Developer Tools, and Open Source Software
1.4 Advantages of Porting to Oracle Linux
2 The Porting Process
2.1 Migration Steps
2.2 Recommended Strategy
2.3 Assessing the Application Porting Effort
2.3.1 Limiting the Scope
2.3.2 Classifying Code
2.3.3 Scripts and Other Portable Components
2.3.4 Build Environment Dependencies
2.3.5 Assess Food Chain Dependencies
2.4 Data Migration Considerations
2.4.1 Data Portability, Well-Known Issues, and Solutions
2.5 Verifying Applications
2.5.1 Using Gcov to Analyze Code Coverage
2.5.2 Using Valgrind to Detect Memory Access Errors and Leaks
3 Operating System Considerations
3.1 Storage Order and Alignment
3.2 Data Structures and Sizes
3.3 Compiler Options and Portability of Code
3.4 Byte Ordering
3.5 Data Conversion for Interoperability
3.5.1 Low-Level Code, Bit-Level Operations
3.6 System Call Mapping
4 Application Development Environment
4.1 GNU Compiler Collection
4.2 Oracle Solaris Studio for Oracle Linux
4.3 Optimizing gcc Compilation
4.4 Open Source Software Libraries
4.5 Debugging Applications
4.6 Identifying Issues Using DTrace
5 Threads and Multiprocessing
5.1 POSIX Compliance
5.2 Threading Model
5.3 Differences Between Implementations of Pthreads
5.4 Thread Attributes
5.5 Signals in Threaded Applications
5.6 OpenMP Support
5.7 Auto Parallelization and Compile-Time Optimizations
5.8 Using the Thread Analyzer
6 Migrating Device Drivers
6.1 Considerations for Porting Device Drivers
6.2 Reading and Writing Data from or to User Space
6.3 About Handling Access to Shared Resources
6.4 About the Bus Model
6.5 About Character Device Drivers
6.6 About Block Device Drivers
6.7 About Network Device Drivers
6.8 About USB Device Drivers
6.9 About the Sysfs File System
6.10 Loading Device Drivers as Kernel Modules
7 Security
7.1 Physical Security
7.1.1 Delegate Minimal Privileges as Appropriate
7.1.2 About Discretionary and Mandatory Access Control Policies
7.1.3 About Targeted and Multilevel Security Policies
7.1.4 About Security Contexts and Users
7.1.5 Ensure Strong Defenses
7.1.6 Encryption Algorithms, Mechanisms, and Mapping
8 Runtime Environment
8.1 Runtime Limits
8.2 Migrating Scripts
8.3 Managing Services
9 Pluggable Authentication Modules
9.1 About Pluggable Authentication Module (PAM)
9.2 About PAM Operation for an Application
9.3 PAM Implementation Differences
10 Packaging and Distributing Applications
10.1 About RPM Packaging
10.1.1 About RPM Categories
10.1.2 Administering RPMs
10.1.3 Building an RPM
10.2 About Oracle Enterprise Manager
10.3 About Spacewalk