Building LDC runtime for a microcontroller
teona.severin9 at gmail.com
Mon Sep 7 15:23:28 UTC 2020
I have been trying to build the LDC runtime for a Nucleo-f429zi
board with a Cortex-M4 CPU, by following . The target is not
any operating system (as the target board uses a STM32
microcontroller), so the gcc toolchain I have used is
The error I am getting after running “CC=arm-none-eabi-gcc
ldc-build-runtime --reset --ninja
CMake Error at
The C compiler
is not able to compile a simple test program.
It fails with the following output:
Run Build Command(s):/usr/bin/ninja cmTC_31c30 && [1/2]
Building C object CMakeFiles/cmTC_31c30.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_31c30
/home/teona/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc -rdynamic CMakeFiles/cmTC_31c30.dir/testCCompiler.c.o -o cmTC_31c30 && :
arm-none-eabi-gcc: error: unrecognized command line option
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
After searching online for a solution, I found that the same
issue appeared when using Golang and one answer  stated that
it might work by passing to the linker “-Wl,-export-dynamic”
instead of “-rdynamic”. Do you have any idea how I could do that?
CMake version is 3.18,
arm-none-eabi-gcc version is 6.3.1,
ldc2 version is 1.23.0 and the system I am running on is Ubuntu
I would also appreciate any advice regarding ways to build or
create a small runtime for microcontrollers (runtime that can fit
in the memory of a microcontroller).
Thank you very much,
More information about the Digitalmars-d-learn