summary refs log tree commit diff stats
path: root/scripts/undefsym.sh
diff options
context:
space:
mode:
authorYonggang Luo <luoyonggang@gmail.com>2020-09-03 01:00:50 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-08 11:43:16 +0200
commit604f3e4e90c011a6b94fdc1d13700f3ec2375f2a (patch)
tree348a44a3fab17c590536a4c3d8be0337322bdac8 /scripts/undefsym.sh
parent54c9e41d47daa38219a53311cbc1c4e602709aee (diff)
downloadfocaccia-qemu-604f3e4e90c011a6b94fdc1d13700f3ec2375f2a.tar.gz
focaccia-qemu-604f3e4e90c011a6b94fdc1d13700f3ec2375f2a.zip
meson: Convert undefsym.sh to undefsym.py
Shell scripts are not easily invoked from the build process
on MSYS, so convert undefsym.sh to a python script.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200902170054.810-3-luoyonggang@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scripts/undefsym.sh')
-rwxr-xr-xscripts/undefsym.sh20
1 files changed, 0 insertions, 20 deletions
diff --git a/scripts/undefsym.sh b/scripts/undefsym.sh
deleted file mode 100755
index b9ec332e95..0000000000
--- a/scripts/undefsym.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /usr/bin/env bash
-
-# Before a shared module's DSO is produced, a static library is built for it
-# and passed to this script.  The script generates -Wl,-u options to force
-# the inclusion of symbol from libqemuutil.a if the shared modules need them,
-# This is necessary because the modules may use functions not needed by the
-# executable itself, which would cause the function to not be linked in.
-# Then the DSO loading would fail because of the missing symbol.
-
-if test $# -le 2; then
-  exit 0
-fi
-
-NM=$1
-staticlib=$2
-shift 2
-# Find symbols defined in static libraries and undefined in shared modules
-comm -12 \
-  <( $NM -P -g $staticlib | awk '$2!="U"{print "-Wl,-u," $1}' | sort -u) \
-  <( $NM -P -g "$@" | awk '$2=="U"{print "-Wl,-u," $1}' | sort -u)