Questions tagged [arm-none-eabi-gcc]
87 questions
9
votes
0 answers
GNU Linker: ELF has a LOAD segment with RWX permissions. Embedded ARM project
I have updated my arm-none-eabi GCC and the associated tools and rebuilt an embedded project I develop.
$ arm-none-eabi-ld --version
GNU ld (GNU Binutils) 2.39
Suddenly, I'm getting the…

GNA
- 479
- 3
- 18
4
votes
1 answer
Why does GCC produce extra ADDS instruction after LDR for loading an .rodata pointer on ARM thumb instruction set?
This code:
const char padding[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
const char myTable[] = { 1, 2, 3, 4 };
int keepPadding() {
return (int)(&padding);
}
int foo() {
return (int)(&myTable); // <-- this is the part I'm looking at
}
compiles…

Mike
- 954
- 6
- 10
4
votes
1 answer
What does the -specs argument do in arm-none-eabi-gcc?
I was having trouble with the linker for the embedded arm gcc compiler, and I found a tutorial somewhere online saying that I could fix my linker errors in arm-none-eabi-gcc by including the argument -specs=nosys.specs, which worked for me, and it…

Willis Hershey
- 1,520
- 4
- 22
4
votes
0 answers
Differences between GCC/Clang when linking
Because of vastly better C++ compile times I've recently added the option to compile a project for an ARM Cortex-M4 microcontroller with Clang instead of the arm-none-eabi-gcc toolchain. The whole process ran quite smoothly and I quickly had working…

Vinci
- 1,382
- 10
- 12
3
votes
0 answers
unrecognized command-line option '-arch'; did you mean '-march='?
I'm trying to build a STM32 project on MacBook M1 with CMake and arm-none-eabi-gcc.
These are my CMake codes:
cmake_minimum_required(VERSION 3.0.0)
project(Embedded VERSION 0.1.0)
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
add_compile_options(-g…

Gtylcara
- 87
- 5
2
votes
1 answer
Possible to implement MMU functionality in software with GCC?
I have an ARM Cortex-M0+ MCU (SAML21) that doesn't have a memory management unit or external memory interface, but I would like to use an existing library (libavif + libaom) to manipulate data that doesn't fit in the internal SRAM. In this case, a…

unknownperson
- 339
- 1
- 9
2
votes
0 answers
Why error: no memory region specified for loadable section `.bss'?
I am trying to build an application manually using arm-none-eabi-gcc. The build goes fine but I get the following error during link time:
error: no memory region specified for loadable section `.bss'
No other errors nor warnings. Just the build's…

zupoluzu
- 51
- 4
2
votes
0 answers
How do the `aapcs` and `aapcs-linux` ABI options differ when compiling for bare-metal ARM with gcc?
I am trying to port an application to ARM's arm-none-eabi-gcc toolchain. This application is intended to run on a bare-metal target.
The only two suitable values for the -mabi option in this case appear to be aapcs and aapcs-linux. From Debian…

AJM
- 1,317
- 2
- 15
- 30
2
votes
1 answer
Position independent code on MCU - everything works, except vsnprintf - C alternative for vsnprintf?
I am pulling my hear out for quite a while. I am trying to achieve position independent code on a microcontroller. It's quite a rabbit hole. I've gotten so far that I can bring my app online, and responsive for mqtt commands.
The only thing I can't…

bas
- 13,550
- 20
- 69
- 146
2
votes
0 answers
`arm-none-eabi-g++ -print-sysroot` is empty
If I unpacking the toolchain via gcc-arm-none-eabi-10.3-2021 and run
$ arm-none-eabi-g++ --help
...
-print-sysroot Display the target libraries directory.
...
$ arm-none-eabi-g++ -print-sysroot
$…

ge45mue
- 677
- 8
- 23
2
votes
1 answer
newlib-nano printf translates to iprintf in embedded project
I got an embedded project for cortex-m0+ and I would like to link with newlib-nano library. I'm learning, how things work (that you need to implement stubs for certain functions etc.). I've managed to create a working example which builds.
Source…

ST Renegade
- 311
- 3
- 14
2
votes
0 answers
About how to properly makefile arm stm32
I know this is already a long discussed topic on here, yet I have not been able to fully understand/implement a makefile that suits my folder system and requirements.
here is what my any of my project's folder system looks…

Juan_David
- 126
- 2
- 11
2
votes
0 answers
GCC v10.3 use more stack size than GCC v6.3 for a function
I have an application which I compile using GCC v6.3, when I compile it with GCC v10.3 I find some functions use more stack size than what GCC v6.3 uses, for example this function uses zero stack for GCC v6.3 but uses 8 bytes for GCC v10.3
int…

Mohamed Yacout
- 133
- 7
2
votes
1 answer
CMake C project does not compile under arm-none-eabi toolchain
I am currently working on a driver for a sensor. As I did the setup, everything worked correctly and I could compile my code. But as soon as I have written the driver and wanted to test, CMake gave me lots of errors which I can't quite understand.…

The Origin
- 135
- 1
- 10
2
votes
1 answer
Why does changing the order of object files using the arm-none-eabi-ld linker change the executable behavior?
I am getting different behavior when using
arm-none-eabi-ld -T t.ld -o t.elf t.o ts.o
to link my object files, vs
arm-none-eabi-ld -T t.ld -o t.elf ts.o t.o
where the object files 't.o' and 'ts.o' are transposed in the command. The latter version…

reininger
- 23
- 3