From owner-freebsd-stable@FreeBSD.ORG Wed Oct 24 10:05:40 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F4EDD1F for ; Wed, 24 Oct 2012 10:05:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id BB1D28FC16 for ; Wed, 24 Oct 2012 10:05:39 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:b489:24:8697:7e27] (unknown [IPv6:2001:7b8:3a7:0:b489:24:8697:7e27]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id EFD625C59; Wed, 24 Oct 2012 12:05:37 +0200 (CEST) Message-ID: <5087BD71.9090002@FreeBSD.org> Date: Wed, 24 Oct 2012 12:05:37 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Volodymyr Kostyrko Subject: Re: wine, gcc and clang with CPUTYPE References: <50879F62.2010004@gmail.com> In-Reply-To: <50879F62.2010004@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 10:05:40 -0000 On 2012-10-24 09:57, Volodymyr Kostyrko wrote: > I just have taken some time to inspect CPUTYPE support for clang. It > seems to me that clang generates incorrect code in some cases. > > The first failure point I discovered was inability to build gcc from > sources or compile something with gcc. Code produced by gcc seem to fail > whether this was gcc compiled from bootstrap or anything else: > > http://lists.freebsd.org/pipermail/freebsd-multimedia/2012-October/013469.html Can you attempt to figure out what the illegal instruction was, in that case? > I started testing by commenting out CPUTYPE in make.conf. After first > rebuild I also updated the ports and installed new version of > wine-devel. And to my surprise it works like a charm. Rolling back to > the world built with CPUTYPE=native makes wine break again. > > To my surprise CPUTYPE was not the cause of wine failure per se. Wine > continues to work for k6, k6-3, athlon and athlon-tbird. But it > completely fails when the world was built with athlon-4 and athlon-xp. > > Trying to recompile gcc I also found that everything works and yet again > up to the athlon-tbird. > > My conclusion is: clang incorrectly produces code within one of core > libraries (I haven't tested which one yet, but I suspect libgcc_s.so) > when optimizing for athlon-4 or athlon-xp. On the problematic athlons, can you please post the exact CPUIDs from dmesg? If you have WITH_CLANG_EXTRAS enabled, please also post the output of "opt -version".