DEV Community

Zhou Jiang
Zhou Jiang

Posted on

i.MX6ULL Porting Log 01: How I Fixed a 404 Error and Set Up the ARM Cross-Compiler

The Goal

Set up the ARM cross-compiler for the i.MX6ULL bring-up project.

This project will later test a more modern Ubuntu 22.04 userland on an old i.MX6ULL BSP flow.
But before that, I first needed a working ARM compiler on my Ubuntu 22.04 host.

The Problem

My host machine is x86, but the target board is ARM.
So I need a cross-compiler to build ARM binaries.

At first, this looked simple.
But the real work started with an old download link and a 404 error.

The Fix
Step 1: Install the basic packages

I first installed the common build tools and libraries:

sudo apt-get update
sudo apt-get install -y make gcc g++ build-essential libncurses5-dev bison flex libssl-dev lzop git wget libusb-1.0-0-dev net-tools

This step completed normally.

Step 2: The old Linaro link was dead

I tried this old toolchain link first:

sudo wget https://releases.linaro.org/components/toolchain/binaries/8.3-2019.03/arm-linux-gnueabihf/gcc-linaro-8.3.0-2019.03-x86_64_arm-linux-gnueabihf.tar.xz

The result was:

404 Not Found

So the problem was not my command.
The old resource was no longer available.

Step 3: Download from the ARM official site

Then I switched to the ARM official download URL:

sudo wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
Enter fullscreen mode Exit fullscreen mode

This worked.

Step 4: I made a real naming mistake

After the download, I still used the old gcc-linaro... name in my extract command.

That failed because the real file name was already changed to gcc-arm....

So I checked the directory with ls -l, then used the real file name:

sudo xz -d gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
sudo tar -xvf gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar
Step 5: The PATH was wrong at first

I also wrote the wrong path in ~/.bashrc at first.
I used the old gcc-linaro... folder name.

Because of that, this command failed:

arm-linux-gnueabihf-gcc -v
Enter fullscreen mode Exit fullscreen mode

The real reason was simple:

the compiler was extracted
but my PATH pointed to a folder that did not exist

Then I fixed the PATH:

export PATH=$PATH:/usr/local/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin
Enter fullscreen mode Exit fullscreen mode

Step 6: Remove one extra shell noise

I also saw this message when running source ~/.bashrc:

/home/zhou/.openclaw/completions/openclaw.bash: No such file or directory

This was not the main compiler problem, but it added noise.
So I commented it out first and kept the shell clean.

The Test

After fixing the PATH, I ran:

source ~/.bashrc
arm-linux-gnueabihf-gcc -v
Enter fullscreen mode Exit fullscreen mode

The result was:

gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))

That means the cross-compiler was ready.

The Debug Log
Issue 1: The old Linaro download link returned 404 Not Found
Fix: Switched to the ARM official toolchain download URL
Issue 2: I still used the old gcc-linaro... name in the extract command
Fix: Checked the real file name with ls -l and used gcc-arm...
Issue 3: The PATH in ~/.bashrc pointed to the wrong folder
Fix: Updated the PATH to the real extracted directory
Issue 4: One unrelated shell completion file was missing
Fix: Commented it out to reduce shell noise
What I Learned

This level was not only about installing a compiler.

It taught me one important lesson:

In low-level work, a wrong path name can stop the whole chain.

Sometimes the big problem is not the theory.
It is just that one real thing in the system does not match the real state on the machine.

Top comments (0)