[PATCH v2 05/13] qemu-plugin.h: remove GCC < 4

marcandre.lureau@redhat.com posted 13 patches 5 years, 2 months ago
There is a newer version of this series
[PATCH v2 05/13] qemu-plugin.h: remove GCC < 4
Posted by marcandre.lureau@redhat.com 5 years, 2 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Since commit efc6c07 ("configure: Add a test for the minimum compiler
version"), QEMU explicitely depends on GCC >= 4.8.

(clang >= 3.8 advertizes itself as GCC >= 4.2 compatible)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 include/qemu/qemu-plugin.h | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h
index bab8b0d4b3..5775e82c4e 100644
--- a/include/qemu/qemu-plugin.h
+++ b/include/qemu/qemu-plugin.h
@@ -28,13 +28,8 @@
   #endif
   #define QEMU_PLUGIN_LOCAL
 #else
-  #if __GNUC__ >= 4
-    #define QEMU_PLUGIN_EXPORT __attribute__((visibility("default")))
-    #define QEMU_PLUGIN_LOCAL  __attribute__((visibility("hidden")))
-  #else
-    #define QEMU_PLUGIN_EXPORT
-    #define QEMU_PLUGIN_LOCAL
-  #endif
+  #define QEMU_PLUGIN_EXPORT __attribute__((visibility("default")))
+  #define QEMU_PLUGIN_LOCAL  __attribute__((visibility("hidden")))
 #endif
 
 typedef uint64_t qemu_plugin_id_t;
-- 
2.29.0


Re: [PATCH v2 05/13] qemu-plugin.h: remove GCC < 4
Posted by Peter Maydell 5 years, 2 months ago
On Thu, 26 Nov 2020 at 11:30, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Since commit efc6c07 ("configure: Add a test for the minimum compiler
> version"), QEMU explicitely depends on GCC >= 4.8.
>
> (clang >= 3.8 advertizes itself as GCC >= 4.2 compatible)
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/qemu/qemu-plugin.h | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)

This is an interesting case, because it's a header intended
for external use (people compiling plugins), not part of
QEMU proper. I don't know whether we want to impose the
same clang/gcc requirements on plugin builders, though it's
probably not a bad idea to do so. Alex ?

thanks
-- PMM

Re: [PATCH v2 05/13] qemu-plugin.h: remove GCC < 4
Posted by Daniel P. Berrangé 5 years, 2 months ago
On Thu, Nov 26, 2020 at 11:57:14AM +0000, Peter Maydell wrote:
> On Thu, 26 Nov 2020 at 11:30, <marcandre.lureau@redhat.com> wrote:
> >
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Since commit efc6c07 ("configure: Add a test for the minimum compiler
> > version"), QEMU explicitely depends on GCC >= 4.8.
> >
> > (clang >= 3.8 advertizes itself as GCC >= 4.2 compatible)
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  include/qemu/qemu-plugin.h | 9 ++-------
> >  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> This is an interesting case, because it's a header intended
> for external use (people compiling plugins), not part of
> QEMU proper. I don't know whether we want to impose the
> same clang/gcc requirements on plugin builders, though it's
> probably not a bad idea to do so. Alex ?

IIUC, we expect that the plugins are built specifically to go with
the QEMU you have built. With that in mind, it looks reasonable to
assume the same compiler toolchain versions for both.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Re: [PATCH v2 05/13] qemu-plugin.h: remove GCC < 4
Posted by Peter Maydell 5 years, 2 months ago
On Thu, 26 Nov 2020 at 12:12, Daniel P. Berrangé <berrange@redhat.com> wrote:
> On Thu, Nov 26, 2020 at 11:57:14AM +0000, Peter Maydell wrote:
> > This is an interesting case, because it's a header intended
> > for external use (people compiling plugins), not part of
> > QEMU proper. I don't know whether we want to impose the
> > same clang/gcc requirements on plugin builders, though it's
> > probably not a bad idea to do so. Alex ?
>
> IIUC, we expect that the plugins are built specifically to go with
> the QEMU you have built.

No, the point of the plugin interface is that it actually is
a (constrained) stable ABI with version-querying and checking
so you don't have to build a plugin against the exact matching
QEMU version. (But "don't use really ancient gcc" doesn't seem
like a very major thing to ask of its users.)

thanks
-- PMM

Re: [PATCH v2 05/13] qemu-plugin.h: remove GCC < 4
Posted by Alex Bennée 5 years, 2 months ago
Peter Maydell <peter.maydell@linaro.org> writes:

> On Thu, 26 Nov 2020 at 12:12, Daniel P. Berrangé <berrange@redhat.com> wrote:
>> On Thu, Nov 26, 2020 at 11:57:14AM +0000, Peter Maydell wrote:
>> > This is an interesting case, because it's a header intended
>> > for external use (people compiling plugins), not part of
>> > QEMU proper. I don't know whether we want to impose the
>> > same clang/gcc requirements on plugin builders, though it's
>> > probably not a bad idea to do so. Alex ?
>>
>> IIUC, we expect that the plugins are built specifically to go with
>> the QEMU you have built.
>
> No, the point of the plugin interface is that it actually is
> a (constrained) stable ABI with version-querying and checking
> so you don't have to build a plugin against the exact matching
> QEMU version. (But "don't use really ancient gcc" doesn't seem
> like a very major thing to ask of its users.)

Quite. But I agree using a GCC from this decade seems reasonable
especially as the feature has only been in QEMU for a few cycles.

Acked-by: Alex Bennée <alex.bennee@linaro.org>
          
-- 
Alex Bennée