From owner-freebsd-ports@FreeBSD.ORG Tue Jun 28 21:33:33 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72B8C106566B for ; Tue, 28 Jun 2011 21:33:33 +0000 (UTC) (envelope-from niclas.zeising@gmail.com) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id E79758FC08 for ; Tue, 28 Jun 2011 21:33:32 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 30C4840023 for ; Tue, 28 Jun 2011 23:33:32 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 263B940021; Tue, 28 Jun 2011 23:33:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,FREEMAIL_FROM autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id EF63C40022; Tue, 28 Jun 2011 23:30:03 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id B28D2119C08; Tue, 28 Jun 2011 23:28:46 +0200 (CEST) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 5DA3C12B1E5; Tue, 28 Jun 2011 23:28:45 +0200 (CEST) Message-ID: <4E0A477B.3060008@gmail.com> Date: Tue, 28 Jun 2011 23:28:27 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Eric McCorkle References: <4E0679AA.20100@shadowsun.net> <4E06863F.7010104@FreeBSD.org> <4E0A2172.7000800@daemonic.se> <86k4c5epbm.fsf@gmail.com> <4E0A343C.6000008@gmail.com> <4E0A4328.3000103@shadowsun.net> In-Reply-To: <4E0A4328.3000103@shadowsun.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-ports@freebsd.org Subject: -Qunused-arguments and clang X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2011 21:33:33 -0000 [Changing subject since previous was erroneous] On 2011-06-28 23:10, Eric McCorkle wrote: > On 6/28/11 4:06 PM, Niclas Zeising wrote: >> On 2011-06-28 21:19, Pan Tsu wrote: >>> Niclas Zeising writes: >>> >>>> Sorry for hijacking this thread, and cross posting. >>>> >>>> On 2011-06-26 03:07, Gabor PALI wrote: >>>>> >>>>> >>>>>> With Clang, an error occurs in one of the configure scripts, because >>>>>> Clang warns about unused command-line arguments, and the configure >>>>>> script assumes that to be a compiler error. You can deal with >>>>>> this by >>>>>> adding -Qunused-parameter to CFLAGS. >>>>> >>>>> Thanks for investigating this. >>>>> >>>> >>>> This should probably be made the default, at least for ports when clang >>>> is compiled, since the output generated when not using >>>> -Qunused-parameter confuses configure scripts, and stops at least >>>> FireFox 5 from compiling, that I know of. >>> >>> Do you use ccache? Try without. >>> >>> For example, the combo confuses libtool >>> >> >> It has nothing to do with cccache. The issue is that clang by default >> warns when passed flags (-std= -f -W etc.) that's not used during the >> compilation/linking. This can be silenced with -Qunused-arguments, and >> if not, it confuses configure scripts that believe this is an error in >> the code it uses to test for features. >> >> Regards! > > Example: In the GHC port, the configure script tries to figure out > whether the ISA supports PC-relative indexing. It does this by > generating a simple program, which contains some asm containing > PC-relative indexing, compiling it, and seeing if the compiler generates > a warning. If clang warns about unused arguments, then the configure > script assumes (falsely) that the ISA does not support PC-relative > indexing, and generates bad assembly code, which causes trouble downstream. Firefox 5 does similar things, but it's looking for pc relative addressing instead, which is supported on my test system, although without -Qunused-arguments the configure script thinks otherwise, and generates bad asm. I think that option should be added by default, since this is a big difference from gcc, and bound to cause trouble in several places. Regards! -- Niclas