Clion+WSL+AVR: Unrecognised option -rdynamic

I haven’t used PlatformIO for a few months, but needed to change something in an existing project (which used to work fine) today. PlatformIO informed me about some updates, which I installed. Since then, I can’t get it to work anymore.

Compiling works, but linking fails with the following error:

[100%] Linking CXX executable cc_rev5_tester
avr-g++: error: unrecognized command line option ‘-rdynamic’
CMakeFiles/cc_rev5_tester.dir/build.make:128: recipe for target ‘cc_rev5_tester’ failed

I’m using PlatformIO version 3.6.7, which installed avr-g++ v5.4.0.

I can’t find much information about this error. The sources I can find are fastly outdated, but seem to imply it could be a Windows vs Linux issue. Something seems to be recognising WSL as Windows? I’ve tried the proposed fixes, but those didn’t work (as was to be expected). Does anyone have an idea?

You’re building using CMake? The exported CLion project from PIO should just directly call into PIO and not attempt a CMake compilation itself. What does pio run output for the project?

1 Like

Please read Redirecting... and check which button to use for building.