[Bug backends/26176] New: Backend modules of elfutils are always linked to shared library
https://sourceware.org/bugzilla/show_bug.cgi?id=26176 Bug ID: 26176 Summary: Backend modules of elfutils are always linked to shared library Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: backends Assignee: unassigned at sourceware dot org Reporter: madebr at gmail dot com CC: elfutils-devel at sourceware dot org Target Milestone: --- The backend modules of elfutils are always linked to the shared libelf.so library. Assume an application links to a static libelf.a library. When this application loads a backend library, some symbols are present twice: once in the libelf.so and once in the static user application. This effectively makes using the static libraries undefined behaviour. I've googled around a bit how others solve this and found this: https://discourse.cmake.org/t/static-libraries-and-loadable-modules/1176 -- You are receiving this mail because: You are on the CC list for the bug.
[Bug backends/26176] Backend modules of elfutils are always linked to shared library
https://sourceware.org/bugzilla/show_bug.cgi?id=26176 --- Comment #2 from maarten --- Thanks for the quick reply! First, some background what we are trying to do: package elfutils using a conan recipe at https://github.com/conan-io/conan-center-index/pull/1768 We would like to provide elfutils as a static and shared library. The original version we were trying to add was 0.173, but I just updated it to 0.180 which indeed does not have loadable modules. So my problem is indeed gone! Some things we had to patch: - enable static builds (regardless of gprof or gcov configuration) - disable -Werror Also, it looks like `libasm.h` and `libdwfl.h` use types defined in `gelf.h`, but do not include the header. Some feedback/comments about these patches would be appreciated. -- You are receiving this mail because: You are on the CC list for the bug.