Package: libx265-59
Version: 1.7-2
Tags: patch

Dear Maintainer,

The 8-bit variant of libx265-59 can dlopen the 10-bit variant,
so that it can be used by programs linked against the 8-bit library.
ffmpeg 2.7 uses this functionality, which works fine in Debian.

However, it doesn't work in Ubuntu, which causes ffmpeg's autopkgtest
to fail, thus preventing it's migration from wily-proposed to wily.

The problem is the following x265 warning on stderr:
$ ffmpeg -version
x265 [warning]: /usr/lib/x86_64-linux-gnu/x265-10bit/libx265.so.59 does not 
support requested bitDepth 10
ffmpeg version 2.7-1 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (Ubuntu 4.9.2-20ubuntu1)
[...]

The reason for this problem is that Ubuntu defaults to using
-Bsymbolic-functions, which causes the max_bit_depth symbol to always
refer to the one from the linked library, even in the api structure
from the dlopened library.
(Weird, I know. I suspected -Bsymbolic-functions, because it already
caused ffmpeg to FTBFS in Ubuntu.)

The solution is thus to filter out -Bsymbolic-functions from LDFLAGS,
as is done in attached patch. I tested it and it fixes this problem.

Best regards,
Andreas
--- a/debian/rules
+++ b/debian/rules
@@ -2,7 +2,7 @@
 
 DEB_HOST_MULTIARCH=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
-export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
+LDFLAGS := $(filter-out %-Bsymbolic-functions,$(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed)
 # LFS support and multiarch path to look up 10bit library
 export DEB_CPPFLAGS_MAINT_APPEND=$(shell getconf LFS_CFLAGS) \
 	-DDEB_HOST_MULTIARCH=\"/usr/lib/$(DEB_HOST_MULTIARCH)/\"

Reply via email to