<!DOCTYPE html>
<html lang='en'>
<head>
<title>guix - Wojtek's customized Guix</title>
<meta name='generator' content='cgit v1.2.3'/>
<meta name='robots' content='noindex, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit-static/cgit.css'/>
<link rel='stylesheet' type='text/css' href='/cgit-static/better-cgit-markdown-heading-color.css'/>
<link rel='shortcut icon' href='/cgit-static/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='https://git.koszko.org/guix/atom/gnu/packages/patches/aegis-perl-tempdir2.patch?h=koszko' type='application/atom+xml'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='https://git.koszko.org/cgit-static/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/guix/'>guix</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='a608666d74f156819cecfabaf72290726d7964e6'/><select name='h' onchange='this.form.submit();'>
<option value='koszko' selected='selected'>koszko</option>
<option value='koszko-scripts'>koszko-scripts</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Wojtek's customized Guix</td><td class='sub right'>s'><tr><td>
<a class='active' href='/guix/about/'>about</a><a href='/guix/'>summary</a><a href='/guix/refs/?id=a608666d74f156819cecfabaf72290726d7964e6'>refs</a><a href='/guix/log/'>log</a><a href='/guix/tree/?id=a608666d74f156819cecfabaf72290726d7964e6'>tree</a><a href='/guix/commit/?id=a608666d74f156819cecfabaf72290726d7964e6'>commit</a><a href='/guix/diff/?id=a608666d74f156819cecfabaf72290726d7964e6'>diff</a></td><td class='form'><form class='right' method='get' action='/guix/log/'>
<input type='hidden' name='id' value='a608666d74f156819cecfabaf72290726d7964e6'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='content'><div id='summary'><pre>
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 Debian:
https://salsa.debian.org/multimedia-team/mpeg2dec/blob/master/debian/patches/61_global-symbol-test.patch

--- mpeg2dec.orig/test/globals
+++ mpeg2dec/test/globals
@@ -1,4 +1,8 @@
 #!/bin/sh
+# TODO
+# - fix checking of .a libs; problem is that &quot;nm -g --defined-only&quot; lists
+#   internal symbols; this can be solved by using objdump, but it&apos;s probably
+#   good enough to just run the tests on the shared lib
 
 if test x&quot;$srcdir&quot; != x&quot;&quot;; then
     builddir=&quot;.&quot;	# 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 &apos;{if ($3) print $3}&apos; | grep -v &apos;^_\?mpeg2_&apos;`
-
-if test x&quot;$bad_globals&quot; != x&quot;&quot;; then
-    echo BAD GLOBAL SYMBOLS:
-    for s in $bad_globals; do echo $s; done
+# check_bad_public_symbols &lt;symbol prefix&gt; &lt;lib file&gt; [&lt;lib file&gt;...]
+#
+# 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=&quot;$1&quot;
+    shift
+    lib_files=`ls &quot;$@&quot; 2&gt;/dev/null`
+    [ -z &quot;$lib_files&quot; ] &amp;&amp; return
+    bad_globals=`nm -g --defined-only $lib_files |
+        awk &apos;{if ($3) print $3}&apos; |
+        sed -n &quot;/^${symbols_prefix}_/ d; /^_${symbols_prefix}/ { p; d }; /^_/ d; p&quot;`
+    [ -z &quot;$bad_globals&quot; ] &amp;&amp; return
     error=1
-fi
-
-bad_globals=`nm -g --defined-only $builddir/../libmpeg2/convert/*.o |\
-    awk &apos;{if ($3) print $3}&apos; | grep -v &apos;^_\?mpeg2convert_&apos;`
+    echo BAD GLOBAL SYMBOLS in $lib_files:
+    echo &quot;$bad_globals&quot;
+}
 
-if test x&quot;$bad_globals&quot; != x&quot;&quot;; 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
</pre>
</div></div> <!-- class=content -->
                         <div class=footer>generated by
                             <a href="https://git.zx2c4.com/cgit/about/">
                                 cgit
                             </a>
                         </div>
                        </div> <!-- id=cgit -->
</body>
</html>
