This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [libvirt] [PATCH] build: work around older systemtap header
- From: Josh Stone <jistone at redhat dot com>
- To: Eric Blake <eblake at redhat dot com>
- Cc: Matthias Bolte <matthias dot bolte at googlemail dot com>, libvir-list at redhat dot com, systemtap at sourceware dot org
- Date: Wed, 06 Jul 2011 09:29:56 -0700
- Subject: Re: [libvirt] [PATCH] build: work around older systemtap header
- References: <4E0D3241.7060009@cn.fujitsu.com> <1309556615-4362-1-git-send-email-eblake@redhat.com> <CABBrozgSB9FCZaeEOoacC0XU_czYbkw82kCtZLVsXuDzBw=rhw@mail.gmail.com> <4E1343EC.3000609@redhat.com> <4E13D07B.1050203@redhat.com> <4E148318.5070507@redhat.com>
On 07/06/2011 08:45 AM, Eric Blake wrote:
>> #define _SDT_ARGARRAY(x) (__builtin_classify_type (x) == 14 \
>> || __builtin_classify_type (x) == 5)
>>
>
> Too bad gcc doesn't document this builtin.
It's documented in the Internals manual:
http://gcc.gnu.org/onlinedocs/gccint/Varargs.html
http://gcc.gnu.org/viewcvs/trunk/gcc/typeclass.h?view=markup
>> So perhaps you could copy that macro and let your compatibility casting
>> do something like this:
>>
>> #define _SDT_CAST(x) \
>> __builtin_choose_expr (_SDT_ARGARRAY(x), (uintptr_t)(x), (x))
>
> That depends on gcc - so we'd have to provide a fallback define to a
> plain cast for other compilers. I'll keep that in mind if the current
> patch for libvirt (which doesn't use any gcc extensions) proves to be
> problematic.
Well, sdt.h itself uses such extensions, so you may not get far with
very different compilers anyway. But FWIW, it seems to work fine on
F15's clang-2.8.
> And we may still end up defining away the problem, by just stating
> that libvirt requires systemtap 1.4 or newer before libvirt will use
> systemtap.
I wouldn't blame you, if you can get away with that. We think the
current version of SDT is more sane overall, with better flexibility as
well as better resulting metadata.
Josh