Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/contributors.csv
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ Yiyang Fan,Arm,,,,
Julien Jayat,Arm,,,,
Geremy Cohen,Arm,geremyCohen,geremyinanutshell,,
Barbara Corriero,Arm,,,,

Jun He,Arm,JunHe77,jun-he-91969822,,
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# User change
title: "Why Code Scanning Matters for Arm Migration"

weight: 2

layout: "learningpathall"

---

### Overview of the Common Arm Migration Challenge

Migrating applications to Arm-based architectures is increasingly common across cloud, data center, and edge environments. Arm-powered servers and instances, such as AWS Graviton processors or Ampere Altra-based systems available on platforms like Google Cloud Platform, Microsoft Azure, Alibaba Cloud and Oracle Cloud Infrastructure (OCI), deliver significant performance-per-watt advantages and compelling cost-efficiency.

However, porting workloads to new CPU architecture often involves more than just recompiling. While many applications transition smoothly, others contain architecture-specific code or dependencies – developed originally for x86 – that can lead to build failures, runtime errors, or performance degradation on Arm systems.

Common challenges include detecting:
* Hardcoded x86 SIMD intrinsics
* Inline assembly
* Platform-specific system calls
* Unsupported compiler flags
* Non-portable build scripts or logic

In large or legacy codebases, these issues are often buried in third-party libraries or auto-generated components, making manual inspection slow and unreliable.

### Automated Analysis for Portability
To address these challenges proactively, automated static analysis tools play a critical role. Tools specifically designed for portability analysis enable developers to scan local codebases or remote repositories (e.g., GitHub) —and pinpoint architecture-specific constructs before attempting compilation or deployment on Arm. By surfacing portability concerns early in the development cycle, code scanning reduces time-to-first-build and helps prevent complex failures later.

In this learning path, we will introduce `migrate-ease`, a tool which allows developers to move beyond trial-and-error debugging. It provides clear, actionable insights into potential portability issues, detecting problematic patterns across many mainstream programming languages. These insights, combined with targeted refactoring, accelerate the process of making code portable, maintainable, and production-ready on Arm.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
# User change
title: "Supported Programming Languages and Common Issues Identified"

weight: 3

layout: "learningpathall"

---

### migrate-ease

