Open rweickelt opened 2 years ago
Please update title
Sorry, the title got lost.
Hi @tejlmand,
This issue, marked as an Feature Request, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.
Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.
@rweickelt you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.
Thanks!
Not sure I follow what is being asked here, but have you tried looking into llext? https://docs.zephyrproject.org/latest/services/llext/index.html
No, I am not talking about runtime-linking.
Let's assume I am linking libExt into my Zephyr project. libExt has undefined symbols (on purpose). That can be a application-specific function or a global variable or something like that. I want to use link-time optimization (LTO) and thus I don't want to hand pointers over at run-time.
In a usual embedded project where I build my application I would implement the desired function directly in the application project. The linker will notice the missing symbol in libExt.a and always look for it in the application's object files.
The Zephyr build system builds the application project as a library (libApp) before linking everything together. In that case, the missing symbol from libExt.a that is now part of libApp is not found by the linker. That is probably because libExt appears before libApp on the linker command line which is unexpected.
I am looking for a way to solve this particular build system problem.
When linking external libraries (libext), it is sometimes desired to leave a symbol in the library undefined and to provide it in the application code. This is usually not a problem when linking application object files because the linker will always look into application objects when obtaining an undefined symbol.
But zephyr builds the application as a static library (libapp). Since libapp appears before libext on the linker command line, the desired symbol will not be found. It should be noted that the library link order is correct. It's just not expected that zephyr app target is a static library itself.
Please provide a way to easily add an external library to zephyrs whole-archive group or a different solution.