32-bit powerpc graphics/mesa-dri build failure (poudriere based): "error: cannot redeclare builtin function" (e.g., __sync_add_and_fetch_8)

Jan Beich jbeich at FreeBSD.org
Wed Jul 22 21:11:08 UTC 2020


Mark Millard via freebsd-ppc <freebsd-ppc at freebsd.org> writes:

> ../src/util/u_atomic.c:38:1: error: cannot redeclare builtin function '__sync_add_and_fetch_8'
> __sync_add_and_fetch_8(uint64_t *ptr, uint64_t val)
> ^
> ../src/util/u_atomic.c:38:1: note: '__sync_add_and_fetch_8' is a builtin with type 'long long (volatile long long *, long long, ...)'
> ../src/util/u_atomic.c:38:1: error: definition of builtin function '__sync_add_and_fetch_8'
> __sync_add_and_fetch_8(uint64_t *ptr, uint64_t val)
> ^
> ../src/util/u_atomic.c:51:1: error: cannot redeclare builtin function '__sync_sub_and_fetch_8'
> __sync_sub_and_fetch_8(uint64_t *ptr, uint64_t val)
> ^
> ../src/util/u_atomic.c:51:1: note: '__sync_sub_and_fetch_8' is a builtin with type 'long long (volatile long long *, long long, ...)'
> ../src/util/u_atomic.c:51:1: error: definition of builtin function '__sync_sub_and_fetch_8'
> __sync_sub_and_fetch_8(uint64_t *ptr, uint64_t val)
> ^
> ../src/util/u_atomic.c:64:1: error: cannot redeclare builtin function '__sync_val_compare_and_swap_8'
> __sync_val_compare_and_swap_8(uint64_t *ptr, uint64_t oldval, uint64_t newval)
> ^
> ../src/util/u_atomic.c:64:1: note: '__sync_val_compare_and_swap_8' is a builtin with type 'long long (volatile long long *, long long, long long, ...)'
> ../src/util/u_atomic.c:64:1: error: definition of builtin function '__sync_val_compare_and_swap_8'
> __sync_val_compare_and_swap_8(uint64_t *ptr, uint64_t oldval, uint64_t newval)
> ^
> 6 errors generated.

Try replacing files/patch-i386 with https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5464
On i386 (clang) one can sometimes avoid -latomic by bumping -march
(FreeBSD 11.4/12.2/13.0 defaults to i686) but powerpc (gcc) probably
can't use __sync* with 64-bit types without -latomic, making Meson
define MISSING_64BIT_ATOMICS to use src/util/u_atomic.c


More information about the freebsd-ppc mailing list