Skip to contentSkip to conversation

meson: Convert undefsym.sh to undefsym.py

PATCH In review [email protected] 2 participants 2 messages Aug 28, 2020 Arm/Amlogic Meson SoC support

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 | 57 +++++++++++++++++++++++++++++++++++++++++++++
 scripts/undefsym.sh | 20 ----------------
 3 files changed, 58 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 +57 -0

57 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
#1 lore raw
Quoted 13 lines · On Fri, 28 Aug 2020 at 15:11, <[email protected]> wrote:

From: Yonggang Luo <[email protected]>

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

scripts/undefsym.py new file +0 -0
new file mode 100644
index 0000000000..c690f88c7a

scripts/undefsym.py line 3

Quoted 3 lines
scripts/undefsym.py new file +3 -0
@@ -0,0 +1,57 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+

All new files need to start with a header comment giving the copyright and license information, please.

thanks
-- PMM