From owner-freebsd-arm@FreeBSD.ORG Sat Jul 6 05:09:11 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 96FDD90C for ; Sat, 6 Jul 2013 05:09:11 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id 2B1981797 for ; Sat, 6 Jul 2013 05:09:10 +0000 (UTC) Received: from server.rulingia.com (c220-239-237-213.belrs5.nsw.optusnet.com.au [220.239.237.213]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id r66593XU011418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 6 Jul 2013 15:09:04 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id r6658tJ5089371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 6 Jul 2013 15:08:56 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id r6658t1a089370 for freebsd-arm@freebsd.org; Sat, 6 Jul 2013 15:08:55 +1000 (EST) (envelope-from peter) Date: Sat, 6 Jul 2013 15:08:55 +1000 From: Peter Jeremy To: freebsd-arm@freebsd.org Subject: Re: buildworld failure on arm/armv6 using gcc Message-ID: <20130706050855.GQ39302@server.rulingia.com> References: <20130706013348.GP39302@server.rulingia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="itqfrb9Qq3wY07cp" Content-Disposition: inline In-Reply-To: <20130706013348.GP39302@server.rulingia.com> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jul 2013 05:09:11 -0000 --itqfrb9Qq3wY07cp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013-Jul-06 11:33:48 +1000, Peter Jeremy wrote: >I'm getting the following error trying to build either r252698 >(natively) or r252781 (cross) for my RPi with gcc (ie >WITHOUT_CLANG=3Dyes). 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_at= omic.o): In function `svn_named_atomic__cmpxchg': >named_atomic.c:(.text+0xf0): undefined reference to `__sync_val_compare_an= d_swap_8' >/usr/obj/usr/src/usr.bin/svn/svn/../lib/libsvn_subr/libsvn_subr.a(named_at= omic.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_at= omic.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 fu= nction `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. --=20 Peter Jeremy --itqfrb9Qq3wY07cp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlHXpmcACgkQ/opHv/APuIfhkACfWYL/jeeIv9pj04MoC6BkpPy2 Rg0An143IyeSHXHxQJTp8nvklbJdhqtL =QJ4j -----END PGP SIGNATURE----- --itqfrb9Qq3wY07cp--