forwarded from https://bugs.debian.org/874531 Builds of mesa for armel have been failing lately: glsl/.libs/libstandalone.a(libmesautil_la-disk_cache.o): In function `disk_cache_remove': ./build/src/util/../../../src/util/disk_cache.c:643: undefined reference to `__atomic_fetch_add_8' collect2: error: ld returned 1 exit status Makefile:2110: recipe for target 'glsl_compiler' failed make[5]: *** [glsl_compiler] Error 1 make[5]: Leaving directory '/<<PKGBUILDDIR>>/build/src/compiler' Please link glsl_compiler (and anything else that uses libstandalone) against -latomic. If you don't want that dependency on architectures that don't need it, you can either conditionalize on architecture or precede -latomic with -Wl,--as-needed (and follow it with -Wl,--no-as-needed if desired).
Hmm the code in src/util/u_atomic.c should handle that. The code is omitted when the GCC_64BIT_ATOMICS_SUPPORTED test [in configure.ac] reports "it works". I don't have a armel setup handy, so if anyone anyone can polish/fix the test and send a patch, that would be appreciated.
(In reply to Emil Velikov from comment #1) > I don't have a armel setup handy, so if > anyone anyone can polish/fix the test and send a patch, that would be > appreciated. It might be possible to set up without hardware, just using Qemu.
On what conditions does this show up? Mesa git builds fine on debian stretch and it's gcc 6.3.0, gcc is generating __sync_* calls even when __atomic_* is explicitly used, and that is handled. (In reply to Shmerl from comment #2) > It might be possible to set up without hardware, just using Qemu. It takes ~8h to build mesa configured with just swrast, and qemu can't make use of multiple cores when emulating ARM, so not always a good option.
(In reply to Grazvydas Ignotas from comment #3) > On what conditions does this show up? Mesa git builds fine on debian stretch > and it's gcc 6.3.0, gcc is generating __sync_* calls even when __atomic_* is > explicitly used, and that is handled. It happens in Debian unstable, which uses gcc 7.1.0 already.
(In reply to Grazvydas Ignotas from comment #3) > It takes ~8h to build mesa configured with just swrast, and qemu can't make > use of multiple cores when emulating ARM, so not always a good option. Apparently, Qemu should support multithreading for ARM emulation, starting from version 2.9. Unfortunately Debian is still stuck with 2.8 at the moment. See https://wiki.qemu.org/Features/tcg-multithread
Patches landed in master https://patchwork.freedesktop.org/series/30551/ Is this fixed?
(In reply to Juan A. Suarez from comment #6) > Patches landed in master > > https://patchwork.freedesktop.org/series/30551/ > > > Is this fixed? Yeah, it's fixed [1]. Please cherry-pick commit 2ef7f23820a for 17.2.2. Thanks, Andreas [1] https://buildd.debian.org/status/fetch.php?pkg=mesa&arch=armel&ver=17.2.1-2&stamp=1506426795&raw=0 Fixed by: commit 2ef7f23820a67e958c2252bd81eb0458903ebf33 Author: Grazvydas Ignotas <notasas@gmail.com> Date: Mon Sep 18 22:11:26 2017 +0300 configure: check if -latomic is needed for __atomic_* On some platforms, gcc generates library calls when __atomic_* functions are used, but does not link the required library (libatomic) automatically (supposedly to allow the app to use some other atomics implementation?). Detect this at configure time and add the library when needed. Tested on armel (library was added) and on x86_64 (was not, as expected). Some documentation on this is provided in GCC wiki: https://gcc.gnu.org/wiki/Atomic/GCCMM Fixes: 8915f0c0 "util: use GCC atomic intrinsics with explicit memory model" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102573 Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(In reply to Andreas Boll from comment #7) > Yeah, it's fixed [1]. Please cherry-pick commit 2ef7f23820a for 17.2.2. > Sure. It's on the queue.
Hi, this patch breaks building mesa3d 17.2.3 with Target: powerpc-ctng_e500v2-linux-gnuspe gcc version 4.7.3 (crosstool-NG hg+-c65fcf8a34b7) as reported by buildroot autobuilders: http://autobuild.buildroot.net/?reason=mesa3d-17.2.3 Quoting http://autobuild.buildroot.net/results/43d/43d8bf9a1531f4b69e22bfb53b4536d76cf31cbb/build-end.log /home/peko/autobuild/instance-0/output/host/opt/ext-toolchain/bin/../lib/gcc/powerpc-ctng_e500v2-linux-gnuspe/4.7.3/../../../../powerpc-ctng_e500v2-linux-gnuspe/bin/ld: cannot find -latomic Quoting from configure output: checking whether -latomic is needed... yes checking whether __sync_add_and_fetch_8 is supported... no
(In reply to Bernd Kuhls from comment #9) Open a new bug
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.