From owner-freebsd-ports@FreeBSD.ORG Tue Jun 28 21:10:01 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 A01651065674 for ; Tue, 28 Jun 2011 21:10:01 +0000 (UTC) (envelope-from eric@shadowsun.net) Received: from mail.atlantawebhost.com (dns1.atlantawebhost.com [66.223.40.39]) by mx1.freebsd.org (Postfix) with ESMTP id 506138FC17 for ; Tue, 28 Jun 2011 21:10:01 +0000 (UTC) Received: (qmail 5279 invoked from network); 28 Jun 2011 17:10:00 -0400 Received: from yktgi01e0-s5.watson.ibm.com (HELO atom-edge.watson.ibm.com) (129.34.20.19) by mail.atlantawebhost.com with SMTP; 28 Jun 2011 17:10:00 -0400 Message-ID: <4E0A4328.3000103@shadowsun.net> Date: Tue, 28 Jun 2011 17:10:00 -0400 From: Eric McCorkle User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: freebsd-ports@freebsd.org References: <4E0679AA.20100@shadowsun.net> <4E06863F.7010104@FreeBSD.org> <4E0A2172.7000800@daemonic.se> <86k4c5epbm.fsf@gmail.com> <4E0A343C.6000008@gmail.com> In-Reply-To: <4E0A343C.6000008@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: -Qunused-parameter and clang (was Re: GHC Port on 9-CURRENT) 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:10:01 -0000 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.