You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to link external static libraries to my app target. These external libraries were built with Conan and use Zephyr kernel functions. I made sure that the Conan build uses the same (generated) headers as the Zephyr build itself. I added the CMakeDeps generator path to the Zephyr build by adding a -DCMAKE_PREFIX_PATH argument so that I can use the find_package macros to discover the Conan imported library targets inside my Zephyr app CMakeLists. Now the problem is that when I do
the Conan library always ends up after the zephyr/kernel/libkernel.a in the linker command line. That makes the linker drop the unused symbols from libkernel.a which are then reported as undefined symbols when linking conanlib1.
I already tried a myriad of things to get this running somehow, including trying to understand the zephyr cmake internals, but nothing seems to work. I found a suggestion to make the imported lib link against zephyr or zephyr_interface, but that didn't help either.
To Reproduce
You can reproduce this with the external_lib sample project. There the external lib is also added after the kernel lib on the command line.
Expected behavior
The external libs are placed after the whole-archive section but before libkernel.a.
Impact
Showstopper for our Conan/Zephyr integration project.
Logs and console output
n/a
Environment (please complete the following information):
OS: Linux
Zephyr 4.1.0-rc3, SDK 0.17.0
Additional context
n/a
The text was updated successfully, but these errors were encountered:
in my conanfile.py the CMakeDeps generator will add kernel at the end of the INTERFACE_LINK_LIBRARIES for my library and then the linker command in Zephyr gets an extra zephyr/kernel/libkernel.a after the Conan library. I found no way to do that in the Zephyr CMakeLists, however. Do you think that this solution is robust enough or is there a chance that the kernel CMake target is renamed in the future? This would break our build.
Describe the bug
I want to link external static libraries to my
app
target. These external libraries were built with Conan and use Zephyr kernel functions. I made sure that the Conan build uses the same (generated) headers as the Zephyr build itself. I added the CMakeDeps generator path to the Zephyr build by adding a-DCMAKE_PREFIX_PATH
argument so that I can use thefind_package
macros to discover the Conan imported library targets inside my Zephyr app CMakeLists. Now the problem is that when I dothe Conan library always ends up after the
zephyr/kernel/libkernel.a
in the linker command line. That makes the linker drop the unused symbols from libkernel.a which are then reported as undefined symbols when linking conanlib1.I already tried a myriad of things to get this running somehow, including trying to understand the zephyr cmake internals, but nothing seems to work. I found a suggestion to make the imported lib link against
zephyr
orzephyr_interface
, but that didn't help either.To Reproduce
You can reproduce this with the external_lib sample project. There the external lib is also added after the kernel lib on the command line.
Expected behavior
The external libs are placed after the whole-archive section but before
libkernel.a
.Impact
Showstopper for our Conan/Zephyr integration project.
Logs and console output
n/a
Environment (please complete the following information):
Additional context
n/a
The text was updated successfully, but these errors were encountered: