Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923177 - dev-libs/mimalloc-2.1.2 fails to build on ppc: libmimalloc.so.2.1: undefined reference to `__atomic_load_8'
Summary: dev-libs/mimalloc-2.1.2 fails to build on ppc: libmimalloc.so.2.1: undefined ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal (vote)
Assignee: Matthew Smith
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: libatomic-linking 917271
  Show dependency tree
 
Reported: 2024-01-29 01:22 UTC by matoro
Modified: 2024-04-23 17:36 UTC (History)
4 users (show)

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


Attachments
build.log and emerge --info (file_923177.txt,26.28 KB, text/plain)
2024-01-29 01:23 UTC, matoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matoro archtester 2024-01-29 01:22:43 UTC
Need append-atomic-flags

[21/23] : && /usr/bin/powerpc-unknown-linux-gnu-gcc -O2 -mcpu=powerpc -mtune=powerpc -pipe -Wl,-O1 -Wl,--as-needed CMakeFiles/mimalloc-test-stress.dir/test/test-stress.c.o -o mimalloc-test-stress  -Wl,-rpath,/var/tmp/portage/dev-libs/mimalloc-2.1.2/work/mimalloc-2.1.2_build-.ppc  libmimalloc.so.2.1  /usr/lib/libpthread.a  /usr/lib/librt.a && :
FAILED: mimalloc-test-stress 
: && /usr/bin/powerpc-unknown-linux-gnu-gcc -O2 -mcpu=powerpc -mtune=powerpc -pipe -Wl,-O1 -Wl,--as-needed CMakeFiles/mimalloc-test-stress.dir/test/test-stress.c.o -o mimalloc-test-stress  -Wl,-rpath,/var/tmp/portage/dev-libs/mimalloc-2.1.2/work/mimalloc-2.1.2_build-.ppc  libmimalloc.so.2.1  /usr/lib/libpthread.a  /usr/lib/librt.a && :
/usr/lib/gcc/powerpc-unknown-linux-gnu/11/../../../../powerpc-unknown-linux-gnu/bin/ld: libmimalloc.so.2.1: undefined reference to `__atomic_load_8'
/usr/lib/gcc/powerpc-unknown-linux-gnu/11/../../../../powerpc-unknown-linux-gnu/bin/ld: libmimalloc.so.2.1: undefined reference to `__atomic_store_8'
/usr/lib/gcc/powerpc-unknown-linux-gnu/11/../../../../powerpc-unknown-linux-gnu/bin/ld: libmimalloc.so.2.1: undefined reference to `__atomic_fetch_add_8'
/usr/lib/gcc/powerpc-unknown-linux-gnu/11/../../../../powerpc-unknown-linux-gnu/bin/ld: libmimalloc.so.2.1: undefined reference to `__atomic_compare_exchange_8'
collect2: error: ld returned 1 exit status

Reproducible: Always
Comment 1 matoro archtester 2024-01-29 01:23:30 UTC
Created attachment 883510 [details]
build.log and emerge --info
Comment 2 Larry the Git Cow gentoo-dev 2024-01-29 09:33:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5dcd918b96cdb59f183ba8ae23821c69ad7833f0

commit 5dcd918b96cdb59f183ba8ae23821c69ad7833f0
Author:     Matthew Smith <matthew@gentoo.org>
AuthorDate: 2024-01-29 09:31:23 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2024-01-29 09:33:48 +0000

    dev-libs/mimalloc: append -latomic if required
    
    Closes: https://bugs.gentoo.org/923177
    Suggested-by: Matoro Mahri <matoro_gentoo@matoro.tk>
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 dev-libs/mimalloc/mimalloc-2.1.2.ebuild | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 3 matoro archtester 2024-01-30 04:11:29 UTC
Unfortunately, the committed fix does not work, because this is a cmake project, and cmake does not respect LIBS environment variable, which is what is used to implement append-atomic-flags.
Comment 4 Ionen Wolkens gentoo-dev 2024-01-30 04:30:31 UTC
Haven't looked too closely but last time I quickly checked mimalloc for atomic issues, it had some cmake logic for this already. It's *probably* just failing to use it when it should here.

(that was in a rust crate rather than system's mimalloc, and in the end it no longer use mimalloc so don't think anyone went further with resolving that)

Either way the append-atomic can be reverted.
Comment 5 Larry the Git Cow gentoo-dev 2024-04-23 17:36:51 UTC
The bug has been referenced in the following commit(s):

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

commit a8f1993453bb362f73c31b5eaa122f2ee1adf4c5
Author:     Matthew Smith <matthew@gentoo.org>
AuthorDate: 2024-04-23 17:35:46 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2024-04-23 17:36:25 +0000

    dev-libs/mimalloc: add 2.1.4
    
    - Add -DMI_USE_LIBATOMIC=ON to force -latomic (#923177)
    - Add new -DMI_LIBC_MUSL if elibc_musl.
    
    Bug: https://bugs.gentoo.org/923177
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 dev-libs/mimalloc/Manifest              |  1 +
 dev-libs/mimalloc/mimalloc-2.1.4.ebuild | 37 +++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)