USE_LDOPT with multiple items

Discussions and support about ChibiStudio, the free development environment for ARM.
jcbless
Posts: 39
Joined: Wed Apr 16, 2025 2:29 pm
Has thanked: 6 times
Been thanked: 3 times

USE_LDOPT with multiple items

Postby jcbless » Mon Nov 24, 2025 3:58 pm

I was trying to add options to USE_LDOPT in the Makefile. I first had -lm alone and that appeared to work correctly. But when I added -lstdc++, then it didn't seem to add the linking for stdc++. Then I reversed it and only put -lstdc++. It seemed to link for stdc++ at that point correctly. But adding -lm after it caused the math additions to not occur.

The error I get if I put in -lstdc++ -lm for USE_LDOPT is:
/home/jcbless/Projects/ChibiStudio/tools/GNU Tools ARM Embedded/11.3.1 2022q3/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: cannot find -lm,--defsym=__process_stack_size__=0x400,--defsym=__main_stack_size__=0x400: No such file or directory

So in any case it appears that it is not taking in multiple options. Am I correct about this. What can be done to correct this if I'm interpreting the issue correctly?

Thanks,
John

User avatar
Giovanni
Site Admin
Posts: 14773
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1170 times
Been thanked: 974 times

Re: USE_LDOPT with multiple items

Postby Giovanni » Mon Nov 24, 2025 6:24 pm

Hi,

Try separating options with commas not spaces.

Giovanni

jcbless
Posts: 39
Joined: Wed Apr 16, 2025 2:29 pm
Has thanked: 6 times
Been thanked: 3 times

Re: USE_LDOPT with multiple items

Postby jcbless » Mon Nov 24, 2025 6:56 pm

That did it - thanks. Now I'm fighting other errors.

I'm getting:
undefined reference to `__dso_handle'
and
undefined reference to `_fini'
and
hidden symbol `__dso_handle' isn't defined
and
final link failed: bad value

I've added -fno-use-cxa-atexit to USE_CPPOPT and ,lc to USE_LDOPT

Any ideas about these errors?

Thanks,
John

User avatar
Giovanni
Site Admin
Posts: 14773
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1170 times
Been thanked: 974 times

Re: USE_LDOPT with multiple items

Postby Giovanni » Tue Nov 25, 2025 6:25 am

Probably it is something missing in linker files, those are not really done to support full C++, you may try to compare with linker files provided with the compiler.

Giovanni

jcbless
Posts: 39
Joined: Wed Apr 16, 2025 2:29 pm
Has thanked: 6 times
Been thanked: 3 times

Re: USE_LDOPT with multiple items

Postby jcbless » Wed Dec 03, 2025 4:11 pm

I corrected the ,lc to ,-lc since that was one simple mistake.

I also finally realized I had added this to a file while experimenting to solve another problem:
#include <iostream>

That was apparently causing the problems that I was seeing in the previous post. With this text removed I was able to eliminate the errors.


Return to “ChibiStudio”

Who is online

Users browsing this forum: No registered users and 25 guests