This is a fork of [Porting advisor](https://github.com/arm-hpc/porting-advisor), an open source project by the Arm engineering team. Migrate-ease is maintained by the [OpenAnolis](https://github.com/openanolis) Arm Working Group.


It is an innovative project designed to analyze codebases specifically for x86_64 architectures and offers tailored suggestions aimed at facilitating the migration process to aarch64.
This tool streamlines the transition, ensuring a smooth and efficient evolution of your software to leverage the benefits of aarch64 architecture.
At present, this tool only supports codebase migration to Linux. It can be run on Arm or non-Arm based machines. The tool does not modify any code, it does not provide API level recommendations, and it does not send any data back to OpenAnolis.

{{% notice Note %}}
Even though the [migrate-ease](https://github.com/migrate-ease/) project team does the best to identify known incompatibilities, that's still recommend performing appropriate tests on your application before going to Production.
{{% /notice %}}

### List of Supported Programming Languages

This tool scans all files in a source tree, regardless of whether they are included by the build system or not. Currently, the tool supports the following languages/dependencies:

#### C, C++
- Inline assembly with no corresponding aarch64 inline assembly
- Assembly code with no corresponding aarch64 assembly code
- Use of architecture specific intrinsic
- Use of architecture specific compilation options
- Preprocessor errors that trigger when compiling on aarch64
- Compiler specific code guarded by compiler specific pre-defined macros
- Missing aarch64 architecture detection in Makefile, Config.guess scripts
- Linking against libraries that are not available on the aarch64 architecture

#### Go
- Inline assembly with no corresponding aarch64 inline assembly
- Assembly code with no corresponding aarch64 assembly code
- Use of architecture specific intrinsic
- Linking against libraries that are not available on the aarch64 architecture

#### Python
- Inline assembly with no corresponding aarch64 inline assembly
- Use of architecture specific intrinsic
- Linking against libraries that are not available on the aarch64 architecture
- Use of architecture specific packages

#### Rust
- Inline assembly with no corresponding aarch64 inline assembly
- Use of architecture specific intrinsic
- Linking against libraries that are not available on the aarch64 architecture

#### Java
- JAR scanning
- Dependency versions in pom.xml file
- A feature to detect native calls in Java source code
- Compatible version recommendation

#### Dockerfile
- Use of architecture specific plugin
- The base image that dockfile is based on does not support aarch64

Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
# User change
title: "Installing and Running Code Analysis Tools"

weight: 4

layout: "learningpathall"

---

# migrate-ease

[migrate-ease](https://github.com/migrate-ease/migrate-ease) is an open-source project designed to analyze codebases specifically for x86_64 architectures and offers tailored suggestions aimed at facilitating the migration process to AArch64. This tool streamlines the transition, ensuring a smooth and efficient evolution of your software to leverage the benefits of aarch64 architecture.

## Pre-requisites
Before you use migrate-ease, certain pre-requesites need to be installed.
{{< tabpane code=true >}}
{{< tab header="Ubuntu 22.04">}}
sudo apt-get install -y python3 python3-pip python3-venv unzip libmagic1 git
{{< /tab >}}
{{< tab header="Debian trixie">}}
sudo apt-get install -y python3 python3-pip python3-venv unzip libmagic1 git
{{< /tab >}}
{{< tab header="Fedora 42">}}
sudo dnf install -y python3 python3-pip unzip git
{{< /tab >}}
{{< /tabpane >}}

## Install and setup
```bash

# Check out the project
git clone https://github.com/migrate-ease/migrate-ease

# Check the project folder
cd migrate-ease

# Make sure you're at the root directory of migrate-ease
# Enable Python Environment
python3 -m venv .venv
source .venv/bin/activate

# install python packages dependencies
pip3 install -r requirements.txt
# Setup environment
export PYTHONPATH=`pwd`
```

## Usage
### As Python script

User can scan a project with a scanner type and the result is sent to console by default.
```bash
python3 -m {scanner_name} --arch {arch} {scan_path}
```
Scan result can be exported as one of txt, csv, json or html.

To generate a JSON report:
```bash
python3 -m {scanner_name} --output {result_file_name}.json --arch {arch} {scan_path}
```

**Parameters**

`{scanner_name}`: The name of the scanner, which can be one of cpp, docker, go, java, python, rust.

`{result_file_name}`: The name of the export result file (without the extension).

`{arch}`: The architecture type, `aarch64` is the default.

`{scan_path}`: The path to the code that needs to be scanned.

User can scan a git repository as well by given the URL.
```bash
python3 -m {scanner_name} --output {result_file_name}.json --arch {arch} --git-repo {repo} {clone_path}
```
In the case of git repository scan, `{clone_path}` is a directory to hold the cloned code. This directory should be empty or to be created.

There are more parameters for user to control the scan behaviors. To get these information user can get the built-in help
```bash
python3 -m {scanner_name} -h
```

### As Web UI
Migrate-ease also provides a Web UI that supports scanning a git repo with cpp, docker, go, java, python and rust scanners in one time.
To start the web server, simply run:
```
python3 web/server.py
```

Once that is successfully done, you can access a web server hosted at http://localhost:8080

The web UI looks as following:
![example image alt-text#center](web_ui_index.jpg "Figure 1. Web UI to scan a git repo")

A git repo URL is required, and you can specify certain branch name to scan. Once the necessary information is filled, user can click "START SCAN" button to proceed project scanning.

Scanning progress will be shown in the console pane. Once all jobs are done, user will see a web page as following:
![example image alt-text#center](web_ui_result.jpg "Figure 2. Web UI of scan result")

You can download the result by clicking the "download" icon or view the result by clicking the "eye" icon.
Loading