Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 721344 (libatomic-linking)

Summary: [Tracker] Libatomic-related build failures on 32-bit arches (non-x86) and riscv
Product: Gentoo Linux Reporter: Sam James <sam>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: CONFIRMED ---    
Severity: normal CC: gyakovlev, toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Other   
URL: https://www.mail-archive.com/bug-autoconf@gnu.org/msg04294.html
See Also: https://bugs.debian.org/907277
https://bugs.gentoo.org/show_bug.cgi?id=543984
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8756
https://github.com/mesonbuild/meson/issues/10621
https://github.com/mesonbuild/meson/pull/11445
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 551956, 734606, 770748, 802162, 820104, 902777, 911759, 918981, 923177, 926265, 453704, 518582, 639678, 668002, 688574, 719662, 720806, 727546, 727652, 734628, 738642, 740464, 764662, 778455, 782811, 790590, 790689, 803470, 803473, 806472, 809830, 820095, 820101, 827203, 828065, 830286, 832675, 832816, 833372, 835003, 836125, 836951, 837740, 847904, 857804, 860078, 864421, 872959, 895308, 906638, 912341    
Bug Blocks: 807721    

Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-05-07 01:23:57 UTC
Typical errors look like:
>proto_http.c:(.text+0xbfc): undefined reference to `__atomic_fetch_add_8'

gyakovlev has investigated this here: https://bugs.gentoo.org/719662#c3.

The gist is that libatomic is not always part of libstdc++. It looks like this is the case on non-x86 32 bit arches, but arm in at least some of these bugs has already been identified by upstream and handled in their build system.

Patches should be trivial in just adding -latomic on ppc/other 32-bit arches. With --as-needed in LDFLAGS, it shouldn't matter if we add it when it's unnecessary, I think.

We may need to come up with a neat macro/conditional to cleanly match only e.g. ppc and not ppc64.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-05-07 01:32:21 UTC
I have assigned this to base-system@ for now because it seems to be an autoconf bug exposed by newer versions of GCC (>= 8).

Please reassign if you feel this is not appropriate.
Comment 2 Georgy Yakovlev archtester gentoo-dev 2020-05-07 01:44:02 UTC
ppc32 check should generally be

> defined(__powerpc__) && !defined(__powerpc64__)

because __powerpc__ also defined on ppc64 hosts.