How to Set Up an ARM Cross‑Compilation Environment on x86 Servers

This guide explains how to build an ARM GCC cross‑compilation toolchain on non‑ARM (x86) servers, covering environment preparation, toolchain download, installation steps, environment variable configuration, and testing the compiled binaries on a Kunpeng cloud server.

Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
How to Set Up an ARM Cross‑Compilation Environment on x86 Servers

Introduction

Cross‑compilation means generating executable code for a target platform on a different host platform. This guide focuses on setting up an ARM GCC toolchain on a non‑ARM server to compile applications for ARM architecture.

Environment

Prepare the cross‑compilation environment by installing and configuring the toolchain. The compiled binaries will run on a Kunpeng elastic cloud server.

Category

Version

Configuration

Notes

ARM test server

CentOS 7.5

kc1.large.2 | 2vCPUs | 4GB

Purchase from Huawei Cloud

x86 compile server (CentOS)

CentOS 7.5

2vCPUs | 4GB | s3.large.2

Purchase from Huawei Cloud or deploy locally

x86 compile server (Ubuntu)

Ubuntu 16.04

2vCPUs | 4GB | s3.large.2

Purchase from Huawei Cloud or deploy locally

Cross‑compiler

arm-linux-gcc

5.5.0

Download link

Cross‑Compiler Installation (x86 Server)

3.1 Install Standard C Development Environment

3.2 Create ARM‑toolchain Directory Under /usr/local

3.3 Download gcc‑linaro‑5.5.0‑2017.10‑x86_64_aarch64‑linux‑gnu.tar.xz

You can download it with wget or manually from the Linaro releases page.

After download, extract the tarball.

3.4 Configure Environment Variables

3.5 Verify Environment Variables and Test

Cross‑Compilation on x86 Server

4.1 Build on x86 Server

4.2 Test Execution

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxARMToolchaingccEnvironment setupcross-compilation
Huawei Cloud Developer Alliance
Written by

Huawei Cloud Developer Alliance

The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.