Bare-metal ARM compiler on Archlinux Arm

Problems with packages? Post here, using [tags] of the package name.

Bare-metal ARM compiler on Archlinux Arm

Postby Gyscos » Sun May 28, 2017 6:05 am

Hi!

I'm trying to develop for a bare-metal ARM chip (in this case, the particle photon) from an aarch64 ARM board (here, the odroid c2).
For this, I need a special compiler: arm-none-eabi-gcc.

This package is not currently available in the archlinuxarm repositories. A few other threads were opened last year about this (this one and that one), and neither of them got an answer.

I looked into building the package myself from the PKGBUILD, but it looks like there's a cyclic build dependency between arm-none-eabi-gcc and arm-none-eabi-newlib... Apparently at some point (at least 5 years ago, an eternity...) another package, then named cross-arm-none-eabi-gcc-base, was used to bootstrap everything, but here it says that this package was removed as no longer necessary.

So the question is: can I cross-compile these packages from x86_64? And/Or can I somehow bootstrap my Archlinux ARM installation and get those packages compiled?

I'm not an expert in cross-compiler bootstrapping, so I'm probably missing something obvious, but I'd really like if someone could explain to me how to get a cross-compiler on archlinux arm, to target bare-metal arm.

Thank you for the wonderful work you guys keep doing for us!
Gyscos
 
Posts: 20
Joined: Wed Feb 11, 2015 7:01 am

Re: Bare-metal ARM compiler on Archlinux Arm

Postby Gyscos » Tue May 30, 2017 1:57 am

* It seems the arm-none-eabi-newlib package is architecture-independent. So I just built it on a x86_64 computer, and scp'ed the .tar.xz archive.
* The arm-none-eabi-binutils package can be compiled without issues on aarch64 using the official PKGBUILD.
* From there, it should be possible to compile arm-none-eabi-gcc on aarch64. I'm setting up distcc to make this take less than forever, and will give an update if the compilation is a success.
Gyscos
 
Posts: 20
Joined: Wed Feb 11, 2015 7:01 am

Re: Bare-metal ARM compiler on Archlinux Arm

Postby Gyscos » Wed May 31, 2017 6:00 am

The compilation of arm-none-eabi-gcc finally succeeded (after a few IO-related crashes), and it seems to be in working condition.

Therefore, I suggest that `arm-none-eabi-gcc`, `arm-none-eabi-newlib` and `arm-none-eabi-binutils` all be added to the ArchlinuxArm community repository.

EDIT: link the the package request: viewtopic.php?f=5&t=11845
Last edited by Gyscos on Sun Jul 09, 2017 11:55 pm, edited 1 time in total.
Gyscos
 
Posts: 20
Joined: Wed Feb 11, 2015 7:01 am

Re: Bare-metal ARM compiler on Archlinux Arm

Postby apokalypz » Wed Jun 21, 2017 4:53 am

I just now saw your post. I discovered exactly the same thing a few days after I posted my thread that you linked to. I completely forgot to update my thread and am glad you maintained yours (it really should be moved to the "community guides" forum now for better reference). I only ran into one hiccup while building one of the packages, I think it was a hash error or something, but it built properly after overriding the verification checks. The build takes a while, but is totally do-able.
apokalypz
 
Posts: 41
Joined: Sun Apr 06, 2014 6:13 pm


Return to Packages

Who is online

Users browsing this forum: Google [Bot] and 9 guests