Closed auxym closed 1 year ago
Well this is fun. Adding --cpu:arm
to the nim c -c ...
command line in piconim removes the warning. It seems like Nim is creating bad codegen (for some other CPU target) without the --cpu
CLI flag, even though the cpu
option from config.nims appears to be correctly considered. Adding:
static:
echo hostCPU
To the project file getting compiled results in arm
being echoed in both cases, cpu CLI flag or not. Weird.
Seems like a compiler bug. I'll investigate a bit more and try to produce an MRE to open an issue in the compiler.
Some flags dont behave properly from inside configs, so that could be the culprit.
Yeah, looks like that issue. Are you aware of an existing issue in the compiler repo?
Workaround would probably be to "hardcode" the cpu flag in piconim. Weird because it's not happening with my samd21 project, using similar flags and same gcc. I'll look into it.
So the only reason I wasn't seeing it happening in my other arm project is because I let nim do the full build, and it calls gcc with -w
which hides all warnings (yay).
I have a MRE here: https://github.com/auxym/nim_incompat_pointer_bug
Will open a proper bug report in the nim compiler repo when I get a chance. I can confirm that the codegen is different when --cpu:arm
is passed to Nim on the CLI vs in the config file, even though nim doesn't fully ignore the config (static: echo hostCPU
still print arm
during the build in both cases).
Nothing is broken, just an annoyance. Don't remember seeing this before, but currently my pico projects (even a fresh blinky created with piconim init) results in whole bunch of complaining from gcc (see below).
Not sure what changed. I tried older Nim versions and still getting the same. Maybe a new gcc version? I am running
arm-none-eabi-gcc (Arch Repository) 12.2.0
."Regular" nim compiles don't do this, I guess the pico CMake/make stuff might be passing different
-W
flags to gcc?