svn commit: r218984 - head/lib/librt

Bruce Evans brde at optusnet.com.au
Wed Feb 23 23:50:11 UTC 2011


On Wed, 23 Feb 2011, Dimitry Andric wrote:

> On 2011-02-23 23:13, Bruce Evans wrote:
>> Now found it easly using gcc -v.  gcc -c -v foo.c produces "... /usr/bin/as
>> -o foo.o /var/tmp/whatever.s", but gcc -c -v foo.s produces "... 
>> /usr/bin/as
>> -gdwarf2 -o foo.o foo.s".  gcc's generation of -gdwarf2 is inconsistent
>> with itself.  Do we use a nonstandard not-gdwarf2 option for the usual case
>> but forget to change this for asm files?
>
> I don't think so, but there is simply no need to pass '-g' in the gcc
> invocation that assembles and links the .s file, since the debug info is
> already embedded in the .s file itself.

Except I want to write "cc ${CFLAGS} -o foo *.s *.c [*.o]" and not have
variant ${CFLAGS} for *.s and *.c.  It is a nice feature of cc that you
can use the same ${CFLAGS} for *.[cos...] in most contexts, and FreeBSD
.mk files depend on this.

> Apparently, if you use --gdwarf2 with GNU as 2.15, it messes up the
> already existing debug info.  It looks like 2.17.50 has no such problem,
> though.

So we won't worry much about this.  Does new binutils/as completely ignore
--gdwarf2 iff the asm file already has suitable debugging info?  I would
have expected at least an error message if the debugging info says --gother
and you try to add or change to --gdwarf2.  Normal debugging info doesn't
seem to have any id to distinguish its type.

Bruce


More information about the svn-src-head mailing list