Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 1/6] mpeg2dec: Fix global symbol tests
Date: Wed, 30 Jan 2019 22:50:11 -0800	[thread overview]
Message-ID: <20190131065016.21887-1-raj.khem@gmail.com> (raw)

Rewrite the public symbol check to verify the shared libraries, to check for
more things, and to avoid duplication; fixes make check on ARM

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../files/61_global-symbol-test.patch         | 70 +++++++++++++++++++
 .../mpeg2dec/mpeg2dec_0.5.1.bb                |  1 +
 2 files changed, 71 insertions(+)
 create mode 100644 meta/recipes-multimedia/mpeg2dec/files/61_global-symbol-test.patch

diff --git a/meta/recipes-multimedia/mpeg2dec/files/61_global-symbol-test.patch b/meta/recipes-multimedia/mpeg2dec/files/61_global-symbol-test.patch
new file mode 100644
index 0000000000..00b667d336
--- /dev/null
+++ b/meta/recipes-multimedia/mpeg2dec/files/61_global-symbol-test.patch
@@ -0,0 +1,70 @@
+Rewrite the public symbol check to verify the shared libraries, to check for
+more things, and to avoid duplication; fixes make check on ARM
+
+Taken From
+https://sources.debian.org/src/mpeg2dec/0.5.1-8/debian/patches/61_global-symbol-test.patch/
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ test/globals |   42 +++++++++++++++++++++++++++---------------
+ 1 file changed, 27 insertions(+), 15 deletions(-)
+
+--- mpeg2dec.orig/test/globals
++++ mpeg2dec/test/globals
+@@ -1,4 +1,8 @@
+ #!/bin/sh
++# TODO
++# - fix checking of .a libs; problem is that "nm -g --defined-only" lists
++#   internal symbols; this can be solved by using objdump, but it's probably
++#   good enough to just run the tests on the shared lib
+ 
+ if test x"$srcdir" != x""; then
+     builddir="."	# running from make check, but it does not define that
+@@ -14,22 +18,30 @@ builddir=`cd $builddir;pwd`
+ 
+ error=0
+ 
+-bad_globals=`nm -g --defined-only $builddir/../libmpeg2/*.o |\
+-    awk '{if ($3) print $3}' | grep -v '^_\?mpeg2_'`
+-
+-if test x"$bad_globals" != x""; then
+-    echo BAD GLOBAL SYMBOLS:
+-    for s in $bad_globals; do echo $s; done
++# check_bad_public_symbols <symbol prefix> <lib file> [<lib file>...]
++#
++# checks public symbols in shared libs:
++# - allow prefix_anything
++# - reject _prefixanything
++# - allow _anything
++# - reject anything else
++#
++# NB: skips missing files
++check_bad_public_symbols() {
++    symbols_prefix="$1"
++    shift
++    lib_files=`ls "$@" 2>/dev/null`
++    [ -z "$lib_files" ] && return
++    bad_globals=`nm -g --defined-only $lib_files |
++        awk '{if ($3) print $3}' |
++        sed -n "/^${symbols_prefix}_/ d; /^_${symbols_prefix}/ { p; d }; /^_/ d; p"`
++    [ -z "$bad_globals" ] && return
+     error=1
+-fi
+-
+-bad_globals=`nm -g --defined-only $builddir/../libmpeg2/convert/*.o |\
+-    awk '{if ($3) print $3}' | grep -v '^_\?mpeg2convert_'`
++    echo BAD GLOBAL SYMBOLS in $lib_files:
++    echo "$bad_globals"
++}
+ 
+-if test x"$bad_globals" != x""; then
+-    echo BAD GLOBAL SYMBOLS:
+-    for s in $bad_globals; do echo $s; done
+-    error=1
+-fi
++check_bad_public_symbols mpeg2 $builddir/../libmpeg2/.libs/libmpeg2.so
++check_bad_public_symbols mpeg2convert $builddir/../libmpeg2/convert/.libs/libmpeg2convert.so
+ 
+ exit $error
diff --git a/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.5.1.bb b/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.5.1.bb
index 7711c2dc10..6b59d4f681 100644
--- a/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.5.1.bb
+++ b/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.5.1.bb
@@ -10,6 +10,7 @@ SRC_URI = "http://libmpeg2.sourceforge.net/files/libmpeg2-${PV}.tar.gz \
            file://altivec_h_needed.patch \
            file://0001-check-for-available-arm-optimizations.patch \
            file://0002-Set-visibility-of-global-symbols-used-in-ARM-specifi.patch \
+           file://61_global-symbol-test.patch \
            "
 
 S = "${WORKDIR}/libmpeg2-${PV}"
-- 
2.20.1



             reply	other threads:[~2019-01-31  6:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31  6:50 Khem Raj [this message]
2019-01-31  6:50 ` [PATCH 2/6] xinput-calibrator: Fix build with clang/libc++ Khem Raj
2019-01-31  6:50 ` [PATCH 3/6] libproxy: " Khem Raj
2019-01-31  6:50 ` [PATCH 4/6] libdnf: " Khem Raj
2019-01-31  6:50 ` [PATCH 5/6] webkitgtk: Fix build with clang/libc++ >= 7.0.0 Khem Raj
2019-01-31  6:50 ` [PATCH 6/6] llvm: Upgrade to upcoming 8.0.0 release Khem Raj
2019-02-01 15:11   ` Richard Purdie
2019-02-18  9:46   ` Alexander Kanavin
2019-02-18 15:03     ` Khem Raj
2019-02-18 15:15       ` Alexander Kanavin
2019-02-18 15:41         ` Khem Raj
2019-02-18 16:08           ` Belisko Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190131065016.21887-1-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox