inputstream.ffmpegdirect icon indicating copy to clipboard operation
inputstream.ffmpegdirect copied to clipboard

Can't build from source for Kodi 21 on Arch

Open cg00001 opened this issue 2 years ago • 18 comments
trafficstars

See partial cli.log below. partial.cli.log

cg00001 avatar Sep 06 '23 08:09 cg00001

How are you compiling the code? If you're using makepkg, or an AUR helper (which just wraps makepkg; for example, yay), then you need to add -flto to your /etc/makepkg.conf:

--- /tmp/makepkg.conf	2023-05-19 18:45:31.000000000 -0400
+++ /etc/makepkg.conf	2023-09-08 22:19:40.401643967 -0400
@@ -33,21 +33,21 @@
 # ARCHITECTURE, COMPILE FLAGS
 #########################################################################
 #
 CARCH="x86_64"
 CHOST="x86_64-pc-linux-gnu"
 
 #-- Compiler and Linker Flags
 #CPPFLAGS=""
 CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-        -fstack-clash-protection -fcf-protection"
+        -fstack-clash-protection -fcf-protection -flto"
 CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
 LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
 LTOFLAGS="-flto=auto"
 #RUSTFLAGS="-C opt-level=2"
 #-- Make Flags: change this for DistCC/SMP systems
 #MAKEFLAGS="-j2"
 #-- Debugging flags
 DEBUG_CFLAGS="-g"
 DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
 #DEBUG_RUSTFLAGS="-C debuginfo=2"

mcDevnagh avatar Sep 09 '23 02:09 mcDevnagh

How are you compiling the code? If you're using makepkg, or an AUR helper (which just wraps makepkg; for example, yay), then you need to add -flto to your /etc/makepkg.conf:

--- /tmp/makepkg.conf	2023-05-19 18:45:31.000000000 -0400
+++ /etc/makepkg.conf	2023-09-08 22:19:40.401643967 -0400
@@ -33,21 +33,21 @@
 # ARCHITECTURE, COMPILE FLAGS
 #########################################################################
 #
 CARCH="x86_64"
 CHOST="x86_64-pc-linux-gnu"
 
 #-- Compiler and Linker Flags
 #CPPFLAGS=""
 CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-        -fstack-clash-protection -fcf-protection"
+        -fstack-clash-protection -fcf-protection -flto"
 CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
 LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
 LTOFLAGS="-flto=auto"
 #RUSTFLAGS="-C opt-level=2"
 #-- Make Flags: change this for DistCC/SMP systems
 #MAKEFLAGS="-j2"
 #-- Debugging flags
 DEBUG_CFLAGS="-g"
 DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
 #DEBUG_RUSTFLAGS="-C debuginfo=2"

I've tried the AUR package with -fltio as well just before trying building from source. Failed.

partial.cli.log posted above shows building from source failing.

cg00001 avatar Sep 09 '23 07:09 cg00001

Tried again with Kodi Omega Alpha 3 on Arch. Using -flto with kodi-addon-inputstream-ffmpegdirect, PKGBUILD has wrong Omega link, maintainer messaged. https://aur.archlinux.org/packages/kodi-addon-inputstream-ffmpegdirect

Building from source still has errors -kept -flto just in case: https://bin.disroot.org/?add0d849ec1830d6#3UnEmzv4C3SNYSgMyoyqXnwMvdu9f9xdumxNP2KDRHxG

cg00001 avatar Sep 19 '23 08:09 cg00001

https://github.com/MythTV/mythtv/issues/765

Essentially, a patch is needed for FFmpeg, or a downgrade for binutils. Developers of binutils argue that this is not a BUG, but a feature of the version. Perhaps the FFmpeg version should be updated?

daiaji avatar Sep 29 '23 05:09 daiaji

https://github.com/xbmc/inputstream.ffmpegdirect/issues/253#issuecomment-1749871782

daiaji avatar Oct 07 '23 00:10 daiaji

#253 (comment)

