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

Bug 668002

Summary: net-proxy/haproxy-1.8.13: proto_http.c:(.text+0xbfc): undefined reference to `__atomic_fetch_add_8'
Product: Gentoo Linux Reporter: ernsteiswuerfel <erhard_f>
Component: Current packagesAssignee: Christian Ruppert (idl0r) <idl0r>
Severity: normal CC: bertrand, jstein, ppc, sam, zlogene
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: PPC   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 721344, 662900, 715944    
Attachments: emerge --info
build.log (2.0.5)
emerge --info

Description ernsteiswuerfel 2018-10-07 22:40:53 UTC
Created attachment 549754 [details]
emerge --info

Build failure on ppc with standard USE-flags:

src/proto_http.o: In function `http_action_reject':
proto_http.c:(.text+0xbfc): undefined reference to `__atomic_fetch_add_8'
proto_http.c:(.text+0xc14): undefined reference to `__atomic_fetch_add_8'
proto_http.c:(.text+0xc40): undefined reference to `__atomic_fetch_add_8'
src/proto_http.o: In function `http_perform_server_redirect':
proto_http.c:(.text+0x684c): undefined reference to `__atomic_fetch_add_8'
src/proto_http.o: In function `http_wait_for_request_body':
proto_http.c:(.text+0x9994): undefined reference to `__atomic_fetch_add_8'
src/proto_http.o:proto_http.c:(.text+0x99b8): more undefined references to `__atomic_fetch_add_8' follow
src/time.o: In function `tv_update_date':
time.c:(.text+0x91c): undefined reference to `__atomic_compare_exchange_8'
collect2: error: ld returned 1 exit status
make: *** [Makefile:900: haproxy] Error 1
 * ERROR: net-proxy/haproxy-1.8.13::gentoo failed (compile phase):
 *   emake failed
Comment 1 ernsteiswuerfel 2018-10-07 22:41:40 UTC
Created attachment 549756 [details]
Comment 2 Mikle Kolyada archtester Gentoo Infrastructure gentoo-dev Security 2018-10-27 21:26:41 UTC
it seems it tries to link agains libatomic, does your system have have dev-libs/libatomic_ops installed?
Comment 3 ernsteiswuerfel 2018-10-28 22:08:13 UTC
Yes, dev-libs/libatomic_ops-7.6.6 is installed (and passes all tests).
Comment 4 ernsteiswuerfel 2019-08-16 22:58:43 UTC
Also haproxy-1.8.20, haproxy-1.9.10 and haproxy-2.0.4 fail with the same error, built againts libatomic_ops-7.6.6 or 7.6.10.
Comment 5 ernsteiswuerfel 2019-09-14 19:01:16 UTC
Created attachment 589838 [details]
build.log (2.0.5)

Still around in 1.8.21, 1.9.10 and 2.0.5.
Comment 6 ernsteiswuerfel 2019-09-14 19:02:03 UTC
Created attachment 589840 [details]
emerge --info
Comment 7 Sam James archtester gentoo-dev Security 2020-04-27 02:10:51 UTC
Does this need to be reported upstream, or what needs to happen here?
Comment 8 Sam James archtester gentoo-dev Security 2020-04-27 02:14:56 UTC
(In reply to Sam James (sec padawan) from comment #7)
> Does this need to be reported upstream, or what needs to happen here?

See Same problem.
Comment 9 Georgy Yakovlev gentoo-dev 2020-04-27 03:00:53 UTC
Makefile has

> ifneq ($(shell echo __arm__/__aarch64__ | $(CC) -E -xc - | grep '^[^\#]'),__arm__/__aarch64__)

it can be extended to 

> fneq ($(shell echo __arm__/__aarch64__/__powerpc__ | $(CC) -E -xc - | grep '^[^\#]'),__arm__/__aarch64__/__powerpc__)

but it will also pass -latomic on ppc64, as ppc64 also defines __powerpc__

other way is to append LDFLAGS somewhere, in case makefile honors env LDFLAGS.
Comment 10 Christian Ruppert (idl0r) gentoo-dev 2020-04-27 07:12:18 UTC
It should be reported upstream, yes. If someone is able to fix that, a patch would be great, for the ebuild as well as upstream.
Comment 11 Larry the Git Cow gentoo-dev 2020-05-23 19:19:34 UTC
The bug has been closed via the following commit(s):

commit 510215752be59ccf102d6ec51bf54d23de27d476
Author:     Sam James (sam_c) <>
AuthorDate: 2020-05-08 03:01:18 +0000
Commit:     Matt Turner <>
CommitDate: 2020-05-23 19:19:17 +0000

    net-proxy/haproxy: Fix 32-bit build
    Links against libatomic on 32-bit non-x86 arches.
    Signed-off-by: Sam James (sam_c) <>
    Signed-off-by: Matt Turner <>

 net-proxy/haproxy/haproxy-2.0.14-r1.ebuild | 7 ++++++-
 net-proxy/haproxy/haproxy-2.1.4-r1.ebuild  | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)