qemu-devel
[Top][All Lists]
Advanced

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

[PATCH] trace: use STAP_SDT_V2 to work around symbol visibility


From: Stefan Hajnoczi
Subject: [PATCH] trace: use STAP_SDT_V2 to work around symbol visibility
Date: Wed, 18 Nov 2020 17:48:09 +0000

QEMU binaries no longer launch successfully with recent SystemTap
releases. This is because modular QEMU builds link the sdt semaphores
into the main binary instead of into the shared objects where they are
used. The symbol visibility of semaphores is 'hidden' and the dynamic
linker prints an error during module loading:

  $ ./configure --enable-trace-backends=dtrace --enable-modules ...
  ...
  Failed to open module: 
/builddir/build/BUILD/qemu-4.2.0/s390x-softmmu/../block-curl.so: undefined 
symbol: qemu_curl_close_semaphore

The long-term solution is to generate per-module dtrace .o files and
link them into the module instead of the main binary.

In the short term we can define STAP_SDT_V2 so /usr/bin/dtrace produces
an .o file with 'default' symbol visibility instead of 'hidden'. This
workaround is small and easier to merge for QEMU 5.2.

Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: wcohen@redhat.com
Cc: fche@redhat.com
Cc: kraxel@redhat.com
Cc: rjones@redhat.com
Cc: mrezanin@redhat.com
Cc: ddepaula@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 trace/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/trace/meson.build b/trace/meson.build
index d5fc45c628..52be7c5b2c 100644
--- a/trace/meson.build
+++ b/trace/meson.build
@@ -44,7 +44,7 @@ foreach dir : [ '.' ] + trace_events_subdirs
       trace_dtrace_o = custom_target(fmt.format('trace-dtrace', 'o'),
                                      output: fmt.format('trace-dtrace', 'o'),
                                      input: trace_dtrace,
-                                     command: [ 'dtrace', '-o', '@OUTPUT@', 
'-G', '-s', '@INPUT@' ])
+                                     command: [ 'dtrace', '-DSTAP_SDT_V2', 
'-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ])
       trace_ss.add(trace_dtrace_o)
     endif
 
-- 
2.28.0


reply via email to

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