[Top][All Lists]
[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
- Re: [Qemu-devel] [PATCH v2 1/5] compiler: support Darwin weak references, (continued)
- [Qemu-devel] [PATCH v2 2/5] semaphore: implement fallback counting semaphores with mutex+condvar, Paolo Bonzini, 2012/11/02
- [Qemu-devel] [PATCH v2 5/5] vl: delay thread initialization after daemonization, Paolo Bonzini, 2012/11/02
- [Qemu-devel] [PATCH v2 3/5] qemu-timer: reinitialize timers after fork, Paolo Bonzini, 2012/11/02
- [Qemu-devel] [PATCH v2 4/5] vl: unify calls to init_timer_alarm, Paolo Bonzini, 2012/11/02
- Re: [Qemu-devel] [PATCH v2 0/5] Fixes for thread pool patches., Peter Maydell, 2012/11/02