Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How are the TARGET_LINK_SYSTEM_LIBRARIES for C++ supposed to work? #209

Open
stefanct opened this issue Aug 29, 2024 · 1 comment
Open

Comments

@stefanct
Copy link

I've spent the last days getting C++ to work properly in my setup. Since most users of the SDK rely on the auto-generated linker scripts that contain the libraries and not even the examples using them, I am not sure if anybody is actually using the ones set by mcux_config.cmake, i.e.,

set(TARGET_LINK_SYSTEM_LIBRARIES "-lstdc++ crti.o crtn.o crtbegin.o crtend.o" PARENT_SCOPE)
etc.

As far as I can tell these cannot work since the linker won't find the object files if supplied like that. The gcc supplied by NXP has the right paths set as LIBRARY_PATH (e.g, /usr/local/mcuxpressoide-11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.linux_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+dp/hard/:...) but this does not help for linking object files because they are not search for in LIBRARY_PATH.

Instead, you have to either use a full path (e.g., /usr/local/mcuxpressoide-11.9.0_2144/ide/plugins/com.nxp.mcuxpresso.tools.linux_11.9.0.202307121226/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+dp/hard/crtend.o) or you have to supply them via -l: (e.g., -l:crtend.o). I am not entirely sure if the latter variant is actually supposed to work - it is only documented for libraries. In any case I don't see how the current implementation in the SDK can work but maybe I am missing something...?

@mcuxsusan
Copy link
Contributor

Thanks for reporting the issue! I have involved development team to check, feedback could be delayed, appreciate for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants