erlkingh
Posts: 2
Joined: Sat Dec 01, 2018 7:12 pm

[SOLVED] Unable to cross compile assembly

Sat Dec 01, 2018 7:21 pm

I'm unable to compile using arm-none-eabi-gcc toolchain.
The error I get is:

Code: Select all

boot.S: Assembler messages:
boot.S:7: Error: ARM register expected -- `mrs x0,mpidr_el1'
boot.S:8: Error: ARM register expected -- `and x0,x0,#0xFF'
boot.S:9: Error: selected processor does not support `cbz x0,master' in ARM mode
boot.S:16: Error: ARM register expected -- `adr x0,bss_begin'
boot.S:17: Error: ARM register expected -- `adr x1,bss_end'
boot.S:18: Error: ARM register expected -- `sub x1,x1,x0'
The flags are:

Code: Select all

-mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mneon-for-64bits -mfloat-abi=hard -mlittle-endian -munaligned-access
I've spent quite a lot of time resolving other issues so I'm probably missing something with this one.
Last edited by erlkingh on Sun Dec 02, 2018 3:46 pm, edited 1 time in total.

User avatar
DavidS
Posts: 3710
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Unable to cross compile assembly

Sun Dec 02, 2018 3:39 pm

Looks like you are using AARCH64 instructions. Are you targetting a system running in AARCH64?

Though you may have to tell gcc that you are targetting AARCH64 as it likely defaults to standard ARM, even when targeting the A53.
The Raspberry Pi is an ARM computer, that runs many Operating Systems, including Linux, RISC OS, BSD, Pi64, CP/M as well as many more.
Soon to add AROS to the list of operating systems.

erlkingh
Posts: 2
Joined: Sat Dec 01, 2018 7:12 pm

Re: Unable to cross compile assembly

Sun Dec 02, 2018 3:46 pm

Yeah, that was the case.

I changed the toolchain to aarch64-linux-gnu, everything works fine.

My mistake was downloading a toolchain for the Cortex-RM processors.

Guess It’s solved now.

Return to “Bare metal, Assembly language”