From owner-freebsd-current@FreeBSD.ORG Sat Nov 5 19:06:26 2011 Return-Path: Delivered-To: current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAD3F106564A for ; Sat, 5 Nov 2011 19:06:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6CFFD8FC14 for ; Sat, 5 Nov 2011 19:06:26 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:5502:9023:fa7c:ca0f] (unknown [IPv6:2001:7b8:3a7:0:5502:9023:fa7c:ca0f]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3E13B5C59; Sat, 5 Nov 2011 20:06:25 +0100 (CET) Message-ID: <4EB58932.1030309@FreeBSD.org> Date: Sat, 05 Nov 2011 20:06:26 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111031 Thunderbird/8.0 MIME-Version: 1.0 To: Kostik Belousov References: <20111104190912.GA21948@bewilderbeast.blackhelicopters.org> <4EB53803.2000205@FreeBSD.org> <20111105132816.GR50300@deviant.kiev.zoral.com.ua> In-Reply-To: <20111105132816.GR50300@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: current@FreeBSD.ORG Subject: Re: 9.0/i386 build failure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 05 Nov 2011 19:06:26 -0000 On 2011-11-05 14:28, Kostik Belousov wrote: > On Sat, Nov 05, 2011 at 02:20:03PM +0100, Dimitry Andric wrote: >> On 2011-11-04 20:09, Michael W. Lucas wrote: ... >>> : undefined reference to `__sync_add_and_fetch_4' ... > The system gcc was changed to assume march=486 some time ago. > I suppose that the current-9 system is before the change, see r198344. Yes, that is most likely the cause of this problem. It is reproducible if you set CC to 'gcc -march=i386' and CXX to 'g++ -march=i386'. At first, I thought it would be easily fixable, since when you use -march=i386, the macro __tune_i386__ is defined, so you can disable LLVM's use of atomic builtins. However, since r212286, libstdc++ is also configured to use atomic builtins, and any non-trivial C++ program will encounter this linking issue when compiling with -march=i386. A workaround could be this: Index: gnu/lib/libstdc++/config.h =================================================================== --- gnu/lib/libstdc++/config.h (revision 227112) +++ gnu/lib/libstdc++/config.h (working copy) @@ -671,7 +671,7 @@ /* #undef VERSION */ /* Define if builtin atomic operations are supported on this host. */ -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || (defined(__i386__) && !defined(__tune_i386__)) #define _GLIBCXX_ATOMIC_BUILTINS 1 #endif but unfortunately during the bootstrap stage, the system includes are used, not those in the source tree... At the moment I don't know a clean way out of this, except setting CC to 'gcc -march=i486' and CXX to 'g++ -march=i486', and then building the bootstrap-tools stage should at least complete successfully.