Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 740464 - dev-libs/apr-1.7.0-r1 fails tests - ld: ../.libs/libapr-1.so: undefined reference to `__sync_val_compare_and_swap_8'
Summary: dev-libs/apr-1.7.0-r1 fails tests - ld: ../.libs/libapr-1.so: undefined refer...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C)
URL:
Whiteboard:
Keywords: PATCH, PullRequest, TESTFAILURE
: 738642 764662 778455 (view as bug list)
Depends on:
Blocks: libatomic-linking 778455
  Show dependency tree
 
Reported: 2020-09-05 12:02 UTC by ernsteiswuerfel
Modified: 2021-05-11 13:52 UTC (History)
4 users (show)

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


Attachments
build.log (apr-1.7.0-r1:20200905-115214.log,100.07 KB, text/plain)
2020-09-05 12:02 UTC, ernsteiswuerfel
Details
emerge --info (file_740464.txt,6.04 KB, text/plain)
2020-09-05 12:02 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2020-09-05 12:02:09 UTC
Created attachment 658524 [details]
build.log

build.log is from ppc but probably fails on any 32bit platform.

[...]
make[2]: Entering directory '/var/tmp/portage/dev-libs/apr-1.7.0-r1/work/apr-1.7.0/test'
/bin/sh /var/tmp/portage/dev-libs/apr-1.7.0-r1/work/apr-1.7.0/libtool --silent --mode=compile powerpc-unknown-linux-gnu-gcc -pthread  -Os -mcpu=7450 -pipe -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE   -I../include -I./../include  -o globalmutexchild.lo -c globalmutexchild.c && touch globalmutexchild.lo
/bin/sh /var/tmp/portage/dev-libs/apr-1.7.0-r1/work/apr-1.7.0/libtool --silent --mode=link powerpc-unknown-linux-gnu-gcc -pthread  -Os -mcpu=7450 -pipe -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE   -I../include -I./../include   -no-install   -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o globalmutexchild globalmutexchild.lo ../libapr-1.la   -luuid -lrt -lcrypt  -lpthread -ldl
/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: ../.libs/libapr-1.so: undefined reference to `__sync_val_compare_and_swap_8'
/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: ../.libs/libapr-1.so: undefined reference to `__sync_fetch_and_sub_8'
/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: ../.libs/libapr-1.so: undefined reference to `__sync_sub_and_fetch_8'
/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: ../.libs/libapr-1.so: undefined reference to `__sync_fetch_and_add_8'
/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: ../.libs/libapr-1.so: undefined reference to `__sync_lock_test_and_set_8'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:115: globalmutexchild] Error 1
make[2]: Leaving directory '/var/tmp/portage/dev-libs/apr-1.7.0-r1/work/apr-1.7.0/test'
Comment 1 ernsteiswuerfel archtester 2020-09-05 12:02:49 UTC
Created attachment 658526 [details]
emerge --info
Comment 2 Paul Osmialowski 2020-12-20 17:24:23 UTC
Did you manage to build apache-tools and apache with the most recent apr? It fails for the same reason you quoted here (undefined reference to `__sync_fetch_and_sub_8') on both of my 32-bit ppc machines and blocks my system update.
Comment 3 Sam James archtester gentoo-dev Security 2021-02-25 04:01:40 UTC
Debian has https://sources.debian.org/patches/apr/1.7.0-6/generic-64bit-atomics.patch/ but doesn't look sufficient.
Comment 5 Sam James archtester gentoo-dev Security 2021-02-25 04:03:35 UTC
(In reply to Sam James from comment #3)
> Debian has
> https://sources.debian.org/patches/apr/1.7.0-6/generic-64bit-atomics.patch/
> but doesn't look sufficient.

(Note that the Debian patch looks like it could work if we add in some arch defines)
Comment 6 Sam James archtester gentoo-dev Security 2021-05-09 07:13:14 UTC
*** Bug 764662 has been marked as a duplicate of this bug. ***
Comment 7 Sam James archtester gentoo-dev Security 2021-05-09 07:20:02 UTC
*** Bug 738642 has been marked as a duplicate of this bug. ***
Comment 8 Sam James archtester gentoo-dev Security 2021-05-09 07:21:30 UTC
*** Bug 778455 has been marked as a duplicate of this bug. ***
Comment 9 ernsteiswuerfel archtester 2021-05-09 11:28:54 UTC
@Sam:
I can canfirm that apr-1.6.3-r5, apr-1.6.5-r2 and apr-1.7.0-r2 from your PR build fine on ppc. Thanks!
Comment 10 Larry the Git Cow gentoo-dev 2021-05-11 08:44:45 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a3c82d2c1bac689e848c65dc0ad53e4cdd6fc7a

commit 8a3c82d2c1bac689e848c65dc0ad53e4cdd6fc7a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-05-09 07:16:06 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2021-05-11 08:44:37 +0000

    dev-libs/apr: fix underlinking for atomics on ppc, sparc
    
    Fixes errors in the produced library like:
    > undefined reference to `__sync_val_compare_and_swap_8'
    
    Forcing linkage against libatomic didn't work. May be worth
    investigation in future but need to get ppc and sparc working
    again.
    
    Closes: https://bugs.gentoo.org/740464
    Signed-off-by: Sam James <sam@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/20735
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 dev-libs/apr/{apr-1.6.3-r4.ebuild => apr-1.6.3-r5.ebuild} | 8 ++++++++
 dev-libs/apr/{apr-1.6.5-r1.ebuild => apr-1.6.5-r2.ebuild} | 8 ++++++++
 dev-libs/apr/{apr-1.7.0-r1.ebuild => apr-1.7.0-r2.ebuild} | 8 ++++++++
 3 files changed, 24 insertions(+)
Comment 11 Sam James archtester gentoo-dev Security 2021-05-11 13:52:21 UTC
(In reply to ernsteiswuerfel from comment #9)
> @Sam:
> I can canfirm that apr-1.6.3-r5, apr-1.6.5-r2 and apr-1.7.0-r2 from your PR
> build fine on ppc. Thanks!

Thank you for testing and thanks to Lars for merging!