Can you make a PKGBUILD for Omega?| I'll be happy to test it.

cg00001 avatar Oct 07 '23 02:10 cg00001

#253 (comment)

Can you make a PKGBUILD for Omega?| I'll be happy to test it.

It's not particularly difficult, but it requires some time. However, where is the PKGBUILD for the Omega branch of Kodi obtained from?

daiaji avatar Oct 07 '23 03:10 daiaji

It's not particularly difficult, but it requires some time. However, where is the PKGBUILD for the Omega branch of Kodi obtained from?

If you have installed kodi-git in Arch, this -if corrected-, should install the Omega version: https://aur.archlinux.org/packages/kodi-addon-inputstream-ffmpegdirect PKGBUILD: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=kodi-addon-inputstream-ffmpegdirect

kodi-git binary available from Chaotic-AUR: https://aur.chaotic.cx/

cg00001 avatar Oct 07 '23 11:10 cg00001

Hi, I just submited the Omega version package to AUR https://aur.archlinux.org/packages/kodi-addon-inputstream-ffmpegdirect-git

This includes check and comments about broken built for aarch64 architecture, and is for Omega branch. It works well on my system (RPi 4). Please test and tell me if all is well.

Kind regards.

opengk avatar Jan 05 '24 13:01 opengk

kodi-addon-inputstream-ffmpegdirect-git

Removed all Kodi files, installed just kodi-git from Chaotic-AUR, then kodi-addon-inputstream-ffmpegdirect-git gave me:

CC	libavformat/adtsenc.o
src/libavcodec/x86/mathops.h: Assembler messages:
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
src/libavcodec/x86/mathops.h:125: Error: operand type mismatch for `shr'
make[6]: *** [/home/k/.cache/pikaur/build/kodi-addon-inputstream-ffmpegdirect-git/src/inputstream.ffmpegdirect-21.0b2-Omega/build/build/ffmpeg/src/ffmpeg/ffbuild/common.mak:81: libavformat/adtsenc.o] Error 1
make[5]: *** [CMakeFiles/ffmpeg.dir/build.make:86: ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-build] Error 2
make[4]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ffmpeg.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/ffmpeg.dir/build.make:86: build/ffmpeg/src/ffmpeg-stamp/ffmpeg-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:220: CMakeFiles/ffmpeg.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

cg00001 avatar Jan 07 '24 08:01 cg00001

On which system are you building ? Mine is working on aarch64 RPi4, but indeed I got the same issue when building on my x86_64 system.. It seems to be an issue with binutil > 2.41. Let me try to figure out how to fix this..

opengk avatar Jan 07 '24 16:01 opengk

On which system are you building ? Mine is working on aarch64 RPi4, but indeed I got the same issue when building on my x86_64 system.. It seems to be an issue with binutil > 2.41. Let me try to figure out how to fix this..

Arch Linux: ter

cg00001 avatar Jan 07 '24 18:01 cg00001

I tend to downgrade binutils, build, then you can upgrade it again.

ilikenwf avatar Jan 24 '24 04:01 ilikenwf

This is what i have now building for Omega on Arch, any way to fix the issue?

config.log

Thanks

thepasto avatar Apr 16 '24 06:04 thepasto

Are you trying to build the latest version of this addon?

phunkyfish avatar Apr 16 '24 06:04 phunkyfish

Yes, 21.3.5 this is the PKGBUILD i used, anything changed if i take the master branch version

Fixed by this

Thanks

thepasto avatar Apr 16 '24 06:04 thepasto

This is what i have now building for Omega on Arch, any way to fix the issue?

config.log

Thanks

same issue: https://github.com/xbmc/inputstream.ffmpegdirect/issues/299

coffeinflash avatar May 18 '24 06:05 coffeinflash

I forgot to mention that Kodi loving peeps -at least on Arch Linux-, may just use the Flatpak version, binaries are already embedded, everything works ok.

https://flathub.org/apps/tv.kodi.Kodi

cg00001 avatar May 18 '24 07:05 cg00001