qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 0/5] Fixes for thread pool patches.


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 0/5] Fixes for thread pool patches.
Date: Sat, 03 Nov 2012 16:51:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1

Il 03/11/2012 16:26, Blue Swirl ha scritto:
>> > It's a clang bug.  The error should be suppressed, since the function is
>> > used with the weak alias.
>> >
>> > Or try if adding "|| defined __clang__" to compiler.h fixes it.
> It does.

Yeah, I tested now Clang/Linux myself and reported it as
http://llvm.org/bugs/show_bug.cgi?id=14250.  With a simple testcase such
as this:

static int g()
{
    return 42;
}
typeof(g) f __attribute__((__weak__, __alias__("g")));


it's easy to see that the function is actually emitted---and with "g" as
the name, even:

    .file    "g2.c"
    .text
    .align    16, 0x90
    .type    g,@function
g:                                      # @g
    .cfi_startproc
# BB#0:
    movl    $42, %eax
    ret
.Ltmp0:
    .size    g, .Ltmp0-g
    .cfi_endproc

    .weak    f
f = g
    .section    ".note.GNU-stack","",@progbits

> Maybe __APPLE__ should be replaced by __clang__, or can the
> problem also occur with GCC on Apple systems?

It can occur with GCC, though it will be just a "note" if I understand
correctly and not fail with -Werror.  No idea whether the generated code
would run, probably not.

My favorite fix is to just disable the warning, otherwise make the
function inline.

Paolo



reply via email to

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