From owner-freebsd-current@FreeBSD.ORG Thu Aug 15 18:32:25 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 22FEEF03; Thu, 15 Aug 2013 18:32:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC4C2180; Thu, 15 Aug 2013 18:32:24 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id a12so839083wgh.30 for ; Thu, 15 Aug 2013 11:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=GThbdLXGADfuGViiE2ynlJ96jounnX4Y10VXBBI1Yow=; b=KjQQv5YgcyO+FyIAJ4LeOfUT1roWFrx1BucVqGD35jQ58LKRv0rzb8GmKhP/sOBjt3 GNumOl0YQIQ6AZ5WAHOEb60hNh8GQarTzPBdCjMJKP327pYSBFB8xMW9rTR5wN5PNdXm AJsSt0o5VSnwRJFnZSscZI5tPyEU1wv6U+UkkrBNASfJIC8pKzg2D3xYZpk39jn3G3Ci njHTOna/XtKGnY2Y2oKuo73XjYI7CnXjnzLBavn/ces4OpRhZfk+gsoZz0IuTx8KpqzW i63y93tE4H5UoulwBe3X2LRHIIJPj+cuwKdIz9T/WAj0ihQ3IkKQcc4Xa1jZlJiYuDX1 75EA== MIME-Version: 1.0 X-Received: by 10.194.48.74 with SMTP id j10mr1253101wjn.41.1376591542684; Thu, 15 Aug 2013 11:32:22 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.116.136 with HTTP; Thu, 15 Aug 2013 11:32:22 -0700 (PDT) In-Reply-To: <17A40261-A0DA-4070-990F-0D0777A5BE44@FreeBSD.org> References: <17A40261-A0DA-4070-990F-0D0777A5BE44@FreeBSD.org> Date: Thu, 15 Aug 2013 11:32:22 -0700 X-Google-Sender-Auth: xNr1v2oL4M4cWQUOT7jkNZv58XE Message-ID: Subject: Re: building i386 world on amd64 host: failed @svn From: Adrian Chadd To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-current@freebsd.org CURRENT" , Dmitry Morozovsky , Peter Wemm X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 18:32:25 -0000 Oh, _this_ is the cause! Cool. I wondered about it. Thanks for chasing this down! -adrian On 15 August 2013 11:13, Dimitry Andric wrote: > On Jul 28, 2013, at 15:15, Dmitry Morozovsky wrote: > ... > > on my builder I have consistent error: > > > > > /usr/obj/i386.i386/FreeBSD/pristine/src.current/usr.bin/svn/svn/../lib/libsvn_subr/libsvn_subr.a(named_atomic.o): > > In function `svn_named_atomic__cmpxchg': > > named_atomic.c:(.text+0xed): undefined reference to > > `__sync_val_compare_and_swap_8' > > > /usr/obj/i386.i386/FreeBSD/pristine/src.current/usr.bin/svn/svn/../lib/libsvn_subr/libsvn_subr.a(named_atomic.o): > > In function `svn_named_atomic__add': > > named_atomic.c:(.text+0x193): undefined reference to > `__sync_add_and_fetch_8' > > > /usr/obj/i386.i386/FreeBSD/pristine/src.current/usr.bin/svn/svn/../lib/libsvn_subr/libsvn_subr.a(named_atomic.o): > > In function `svn_named_atomic__write': > > named_atomic.c:(.text+0x1f3): undefined reference to > > `__sync_lock_test_and_set_8' > > After a bit of private conversation with Dmitry, it turned out he was > building using WITHOUT_CLANG, e.g. gcc is used for everything. Now, > this is *not* a problem specific to cross-building: head will not build > on i386 with gcc at all! It results in exactly the same error shown > above. > > This is because Subversion has a few wrapper routines for atomic > operations, and these are implemented in terms of the __sync_xxx > compiler builtins, since usr.bin/svn/svn_private_config.h has > SVN_HAS_ATOMIC_BUILTINS defined. On i386, gcc apparently cannot inline > the 64 bit versions of these builtins, so it inserts a call to an > external function instead, leading to a link error. > > Eventually, we could put such functions in libc, but for now it might be > better to turn off the SVN_HAS_ATOMIC_BUILTINS define in case of !clang > && i386, e.g.: > > Index: usr.bin/svn/svn_private_config.h > =================================================================== > --- usr.bin/svn/svn_private_config.h (revision 254300) > +++ usr.bin/svn/svn_private_config.h (working copy) > @@ -153,7 +153,9 @@ > #define SVN_FS_WANT_DB_PATCH 14 > > /* Define if compiler provides atomic builtins */ > +#if defined(__i386__) && !defined(__clang__) > #define SVN_HAS_ATOMIC_BUILTINS 1 > +#endif > > /* Is GNOME Keyring support enabled? */ > /* #undef SVN_HAVE_GNOME_KEYRING */ > > Alternatively, we could attempt to figure out why gcc doesn't want to > inline those 64 bit builtins on FreeBSD. It seems to have no problem > doing so on the first Linux box I tried... > > -Dimitry > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >