Summary: | multimedia/ffmpeg: build with FLITE=on fails | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Vladimir Druzenko <vvd> | ||||
Component: | Individual Port(s) | Assignee: | freebsd-multimedia (Nobody) <multimedia> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | mi, sobomax, tatsuki_makino | ||||
Priority: | --- | Keywords: | regression | ||||
Version: | Latest | Flags: | jbeich:
maintainer-feedback+
|
||||
Hardware: | Any | ||||||
OS: | Any | ||||||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239712 | ||||||
Attachments: |
|
Description
Vladimir Druzenko
![]() ![]() Not a ffmpeg issue. (In reply to VVD from comment #0) > /usr/local/lib/libflite_cmu_us_kal.so: undefined reference to `cmu_postlex' > /usr/local/lib/libflite_cmu_us_awb.so: undefined reference to `cmu_lex_init' ffmpeg already links against -lflite_cmulex. > /usr/local/lib/libflite_cmu_us_awb.so: undefined reference to `usenglish_init' ffmpeg already links against -lflite_usenglish. Nevermind. -Wl,--as-needed in ffmpeg build is the culprit. A commit references this bug: Author: jbeich Date: Thu Aug 1 09:13:34 UTC 2019 New revision: 507762 URL: https://svnweb.freebsd.org/changeset/ports/507762 Log: multimedia/ffmpeg: unbreak FLITE=on with Clang after r507592 -Wl,--as-needed is partially broken in base GNU bfd: /usr/local/lib/libflite_cmu_us_awb.so: undefined reference to `usenglish_init' /usr/local/lib/libflite_cmu_us_awb.so: undefined reference to `cmu_lex_init' /usr/local/lib/libflite_cmu_us_kal.so: undefined reference to `cmu_postlex' PR: 239567 Reported by: VVD Changes: head/multimedia/ffmpeg/Makefile Thanks! Build fine on 12.0 i386 now. But it build fine on 12.0 amd64 (with flite) before this patch too. (In reply to VVD from comment #4) > But it build fine on 12.0 amd64 (with flite) before this patch too. 12.0 amd64 defaults to WITH_LLD_IS_LD, see src.conf(5) or /usr/src/share/mk/src.opts.mk. On non-Clang architectures lang/gcc* is used which defaults to ld.bfd from devel/binutils, not affected by -Wl,--as-needed bug. -Wl,--as-needed is used by upstream to avoid overlinking: -lflite* are passed globally but only libavfilter actually needs those. -lflite* are underlinked libraries, so interdependencies are left to deal with by consumers. Unfortunately, without direct references by libavfilter base ld.bfd with -Wl,--as-needed assumes -lflite_cmulex and -lflite_usenglish are not used. Same with multimedia/mpv and net-im/qTox: /usr/local/lib/libflite_cmu_us_kal.so.1: undefined reference to `cmu_postlex' /usr/local/lib/libflite_cmu_us_awb.so.1: undefined reference to `usenglish_init' /usr/local/lib/libflite_cmu_us_awb.so.1: undefined reference to `cmu_lex_init' Workaround is - add this to Makefile: .if exists(/usr/bin/ld.lld) && (${/usr/bin/ld:L:tA} != /usr/bin/ld.lld) LDFLAGS+= -fuse-ld=lld .endif Probably some other ports dependent on ffmpeg have this issue too. Getting the same error with mpv and ffmpegthumbnailer. May be add this to Mk/bsd.*.mk:
> .if exists(/usr/bin/ld.lld) && (${/usr/bin/ld:L:tA} != /usr/bin/ld.lld)
> LDFLAGS+= -fuse-ld=lld
> .endif
(In reply to VVD from comment #8) > LDFLAGS+= -fuse-ld=lld Thanks, that's an interesting workaround... Probably now comment #8 is needed for all ports that link libavfilter. Created attachment 210054 [details]
Proposal of another patch
I think this patch is better because flite is making strange *.so. (*.o is extracted from *.a and linked to *.so. At that time, other necessary libraries are not linked.)
|