qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v1 31/39] tcg/plugins: enable by default for TCG builds


From: Thomas Huth
Subject: Re: [PATCH v1 31/39] tcg/plugins: enable by default for TCG builds
Date: Wed, 7 Jul 2021 06:32:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 06/07/2021 16.58, Alex Bennée wrote:
Aside from a minor bloat to file size the ability to have TCG plugins
has no real impact on performance unless a plugin is actively loaded.
Even then the libempty.so plugin shows only a minor degradation in
performance caused by the extra book keeping the TCG has to do to keep
track of instructions. As it's a useful feature lets just enable it by
default and reduce our testing matrix a little.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v2
   - properly handle plugins being ""
   - make the test for linker support handle default case
   - move linker tests to before the glib-modules test
---
  docs/devel/tcg-plugins.rst |   3 +-
  configure                  | 125 ++++++++++++++++++++-----------------
  .gitlab-ci.d/buildtest.yml |  23 -------
  3 files changed, 71 insertions(+), 80 deletions(-)

diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst
index 18c6581d85..0cd77c77d2 100644
--- a/docs/devel/tcg-plugins.rst
+++ b/docs/devel/tcg-plugins.rst
@@ -71,7 +71,8 @@ API
  Usage
  =====
-The QEMU binary needs to be compiled for plugin support::
+Any QEMU binary with TCG support has plugins enabled by default.
+Earlier releases needed to be explicitly enabled with::
configure --enable-plugins diff --git a/configure b/configure
index 9d72b31a9f..0ce6c1ff65 100755
--- a/configure
+++ b/configure
@@ -429,7 +429,7 @@ libxml2="auto"
  debug_mutex="no"
  libpmem="auto"
  default_devices="true"
-plugins="no"
+plugins="$default_feature"
  fuzzing="no"
  rng_none="no"
  secret_keyring="$default_feature"
@@ -3085,6 +3085,73 @@ for drv in $audio_drv_list; do
      esac
  done
+##########################################
+# plugin linker support probe
+
+if test "$plugins" != "no"; then
+
+    #########################################
+    # See if --dynamic-list is supported by the linker
+
+    ld_dynamic_list="no"
+    if test "$static" = "no" ; then
+        cat > $TMPTXT <<EOF
+{
+  foo;
+};
+EOF
+
+        cat > $TMPC <<EOF
+#include <stdio.h>
+void foo(void);
+
+void foo(void)
+{
+  printf("foo\n");
+}
+
+int main(void)
+{
+  foo();
+  return 0;
+}
+EOF
+
+        if compile_prog "" "-Wl,--dynamic-list=$TMPTXT" ; then
+            ld_dynamic_list="yes"
+        fi
+    fi
+
+    #########################################
+    # See if -exported_symbols_list is supported by the linker
+
+    ld_exported_symbols_list="no"
+    if test "$static" = "no" ; then
+        cat > $TMPTXT <<EOF
+  _foo
+EOF
+
+        if compile_prog "" "-Wl,-exported_symbols_list,$TMPTXT" ; then
+            ld_exported_symbols_list="yes"
+        fi
+    fi
+
+    if test "$ld_dynamic_list" = "no" &&
+       test "$ld_exported_symbols_list" = "no" ; then
+        if test "$plugins" = "yes"; then
+            error_exit \
+                "Plugin ($plugins) support requires dynamic linking and specifying 
a set of symbols " \

Printing "($plugins)" here does not make much sense to me (it will always result in "(yes)", won't it?) ... but apart from that, the patch looks fine to me.

So with that "($plugins)" removed:

Reviewed-by: Thomas Huth <thuth@redhat.com>




reply via email to

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