buildworld failure on arm/armv6 using gcc

Peter Jeremy peter at rulingia.com
Sat Jul 6 05:09:11 UTC 2013


On 2013-Jul-06 11:33:48 +1000, Peter Jeremy <peter at rulingia.com> wrote:
>I'm getting the following error trying to build either r252698
>(natively) or r252781 (cross) for my RPi with gcc (ie
>WITHOUT_CLANG=yes).

The problem goes away if I use clang but I understood gcc should still be
supported.

>/usr/obj/usr/src/usr.bin/svn/svn/../lib/libsvn_subr/libsvn_subr.a(named_atomic.o): In function `svn_named_atomic__cmpxchg':
>named_atomic.c:(.text+0xf0): undefined reference to `__sync_val_compare_and_swap_8'
>/usr/obj/usr/src/usr.bin/svn/svn/../lib/libsvn_subr/libsvn_subr.a(named_atomic.o): In function `svn_named_atomic__add':
>named_atomic.c:(.text+0x174): undefined reference to `__sync_add_and_fetch_8'
>/usr/obj/usr/src/usr.bin/svn/svn/../lib/libsvn_subr/libsvn_subr.a(named_atomic.o): In function `svn_named_atomic__write':
>named_atomic.c:(.text+0x1c0): undefined reference to `__sync_lock_test_and_set_8'
>/usr/obj/usr/src/usr.bin/svn/svn/../lib/libapr/libapr.a(builtins.o): In function `apr_atomic_dec32':
>builtins.c:(.text+0x90): undefined reference to `__sync_sub_and_fetch_4'
>*** Error code 1

I've split the failures into two categories:
 __sync_add_and_fetch_8
 __sync_lock_test_and_set_8
 __sync_val_compare_and_swap_8
these should be defined in /usr/src/sys/arm/arm/stdatomic.c (and
compiled into libcompiler_rt.a) but that file only defines 1-, 2- and
4-byte variants for userland armv6 (it looks like it fakes 8-byte
variants in the kernel by disabling interrupts).

I don't know ARM assembler well enough to know if there's any way to
do 64-bit atomic operations.  I suspect not.

 __sync_sub_and_fetch_4
There are references to __sync_sub_and_fetch() but I can't any sign of
a definition.  It looks like __sync_sub_and_fetch_4 is supposed to be
a gcc builtin so I'm not sure why it's being emitted without a definition.

>Tinberbox build are succeeding but I gather they are using clang.

It looks like it would be worthwhile building 9.x and head with both
gcc and clang to prevent this sort of regression.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20130706/0549b448/attachment.sig>


More information about the freebsd-arm mailing list