Rate This Document
Findability
Accuracy
Completeness
Readability

Introduction

The Porting Advisor tool is designed for developers, users, and ISVs' developers of the Kunpeng platform. It is used to migrate x86 Linux software to the Kunpeng Linux system. It can automatically scan and analyze applications and generate guidance reports, greatly improving code porting efficiency.

Table 1 Task description

Task Type

Description

Working Mode

Supported Platform

Source code porting

Architecture source code porting: Checks and analyzes source files in C/C++/ASM/Fortran/Go/interpreted languages, identifies the code to be ported, and provides porting suggestions. It also supports source code editing and one-click code replacement.
  • Checks the C/C++/ASM/Fortran/Go software build project files and provides porting suggestions.
  • Checks the link libraries used by C/C++/Fortran/Go/interpreted language software build project files and provides porting suggestions.
  • Checks the C/C++/ASM/Fortran/Go/interpreted language software source code and provides porting suggestions. The tool supports porting of Fortran source code from the Intel Fortran compiler to the GCC Fortran compiler, and checks of compiler features and syntax extensions.
  • Checks the compatibility of the SO files loaded by the Python/Java/Scala program through the ctypes module.
  • Analyzes some x86 assembly instructions and converts them into equivalent Kunpeng assembly instructions.

CLI, WebUI, VS Code

Kunpeng and x86

SQL migration: Extracts SQL statements and associated statements from the source code, annotations, MyBatis Mapper XML files, and SQL files, assesses SQL compatibility and convert SQL statements, and generates patches.

WebUI, VS Code

Kunpeng

Configuration migration: Scans the configuration file for configuration items such as paths and drivers, and provides modification suggestions.

WebUI, VS Code

Kunpeng

Use Restrictions

Table 2 Use restrictions

Task Type

Description

Build file

  • The Find function in CMake parsing depends on the GCC compilation result. If the tool runs in a Kunpeng environment, CMake cannot successfully parse or detect x86-specific compilation options such as -m64.
  • Makefile supports the shell commands in $(shell shell_command) format, but does not support the build configuration files using shell scripts.

C/C++ code analysis

If the custom macro header files, third-party header files, or some system header files are missing, some macros to be modified may not be identified and accurate modification suggestions cannot be provided.

Intrinsic functions

The tool cannot provide accurate replacement suggestions for more than 130 intrinsic functions related to the Intel coprocessors.

Assembly code

  • The tool cannot provide absolutely accurate modification suggestions in any of the following scenarios:
    • When a function contains parameters, a message will be displayed indicating that the function conversion may fail due to a special structure.
    • When parameters are transferred to a stack, the parameter type is integer by default.
  • Manual conversion is prompted in any of the following scenarios:
    • The goto, call, and ret statements are used.
    • A segment register or a physical register without a value is used.
    • Global symbols are accessed.
    • The bit width of the input and output variables is greater than 128 bits.
    • The number of input and output global variables is greater than 21.
    • The bit width of instructions is different from that of variables.
    • The hybrid Intel and AT&T assembly format is used.
    • A syntax error exists in the assembly.
      NOTE: