As of Ubuntu 18.04 you can do:
sudo apt-get install gcc-aarch64-linux-gnu
aarch64-linux-gnu-gcc -mcpu=cortex-a53 hello_world.c
The package gcc-aarch64-linux-gnu is at version 4:7.3.0-3ubuntu2
However, for Raspberry Pi, you should just download the official binaries from https://github.com/raspberrypi/tools which is the more reliable way to do it as explained at: https://raspberrypi.stackexchange.com/questions/64273/installing-raspberry-pi-cross-compiler/83215#83215
Finally, for bare metal, I was not able to find the analogue of arm-none-eabi-gcc, I wonder why: https://github.com/cirosantilli/cirosantilli.github.io/issues/68
Videos
As of Ubuntu 18.04 you can do:
sudo apt-get install gcc-aarch64-linux-gnu
aarch64-linux-gnu-gcc -mcpu=cortex-a53 hello_world.c
The package gcc-aarch64-linux-gnu is at version 4:7.3.0-3ubuntu2
However, for Raspberry Pi, you should just download the official binaries from https://github.com/raspberrypi/tools which is the more reliable way to do it as explained at: https://raspberrypi.stackexchange.com/questions/64273/installing-raspberry-pi-cross-compiler/83215#83215
Finally, for bare metal, I was not able to find the analogue of arm-none-eabi-gcc, I wonder why: https://github.com/cirosantilli/cirosantilli.github.io/issues/68
You can try my Latest Pre-Built Open-Sourced GCC Toolchains for Raspberry Pi from this Github Project:
This Project Summary: This project contains the UpToDate set of Precompiled/Pre-Built Raspberry pi GCC Cross & Native Compilers Binaries, saving your tons of time(No compiling or Error Handling needed whatsoever). Just Extract, Link & Enjoy complete GCC(Raspberry Pi) functionality in your Machine. You can use its native compilers for Raspberry Pi(Can be used along with old & slow 6.3.0 GCC), Or use the Cross-Compiler in any Linux Machine(Tested on Latest Ubuntu/bionic x64) to compile programs for your Raspberry Pi. All these compilers binaries are Raspberry Pi hardware optimized for enhanced overall performance.
The Supported GCC Versions are:
- GCC 6.3.0
- GCC 7.4.0
- GCC 8.2.0
- GCC 8.3.0
Supported Environments:
- Cross-Compiler: All Linux Distros (x32/x64) are currently supported.
- Native-Compiler: All Raspberry Pi version/model with Raspbian OS is supported. Other OS may/may-not work.
Hope that helps! :)
So i have an aarch 64 Chromebook it is a Lenovo idea pad 3 and im looking to put linux on it, i was wondering if there was anyway to get linux on an aarch64 because so far i cant find a way to get linux. (i dont want to use rasberry pi).
thank you