Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jul 2012 19:32:35 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Jakub Lach <jakub_lach@mailplus.pl>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Clang '-g' unused warnings in FreeBSD (linking)
Message-ID:  <5002FEB3.3040708@FreeBSD.org>
In-Reply-To: <1342359546590-5727055.post@n5.nabble.com>
References:  <1342359546590-5727055.post@n5.nabble.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5002FEB3.3040708>