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
Created attachment 883510 [details] build.log and emerge --info
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(-)
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.
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.
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(+)
I sent fix to upstream https://github.com/microsoft/mimalloc/pull/898
Thanks!
Fixed in upstream https://github.com/microsoft/mimalloc/commit/03224e17a01228e3cdb531343c925b772c5de567
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb65f4903f9b72a0ac51b6192762d659009baf4d commit cb65f4903f9b72a0ac51b6192762d659009baf4d Author: Sam James <sam@gentoo.org> AuthorDate: 2024-05-20 08:10:19 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-05-20 08:10:52 +0000 dev-libs/mimalloc: add 2.1.6 Includes a note to cleanup the libatomic hack in the next release. Bug: https://bugs.gentoo.org/923177 Bug: https://bugs.gentoo.org/931778 Closes: https://bugs.gentoo.org/930519 Signed-off-by: Sam James <sam@gentoo.org> dev-libs/mimalloc/Manifest | 1 + dev-libs/mimalloc/mimalloc-2.1.6.ebuild | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+)
commit a8f1993453bb362f73c31b5eaa122f2ee1adf4c5 Author: Matthew Smith <matthew@gentoo.org> Date: Tue Apr 23 17:35:46 2024 +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> commit 79560e44184ed0241f7199722cf8c1dd3207b256 Author: Matthew Smith <matthew@gentoo.org> Date: Fri May 17 08:57:18 2024 +0000 dev-libs/mimalloc: conditionally add -latomic Some systems do not have libatomic, so forcing its use causes build errors. Bug: https://bugs.gentoo.org/931778 Signed-off-by: Matthew Smith <matthew@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/36716 Signed-off-by: Sam James <sam@gentoo.org>