[libvirt] building error
Eric Blake
eblake at redhat.com
Fri Jul 1 15:04:49 UTC 2011
On 06/30/2011 08:34 PM, Wen Congyang wrote:
>>> # rpm -qa 'systemtap*'
>>> systemtap-sdt-devel-1.2-9.el6.x86_64
>>
>> What does STAP_PROBE3 look like in your /usr/include/sys/sdt.h?
>>
>
> #if ! defined EXPERIMENTAL_KPROBE_SDT
> ....
> #define STAP_PROBE3_(probe,label,parm1,parm2,parm3) \
> do STAP_SEMAPHORE(probe) { \
> STAP_SDT_VOLATILE __typeof__((parm1)) arg1 = parm1; \
> STAP_SDT_VOLATILE __typeof__((parm2)) arg2 = parm2; \
> STAP_SDT_VOLATILE __typeof__((parm3)) arg3 = parm3; \
So is it this variant...
> #else /* ! defined EXPERIMENTAL_KPROBE_SDT */
> ...
> #define STAP_PROBE3_(probe,label,parm1,parm2,parm3) \
> do STAP_SEMAPHORE(probe) { \
> __extension__ struct {size_t arg1 __attribute__((aligned(8))); \
> size_t arg2 __attribute__((aligned(8))); \
> size_t arg3 __attribute__((aligned(8)));} \
> stap_probe3_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3}; \
...or this variant that got used? Would you mind giving the relevant
portion of gcc -E output around the line that is failing, so we can see
the full macro expansion that the compiler doesn't like?
Looking back at your original report:
remote.c:2043: error: invalid initializer
- virNetServerClientGetFD(client), REMOTE_AUTH_POLKIT, ident);
+ virNetServerClientGetFD(client), REMOTE_AUTH_POLKIT, (char
*)ident);
and the declaration in question:
char ident[100];
I'm guessing it's the first variant, and that:
volatile __typeof__(ident) arg3 = ident;
is getting translated to:
volatile char[100] arg3 = ident;
which really is invalid, but that adding the cast to char* fixes things,
so that the compiler is then doing:
volatile char *arg3 = (char*)ident;
And if we really are dealing with a macro that broken, then I'm entirely
in favor of fixing our definition of PROBE to do the casting in advance,
rather than making all PROBE callers worry about broken <sys/sdt.h>.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110701/65950a9c/attachment-0001.sig>
More information about the libvir-list
mailing list