Date: Sun, 15 Jul 2012 21:08:39 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Dimitry Andric <dim@freebsd.org> Cc: freebsd-hackers@freebsd.org, Jakub Lach <jakub_lach@mailplus.pl> Subject: Re: Clang '-g' unused warnings in FreeBSD (linking) Message-ID: <20120715180839.GK2338@deviant.kiev.zoral.com.ua> In-Reply-To: <5002FEB3.3040708@FreeBSD.org> References: <1342359546590-5727055.post@n5.nabble.com> <5002FEB3.3040708@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--rbnuKbTS42rgQRRy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 15, 2012 at 07:32:35PM +0200, Dimitry Andric wrote: > On 2012-07-15 15:39, Jakub Lach wrote: > > While this is old "bug" upstream: > >=20 > > http://llvm.org/bugs/show_bug.cgi?id=3D8611 > >=20 > > http://llvm.org/bugs/show_bug.cgi?id=3D8630 > >=20 > > Here,=20 > >=20 > > (FreeBSD clang version 3.1 (branches/release_31 156863) 20120523 > > Target: x86_64-unknown-freebsd9.0) > >=20 > > Passing -g during linking (which lot's of projects do by=20 > > including CFLAGS in linking) I still get=20 > >=20 > > "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=20 > > of getting answer :) > >=20 > > Is this intended behaviour?=20 >=20 > 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. >=20 > 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. >=20 > 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. Note that historical ld(1) did emited debugging information into resulting binary only if -g was specified, so the linker flag is not always 'meaningless'. I suspect that Solaris ld still behaves this way. --rbnuKbTS42rgQRRy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlADBycACgkQC3+MBN1Mb4hDWwCeOcKhBfpscY1ItVS13naZJh8T M/0AoOFkuXRg3zb7HrF+oXyrCzJ/md8/ =b+HK -----END PGP SIGNATURE----- --rbnuKbTS42rgQRRy--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120715180839.GK2338>