跳到主要导航 跳到搜索 跳到主要内容

Cross2OH: Enabling Seamless Porting of C/C++ Software Libraries to OpenHarmony

  • Qian Zhang
  • , Tsz On Li
  • , Ying Wang*
  • , Li Li
  • , Shing Chi Cheung
  • *此作品的通讯作者
  • Northeastern University China
  • Hong Kong University of Science and Technology

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

OpenHarmony is a new mobile operating system that offers a popular alternative to Android and iOS. To support its adoption, significant efforts have been devoted to porting C/C++ libraries from Linux to OpenHarmony. However, this porting process presents unique challenges due to the fundamental architectural differences in system libraries, runtime environments, and build systems between the two platforms. These discrepancies manifest as Cross-platform Incompatibility (CPI) issues during cross-compilation, which are particularly difficult to resolve for two key reasons. First, conventional cross-compilation toolchains provide only brief error messages that offer inadequate diagnostic information for CPI issues. Second, resolving these issues requires a deep understanding of cross-platform discrepancies, yet comprehensive documentation or systematic guidelines about such Linux-to-OpenHarmony differences remain largely unavailable.In this experience paper, to assist developers in addressing these challenges, we conducted an empirical study on 92 C/C++ libraries successfully ported to OpenHarmony. Through manual step-by-step reproduction of all CPI issues, our study reveals that discrepancies between Linux and OpenHarmony can be divided into three categories, and CPI issues can manifest through eight dimensions. Furthermore, we identified eight common adaptation strategies for resolving CPI issues. Based on these findings, we present Cross2OH, an automated technique for porting Linux-based software to OpenHarmony. Our approach combines: (1) an adaptation knowledge base (derived from RQ1 and RQ2 findings) and (2) a static analysis approach to detect and patch eight types of CPI issues. Evaluation using real developer patches shows Cross2OH achieves 0.94 recall and 0.91 precision in resolving CPI issues. Notably, Cross2OH enables successful cross-compilation for 40 critical libraries (including dependencies for popular Android apps such as WeChat, Microsoft Excel, Bilibili), with 29 of them passed official OpenHarmony review. The evaluation results demonstrate Cross2OH's potential to streamline the porting process and foster the growth of the OpenHarmony software ecosystem.

源语言英语
主期刊名Proceedings - 2025 40th IEEE/ACM International Conference on Automated Software Engineering, ASE 2025
出版商Institute of Electrical and Electronics Engineers Inc.
1744-1755
页数12
ISBN(电子版)9798350357332
DOI
出版状态已出版 - 2025
活动2025 40th IEEE/ACM International Conference on Automated Software Engineering, ASE 2025 - Seoul, 韩国
期限: 16 11月 202520 11月 2025

出版系列

姓名Proceedings - 2025 40th IEEE/ACM International Conference on Automated Software Engineering, ASE 2025

会议

会议2025 40th IEEE/ACM International Conference on Automated Software Engineering, ASE 2025
国家/地区韩国
Seoul
时期16/11/2520/11/25

指纹

探究 'Cross2OH: Enabling Seamless Porting of C/C++ Software Libraries to OpenHarmony' 的科研主题。它们共同构成独一无二的指纹。

引用此