[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/08: gnu: libmpeg2: Fix build on armhf-linux.
From: |
guix-commits |
Subject: |
03/08: gnu: libmpeg2: Fix build on armhf-linux. |
Date: |
Sat, 19 Oct 2019 18:42:01 -0400 (EDT) |
mbakke pushed a commit to branch master
in repository guix.
commit c50b07dde89c21234807cef40ee7fd69fbfe72d7
Author: Marius Bakke <address@hidden>
Date: Sat Oct 19 14:26:18 2019 +0200
gnu: libmpeg2: Fix build on armhf-linux.
* gnu/packages/patches/libmpeg2-arm-private-symbols.patch,
gnu/packages/patches/libmpeg2-global-symbol-test.patch: New files.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/video.scm (libmpeg2)[source](patches): New field.
---
gnu/local.mk | 2 +
.../patches/libmpeg2-arm-private-symbols.patch | 48 +++++++++++++++++
.../patches/libmpeg2-global-symbol-test.patch | 63 ++++++++++++++++++++++
gnu/packages/video.scm | 2 +
4 files changed, 115 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 967d68c..126d29d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1056,6 +1056,8 @@ dist_patch_DATA =
\
%D%/packages/patches/libmad-md_size.patch \
%D%/packages/patches/libmad-mips-newgcc.patch \
%D%/packages/patches/libmp4v2-c++11.patch \
+ %D%/packages/patches/libmpeg2-arm-private-symbols.patch \
+ %D%/packages/patches/libmpeg2-global-symbol-test.patch \
%D%/packages/patches/libmygpo-qt-fix-qt-5.11.patch \
%D%/packages/patches/libmygpo-qt-missing-qt5-modules.patch \
%D%/packages/patches/libreoffice-boost.patch \
diff --git a/gnu/packages/patches/libmpeg2-arm-private-symbols.patch
b/gnu/packages/patches/libmpeg2-arm-private-symbols.patch
new file mode 100644
index 0000000..7f88d65
--- /dev/null
+++ b/gnu/packages/patches/libmpeg2-arm-private-symbols.patch
@@ -0,0 +1,48 @@
+Set visibility of global symbols used in ARM specific assembly file to
+internal.
+
+Taken from Debian:
+https://salsa.debian.org/multimedia-team/mpeg2dec/blob/master/debian/patches/60_arm-private-symbols.patch
+
+--- mpeg2dec.orig/libmpeg2/motion_comp_arm_s.S
++++ mpeg2dec/libmpeg2/motion_comp_arm_s.S
+@@ -23,7 +23,8 @@
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_o_16_arm
++ .global MC_put_o_16_arm
++ .internal MC_put_o_16_arm
+ MC_put_o_16_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int
height)
+ pld [r1]
+@@ -83,7 +84,8 @@ MC_put_o_16_arm_align_jt:
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_o_8_arm
++ .global MC_put_o_8_arm
++ .internal MC_put_o_8_arm
+ MC_put_o_8_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int
height)
+ pld [r1]
+@@ -152,7 +154,8 @@ MC_put_o_8_arm_align_jt:
+ .endm
+
+ .align
+- .global MC_put_x_16_arm
++ .global MC_put_x_16_arm
++ .internal MC_put_x_16_arm
+ MC_put_x_16_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int
height)
+ pld [r1]
+@@ -244,7 +247,8 @@ MC_put_x_16_arm_align_jt:
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_x_8_arm
++ .global MC_put_x_8_arm
++ .internal MC_put_x_8_arm
+ MC_put_x_8_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int
height)
+ pld [r1]
diff --git a/gnu/packages/patches/libmpeg2-global-symbol-test.patch
b/gnu/packages/patches/libmpeg2-global-symbol-test.patch
new file mode 100644
index 0000000..f6eb3c6
--- /dev/null
+++ b/gnu/packages/patches/libmpeg2-global-symbol-test.patch
@@ -0,0 +1,63 @@
+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 "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/gnu/packages/video.scm b/gnu/packages/video.scm
index c5dbe93..1e67a7f 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -315,6 +315,8 @@ a shared library and encoder and decoder command-line
executables.")
;; because the SourceForge project is misconfigured.
(uri (string-append "http://libmpeg2.sourceforge.net/files/"
name "-" version ".tar.gz"))
+ (patches (search-patches "libmpeg2-arm-private-symbols.patch"
+ "libmpeg2-global-symbol-test.patch"))
(sha256
(base32
"1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
- branch master updated (1760c97 -> f19e571), guix-commits, 2019/10/19
- 05/08: gnu: vc: Update to 1.4.1., guix-commits, 2019/10/19
- 02/08: gnu: dav1d: Update to 0.5.0., guix-commits, 2019/10/19
- 01/08: gnu: xapian: Update to 1.4.13., guix-commits, 2019/10/19
- 04/08: gnu: Add virtest., guix-commits, 2019/10/19
- 06/08: gnu: OpenEXR: Disable failing test on 32-bit systems., guix-commits, 2019/10/19
- 03/08: gnu: libmpeg2: Fix build on armhf-linux.,
guix-commits <=
- 08/08: gnu: kodi: Increase test timeout., guix-commits, 2019/10/19
- 07/08: gnu: notmuch: Update to 0.29.2., guix-commits, 2019/10/19