Closed ximion closed 3 weeks ago
Hi,
Thank you for the contribution.
CMake should have add -Wl
automatically according to this:
https://cmake.org/cmake/help/latest/command/add_link_options.html#handling-compiler-driver-differences
The strange things is that Github Actions' cmake as well as cmake on my test environment perfectly do this.
But judging on the error message from your machine cmake just passed the LINKER prefix as is which is weird. What version of CMake do you use?
This was on cmake 3.30.2 - but the project uses Meson in its pipeline, so I now wonder whether this might be failing somewhere over there.
I did try passing -Wl,LINKER:--push-state,--whole-archive,$<TARGET_FILE:${LIBRARY}>,--pop-state
with equally bad results though...
This issue only appears when using an installed version of KFR, I haven't seen it in any other scenarios. Looks like I'll have to investigate this a bit more though, your reply made me a lot less certain that the problem isn't somewhere in our build pipeline.
I looked into this more, and the issue is in the Meson part of the build - we are specifically hitting https://github.com/mesonbuild/meson/issues/11404, apparently.
This isn't an issue in KFR, but in Meson, and should be addressed there somehow. Sorry for the noise!
Thank you anyway for reporting this and discovering the root cause, it may help users who are hitting the same issues with KFR and meson.
Hi!
This patch fixes a linking issue when using ld/gold and kfr_dsp from an installed CMake module:
This should work with any linker on Linux/FreeBSD as they are all more or less compatible with ld, but I haven't done extensive testing on that (the testsuite should cover this though, I hope!)
Thank you for creating KFR and for considering this patch!