| Issue Type | Description | Root Causes | Strategy | Example Link |
|---|---|---|---|---|
| Type A | CPI issues caused by system library and runtime environment discrepancies between OpenHarmony and Linux | Inconsistent Native API Availability | Address incompatible APIs by (1) supplementing equivalent alternative APIs from musl/OpenHarmony kernel (2) implementing the APIs within *.patch files | HDiffPatch |
| Divergent Logical Path Encapsulation Conventions | Replace logical header file paths with their corresponding physical file paths | Chipmunk2D | ||
| Non-aligned Filesystem Hierarchy Structures | Employe path remapping by converting the standard FHS hierarchy to OpenHarmony-compatible filesystem hierarchy | cpp-httplib | ||
| Type B | OpenHarmony and Linux have discrepant build system | Compiler-dependent Default Type Signedness Variations | Enforce the signedness of Char type | json-schema-validator |
| ISA-specific Compilation Configuration Mismatches | Incorporate ARM-specific compilation options in build configurations to ensure proper architectural support | cpp-httplib | ||
| Conditional Compilation Branch Inconsistencies | Extend the original OS-detection logic: (1)OpenHarmony-specific macro checks (2)Build system identification | curl | ||
| Differing C/C++ Standard Version Support Thresholds | Specify the version supported by OpenHarmony | MXNet | ||
| Type C | API breaking changes of third-party libraries pre-installed in OpenHarmony and Linux | - | Ensure compatibility by: (1)Replacing incompatible APIs with their OpenHarmony equivalents (2)Implementing missing API implementation in *.patch files | zbar |
Empirical Findings of RQ2 (Adaptation Strategies)
This table presents the empirical findings of RQ2. To understand how developers resolve CPI issues in the *.patch files, we analyzed adaptation code segments and their accompanying documentation from the openharmony-sig/tpc_c_cplusplus repository. For each adaptation, we collected commit logs and related developer notes as evidence. From this, we derived eight adaptation strategies that address all three types of CPI issues identified in RQ1. Effective adaptation requires developers to deeply understand the divergences between OpenHarmony and Linux, along with practical workarounds.