Hi,
On 2/12/25 13:38, Johannes Schauer Marin Rodrigues wrote:
["DSO missing from command line"]
I suspect that the problem is the order in which the -latomic is added to the
linker flags?
Yes.
Because if instead of target_link_options() with push and
pop-state I just use
target_link_libraries(vcmiclient PRIVATE atomic)
Then that will add a -latomic right after ../bin/libvcmiclientcommon.a and then
the build succeeds.
Yes, that is the correct approach -- that target is dependent on libatomic.
So what is the canonical way to achieve the desired result with CMake? Will I
instead have to globally set LDFLAGS="-Wl,--as-needed"?
On Debian, that is default already, which is very annoying when working
around #1002981 -- I need to add
[[maybe_unused]]
volatile int (*hack)(Display, char const *) = XMissingExtension;
to force a symbol reference from my code to libXext and avoid unloading
libXext before my program exits.
The --push-state logic is more useful for sending upstream.
Simon