From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 15 17:32:39 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A2F31065670 for ; Sun, 15 Jul 2012 17:32:39 +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 B64D88FC0C for ; Sun, 15 Jul 2012 17:32:38 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e862:47d8:b5d0:2580] (unknown [IPv6:2001:7b8:3a7:0:e862:47d8:b5d0:2580]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E0CFF5C37; Sun, 15 Jul 2012 19:32:37 +0200 (CEST) Message-ID: <5002FEB3.3040708@FreeBSD.org> Date: Sun, 15 Jul 2012 19:32:35 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120619 Thunderbird/14.0 MIME-Version: 1.0 To: Jakub Lach References: <1342359546590-5727055.post@n5.nabble.com> In-Reply-To: <1342359546590-5727055.post@n5.nabble.com> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Clang '-g' unused warnings in FreeBSD (linking) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 17:32:39 -0000 On 2012-07-15 15:39, Jakub Lach wrote: > While this is old "bug" upstream: > > http://llvm.org/bugs/show_bug.cgi?id=8611 > > http://llvm.org/bugs/show_bug.cgi?id=8630 > > Here, > > (FreeBSD clang version 3.1 (branches/release_31 156863) 20120523 > Target: x86_64-unknown-freebsd9.0) > > Passing -g during linking (which lot's of projects do by > including CFLAGS in linking) I still get > > "clang: warning: argument unused during compilation: '-g'" ... On 2012-07-15 16:04, Jakub Lach wrote: > Maybe I should include a question too, so I have better chance > of getting answer :) > > Is this intended behaviour? This is a bit typical issue for clang, which originates in the way it parses command line arguments: different parts of the compiler stages 'claim' arguments, and any that are left at the end are reported as unused. Regarding the LLVM PRs you mentioned, one could argue that passing '-g' to the link stage is nonsensical, since ld cannot add debug information, it can only remove it (via the '-s' flag). But since it is apparently common to do this, it may be a bit too annoying to complain about it. In any case, upstream fixed it for Linux, but not for any other operating system. I will make a similar fix for FreeBSD, and send it upstream too.