Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 2024 22:27:28 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 282188] New port: multimedia/ffmpeg3 (legacy ffmpeg as a dependency for emulators/ppsspp)
Message-ID:  <bug-282188-7788-ZVBFKcqykZ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-282188-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-282188-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D282188

--- Comment #11 from Kevin Reinholz <kreinholz@gmail.com> ---
Daniel,

Thank you very much for reviewing and for your improved patch. (And Commit
9c4f84d from the PPSSPP devs!)

I tested building your version of ffmpeg3 both manually and with synth, and=
 it
works great. PPSSPP built against ffmpeg3 with your updates was able to pla=
y a
game with an early FMV that reliably caused PPSSPP built against higher
versions of ffmpeg to crash, so these updated options look good.

I did experiment with building ffmpeg3 static libs (just swapped CONFIGURE_=
ARGS
to --enable-static and --disable-shared, and of course updated pkg-plist
accordingly).

ffmpeg3 builds static libs fine, but PPSSPP gets 99% of the way through
building against static ffmpeg3, then dies during the staging portion of the
build with undefined symbol errors related to lzma and bz2:

ld: error: undefined symbol: lzma_stream_decoder
>>> referenced by tiff.c:396 (libavcodec/tiff.c:396)
>>>               tiff.o:(decode_frame) in archive /usr/local/ffmpeg3/lib/l=
ibavcodec.a

ld: error: undefined symbol: lzma_code
>>> referenced by tiff.c:401 (libavcodec/tiff.c:401)
>>>               tiff.o:(decode_frame) in archive /usr/local/ffmpeg3/lib/l=
ibavcodec.a

ld: error: undefined symbol: lzma_end
>>> referenced by tiff.c:402 (libavcodec/tiff.c:402)
>>>               tiff.o:(decode_frame) in archive /usr/local/ffmpeg3/lib/l=
ibavcodec.a

ld: error: undefined symbol: BZ2_bzDecompressInit
>>> referenced by matroskadec.c:1327 (libavformat/matroskadec.c:1327)
>>>               matroskadec.o:(matroska_decode_buffer) in archive /usr/lo=
cal/ffmpeg3/lib/libavformat.a
ld: error: undefined symbol: BZ2_bzDecompress
>>> referenced by matroskadec.c:1342 (libavformat/matroskadec.c:1342)
>>>               matroskadec.o:(matroska_decode_buffer) in archive /usr/lo=
cal/ffmpeg3/lib/libavformat.a

ld: error: undefined symbol: BZ2_bzDecompressEnd
>>> referenced by matroskadec.c:1345 (libavformat/matroskadec.c:1345)
>>>               matroskadec.o:(matroska_decode_buffer) in archive /usr/lo=
cal/ffmpeg3/lib/libavformat.a
>>> referenced by matroskadec.c:1335 (libavformat/matroskadec.c:1335)
>>>               matroskadec.o:(matroska_decode_buffer) in archive /usr/lo=
cal/ffmpeg3/lib/libavformat.a
c++: error: linker command failed with exit code 1 (use -v to see invocatio=
n)


I ran `ldd` on the shared lib versions of libavcodec.so and libavformat.so,=
 and
sure enough lzma and bz2 are properly linked:

/usr/local/ffmpeg3/lib/libavcodec.so:
        libswresample.so.2 =3D> /usr/local/ffmpeg3/lib/libswresample.so.2
(0x18e4d4e54000)
        libavutil.so.55 =3D> /usr/local/ffmpeg3/lib/libavutil.so.55
(0x18e4d505f000)
        libm.so.5 =3D> /lib/libm.so.5 (0x18e4d570c000)
        liblzma.so.5 =3D> /usr/lib/liblzma.so.5 (0x18e4d8153000)
        libz.so.6 =3D> /lib/libz.so.6 (0x18e4d8f88000)
        libthr.so.3 =3D> /lib/libthr.so.3 (0x18e4d9ae1000)
        libc.so.7 =3D> /lib/libc.so.7 (0x18e4d4514000)
        libmd.so.6 =3D> /lib/libmd.so.6 (0x18e4d9e3d000)

/usr/local/ffmpeg3/lib/libavformat.so:
        libavcodec.so.57 =3D> /usr/local/ffmpeg3/lib/libavcodec.so.57
(0x995d3e00000)
        libavutil.so.55 =3D> /usr/local/ffmpeg3/lib/libavutil.so.55
(0x995d18e1000)
        libm.so.5 =3D> /lib/libm.so.5 (0x995d2b33000)
        libbz2.so.4 =3D> /usr/lib/libbz2.so.4 (0x995d306c000)
        libz.so.6 =3D> /lib/libz.so.6 (0x995d551a000)
        libthr.so.3 =3D> /lib/libthr.so.3 (0x995d6a3b000)
        libc.so.7 =3D> /lib/libc.so.7 (0x995d12c2000)
        libswresample.so.2 =3D> /usr/local/ffmpeg3/lib/libswresample.so.2
(0x995d5ce2000)
        liblzma.so.5 =3D> /usr/lib/liblzma.so.5 (0x995d7708000)
        libmd.so.6 =3D> /lib/libmd.so.6 (0x995d7f81000)

So I'm not surprised those undefined symbol errors do not occur when buildi=
ng
PPSSPP against shared ffmpeg3 libs.

The linker errors occur with static ffmpeg3 libs regardless of whether I ha=
ck
PPSSPP's CMakeLists.txt to have it find ffmpeg in /usr/local/ffmpeg3
(system_ffmpeg, albeit static libs) or whether I manually copy over the
contents of /usr/local/ffmpeg3/ to
/usr/ports/emulators/ppsspp/work/ppsspp-1.17.1/ffmpeg/FreeBSD/x86_64/ and t=
hen
add a conditional so cmake finds bundled_ffmpeg where it would be expected =
if
PPSSPP shipped with precompiled ffmpeg binaries for FreeBSD.

I haven't been smart enough to pinpoint the exact problem yet, but I suspec=
t it
has to do with the way static ffmpeg3 is built, and it continuing to link
against the shared version of lzma and bz2 rather than picking up the static
versions (which I confirmed exist in /usr/lib alongside the shared versions=
),
or perhaps omitting them altogether.

ffmpeg3 with shared libs is really easy to set as a dependency of
emulators/ppsspp with minimal changes to the existing port; getting PPSSPP =
to
build against static ffmpeg3 on FreeBSD is going to be more of a project. I=
'm
not sure how much the juice is worth the squeeze to get ppsspp to build aga=
inst
static ffmpeg3 so it can serve solely as a build dependency and not hang ar=
ound
the system after ppsspp is built.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-282188-7788-ZVBFKcqykZ>