Skip to contentSkip to conversation

meson: Convert undefsym.sh to undefsym.py

PATCH Superseded [email protected] 1 participant 1 message Aug 28, 2020 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: Convert undefsym.sh to undefsym.py

From: Yonggang Luo <[email protected]>

undefsym.sh are not msys2 compatible, convert it to python script

---
 meson.build         |  2 +-
 scripts/undefsym.py | 70 +++++++++++++++++++++++++++++++++++++++++++++
 scripts/undefsym.sh | 20 -------------
 3 files changed, 71 insertions(+), 21 deletions(-)
 create mode 100644 scripts/undefsym.py
 delete mode 100755 scripts/undefsym.sh
meson.build +1 -1
index 74f8ea0c2e..9d8419bf82 100644
@@ -859,7 +859,7 @@ foreach d, list : modules
 endforeach
 
 nm = find_program('nm')
-undefsym = find_program('scripts/undefsym.sh')
+undefsym = find_program('scripts/undefsym.py')
 block_syms = custom_target('block.syms', output: 'block.syms',
                              input: [libqemuutil, block_mods],
                              capture: true,
scripts/undefsym.py new file +70 -0

70 lines not on this page · raw message

scripts/undefsym.sh deleted +0 -20
deleted file mode 100755
index b9ec332e95..0000000000
@@ -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)
Signature · 1 line
2.27.0.windows.1