qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] rules.mak: Fix DSO build by pulling in archi


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2] rules.mak: Fix DSO build by pulling in archive symbols
Date: Mon, 1 Sep 2014 12:46:30 +0100

On 1 September 2014 12:28, Paolo Bonzini <address@hidden> wrote:
> Il 01/09/2014 12:59, Peter Maydell ha scritto:
>>
>> warning: 
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
>> no name list
>> warning: 
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
>> no name list
>> warning: 
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
>> no name list
>>   LINK  qemu-nbd
>
> Is this with --enable-modules or without?

Both with and without.

> Can you find out which invocations are printing the error?  It could be
> one of "nm -P -g block/FILENAME.mo" or "nm -P -g libqemuutil.a" or "nm
> -P -g libqemustub.a".

It produces the warnings on libqemuutil.a but not the others.

> I found the error in
> http://www.opensource.apple.com/source/cctools/cctools-855/misc/nm.c
>
>         if(st == NULL || st->nsyms == 0){
>             warning("no name list");
>             return;
>         }
>
> I guess this could match the first part of this paragraph in the POSIX
> spec: "If no symbolic information is available for a valid input file,
> the nm utility shall report that fact, but not consider it an error
> condition".  I guess we could use "2>&1" to shut it up, but it would be
> nice to know what the problem is.

I narrowed down the warning to some of the individual .o files
that end up in the .a:

manooth$ nm util/host-utils.o
warning: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
manooth$ nm util/getauxval.o
warning: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list
manooth$ nm trace/generated-tracers.o
warning: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm:
no name list

I think what it doesn't like is when we have a .c file that compiles
into an effectively empty object file because all the functions etc
in it have been #ifdefed out, as happens with host-utils.c when
CONFIG_INT128 is not defined, and with getauxval.c when
CONFIG_GETAUXVAL is not defined, and with generated-tracers.c
when there aren't any defined tracepoints.

ranlib doesn't like that either (this one's a warning we've had for
a long time):

  AR    libqemuutil.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(generated-tracers.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(host-utils.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
file: libqemuutil.a(getauxval.o) has no symbols

So we could fix this by not compiling empty files...

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]