On Thu, Jan 16, 2025 at 08:16:46PM +0100, Johannes Schauer Marin Rodrigues 
wrote:
> > atomic operations require linking against libatomic — always have. Some
> > architectures inline a few functions, which is how you get away with 
> > omitting
> > the library on amd64 most of the time, but this is incorrect.
> > 
> > No architecture specific patch should be required here, adding libatomic 
> > everywhere is fine, possibly via
> > -Wl,--push-options,--as-needed,-latomic,--pop-options
> > 
> > (although as-needed is likely default anyway)
> 
> I find this very interesting. I am fighting -latomic linking issues for quite 
> a
> while now and what you just said makes me think that I am in severe lack of
> understanding here. Can you elaborate?
> 
> My specific situation is:
> 
> src:vcmi FTBFS on armel unless I apply this patch:
> 
> https://sources.debian.org/src/vcmi/1.5.7%2Bdfsg-1/debian/patches/fix-armel-atomics.patch/
> 
> After more research together with vcmi upstream involvement I found out that
> linking vcmi against atomic is *only* required because it uses
> tbb::parallel_for from oneTBB: 
> https://github.com/uxlfoundation/oneTBB/issues/1454
> 
> And then others have linked me to this GCC bug:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
> 
> So I'm at a loss at deciding who is at fault and who should be fixing
> something. You say this should work out-of-the-box on amd64 mostly but
> everything I have come across handling std::atomic types builds fine on all
> architectures -- except armel. So which is the thing that gets things wrong
> here?
> 
>  - armel?
>  - g++?
>  - cmake?
>  - oneTBB?
>  - vcmi?

Without having any special knowledge about this and skimming through the
linked GCC bug I assume that until (unless?) GCC starts adding -latomic
implicitly (which is what the bug and patches linked in it are about)
it's the software upstream's fault, and no upstreams actually care about
armel (and why would they).

See also the armel/upstream-support cell on
https://release.debian.org/testing/arch_qualify.html


-- 
WBR, wRAR

Attachment: signature.asc
Description: PGP signature

Reply via email to