Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 668002 - net-proxy/haproxy-1.8.13: proto_http.c:(.text+0xbfc): undefined reference to `__atomic_fetch_add_8'
Summary: net-proxy/haproxy-1.8.13: proto_http.c:(.text+0xbfc): undefined reference to ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal (vote)
Assignee: Christian Ruppert (idl0r)
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: libatomic-linking CVE-2018-11469 CVE-2020-11100
  Show dependency tree
 
Reported: 2018-10-07 22:40 UTC by ernsteiswuerfel
Modified: 2020-05-23 19:19 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_668002.txt,5.67 KB, text/plain)
2018-10-07 22:40 UTC, ernsteiswuerfel
Details
build.log (haproxy-1.8.13:20181007-221859.log,53.20 KB, text/plain)
2018-10-07 22:41 UTC, ernsteiswuerfel
Details
build.log (2.0.5) (haproxy-2.0.5:20190914-185720.log,115.53 KB, text/plain)
2019-09-14 19:01 UTC, ernsteiswuerfel
Details
emerge --info (file_668002.txt,5.85 KB, text/plain)
2019-09-14 19:02 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 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 archtester 2018-10-07 22:41:40 UTC
Created attachment 549756 [details]
build.log
Comment 2 Mikle Kolyada (RETIRED) 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 archtester 2018-10-28 22:08:13 UTC
Yes, dev-libs/libatomic_ops-7.6.6 is installed (and passes all tests).
Comment 4 ernsteiswuerfel archtester 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 archtester 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 archtester 2019-09-14 19:02:03 UTC
Created attachment 589840 [details]
emerge --info
Comment 7 Sam James archtester Gentoo Infrastructure 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 Infrastructure 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 https://bugs.gentoo.org/719662#c3. Same problem.
Comment 9 Georgy Yakovlev archtester gentoo-dev 2020-04-27 03:00:53 UTC
Makefile has

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


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):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=510215752be59ccf102d6ec51bf54d23de27d476

commit 510215752be59ccf102d6ec51bf54d23de27d476
Author:     Sam James (sam_c) <sam@cmpct.info>
AuthorDate: 2020-05-08 03:01:18 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2020-05-23 19:19:17 +0000

    net-proxy/haproxy: Fix 32-bit build
    
    Links against libatomic on 32-bit non-x86 arches.
    
    Closes: https://bugs.gentoo.org/668002
    Closes: https://github.com/gentoo/gentoo/pull/15704
    Signed-off-by: Sam James (sam_c) <sam@cmpct.info>
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 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(-)