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

Jan Beich <[email protected]>
Newsgroups gmane.os.freebsd.devel.ppc,gmane.os.freebsd.devel.ports
Message-ID <[email protected]>
Mark Millard via freebsd-ppc <[email protected]> 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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ppc
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.