Hi,

Quoting Simon Richter (2025-01-17 11:43:39)
> In my own packages, I check if libatomic exists, and if it does, I
> unconditionally link if I use any atomics. I also check if the linker accepts
> --push-flags, if it does I generate a
> -Wl,--push-flags,--as-needed,-latomic,--pop-flags sequence, if not, the
> unconditional link will generate dpkg-shlibdeps warnings about unnecessary
> linking on amd64, but that's better than failing on other platforms.

thank you for your help! I now patched vcmi with snippets like this:

if (CMAKE_LIBRARY_ARCHITECTURE STREQUAL "arm-linux-gnueabi")
        target_link_options(vcmi PRIVATE 
"-Wl,--push-flags,--as-needed,-latomic,--pop-flags")
endif()

I understand from the other mails that this architecture-check is not even
needed and that --as-needed will let the linker do the right thing. I still
like to special-case the only arch where this seems to be needed. I gave up on
hoping that onetbb fixes it as neither upstream nor the Debian bug show any
activity, so I'm patching my own package instead.

But then I get the complaint:

/usr/bin/ld: unrecognized option '--push-flags'

You probably meant --push-state and --pop-state instead?

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to