From f1eab0a347e63656cfbffe0105a90ad9c2fd68cd Mon Sep 17 00:00:00 2001 From: graysky Date: Mon, 4 Mar 2024 16:19:03 -0500 Subject: [PATCH] alarm/kodi-rpi-git to 21.x.65499.720bf1673e-1 Try enabling LTO. Test built for me on armv7h but not on aarch64. While it didn't error out, it did simply stop: ... INSTALL build/kodi-rpi-git/src/kodi-build/build/ffmpeg/src/ffmpeg/libavutil/tx.h INSTALL build/kodi-rpi-git/src/kodi-build/build/ffmpeg/src/ffmpeg/libavutil/film_grain_params.h INSTALL libavutil/avconfig.h INSTALL libavutil/ffversion.h INSTALL libavutil/libavutil.pc (no further output after the above line) --- ...mpeg-build-with-lto-when-DUSE_LTO-ON.patch | 51 +++++++++++++++++++ ...se-1.13.1-for-internal-build-like-LE.patch | 25 --------- alarm/kodi-rpi-git/PKGBUILD | 22 ++++---- 3 files changed, 61 insertions(+), 37 deletions(-) create mode 100644 alarm/kodi-rpi-git/0001-ffmpeg-build-with-lto-when-DUSE_LTO-ON.patch delete mode 100644 alarm/kodi-rpi-git/0001-taglib-use-1.13.1-for-internal-build-like-LE.patch diff --git a/alarm/kodi-rpi-git/0001-ffmpeg-build-with-lto-when-DUSE_LTO-ON.patch b/alarm/kodi-rpi-git/0001-ffmpeg-build-with-lto-when-DUSE_LTO-ON.patch new file mode 100644 index 000000000..fb72ce6cc --- /dev/null +++ b/alarm/kodi-rpi-git/0001-ffmpeg-build-with-lto-when-DUSE_LTO-ON.patch @@ -0,0 +1,51 @@ +From e32ddfda63944ef786b3a3ddea243dc0ed2f4c11 Mon Sep 17 00:00:00 2001 +From: graysky +Date: Fri, 7 Jan 2022 10:22:22 -0500 +Subject: [PATCH] ffmpeg: build with lto when -DUSE_LTO=ON + +I do not believe the internal ffmpeg build uses LTO if the user calls for it +via -DUSE_LTO=ON. This commit passes --enable-lto to ffmpeg's configure script +if CMAKE has CMAKE_INTERPROCEDURAL_OPTIMIZATION set which -DUSE_LTO=ON does. + +The original author of this, loqs, points this out here[1]. + +1. https://bugs.archlinux.org/task/69333#comment196255 +--- + cmake/modules/FindFFMPEG.cmake | 5 +++++ + tools/depends/target/ffmpeg/CMakeLists.txt | 4 ++++ + 2 files changed, 9 insertions(+) + +diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake +index 13c810591b..5f0c596cb7 100644 +--- a/cmake/modules/FindFFMPEG.cmake ++++ b/cmake/modules/FindFFMPEG.cmake +@@ -55,6 +55,11 @@ macro(buildFFMPEG) + -DOS=${OS} + -DCMAKE_AR=${CMAKE_AR}) + endif() ++ ++ if(USE_LTO) ++ list(APPEND FFMPEG_OPTIONS -DUSE_LTO=ON) ++ endif() ++ + set(LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) + list(APPEND LINKER_FLAGS ${SYSTEM_LDFLAGS}) + +diff --git a/tools/depends/target/ffmpeg/CMakeLists.txt b/tools/depends/target/ffmpeg/CMakeLists.txt +index 1bf9f53499..d438449888 100644 +--- a/tools/depends/target/ffmpeg/CMakeLists.txt ++++ b/tools/depends/target/ffmpeg/CMakeLists.txt +@@ -126,6 +126,10 @@ if(CPU MATCHES x86 OR CPU MATCHES x86_64) + list(APPEND ffmpeg_conf --x86asmexe=${NASM_EXECUTABLE}) + endif() + ++if(USE_LTO) ++ list(APPEND ffmpeg_conf --enable-lto) ++endif() ++ + if(ENABLE_DAV1D) + list(APPEND ffmpeg_conf --enable-libdav1d) + set(pkgconf_path "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}") +-- +2.44.0 + diff --git a/alarm/kodi-rpi-git/0001-taglib-use-1.13.1-for-internal-build-like-LE.patch b/alarm/kodi-rpi-git/0001-taglib-use-1.13.1-for-internal-build-like-LE.patch deleted file mode 100644 index 8811821af..000000000 --- a/alarm/kodi-rpi-git/0001-taglib-use-1.13.1-for-internal-build-like-LE.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 674dff295d535ab063ea18a5f6d7b06e24994cf6 Mon Sep 17 00:00:00 2001 -From: graysky -Date: Fri, 2 Feb 2024 14:58:55 -0500 -Subject: [PATCH] taglib: use 1.13.1 for internal build like LE - ---- - tools/depends/target/taglib/TAGLIB-VERSION | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tools/depends/target/taglib/TAGLIB-VERSION b/tools/depends/target/taglib/TAGLIB-VERSION -index 8f980b0..d9d76c8 100644 ---- a/tools/depends/target/taglib/TAGLIB-VERSION -+++ b/tools/depends/target/taglib/TAGLIB-VERSION -@@ -1,6 +1,6 @@ - LIBNAME=taglib --VERSION=1.13 -+VERSION=1.13.1 - ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz --SHA512=b6e3253d158b41173073c0da1915f5e4a3de947db918660817cb1c755fba7e3723ea1a335fbbc30b0dcf942348a471b493fe2ce1d52d1a808578edee14e1bfc7 -+SHA512=986231ee62caa975afead7e94630d58acaac25a38bc33d4493d51bd635d79336e81bba60586d7355ebc0670e31f28d32da3ecceaf33292e4bc240c64bf00f35b - BYPRODUCT=libtag.a - BYPRODUCT_WIN=tag.lib --- -2.43.0 - diff --git a/alarm/kodi-rpi-git/PKGBUILD b/alarm/kodi-rpi-git/PKGBUILD index b6b8d13ce..d5ec71b6e 100644 --- a/alarm/kodi-rpi-git/PKGBUILD +++ b/alarm/kodi-rpi-git/PKGBUILD @@ -7,6 +7,8 @@ # Contributor WarheadsSE # Contributor Adrian Fedoreanu +highmem=1 + pkgbase=kodi-rpi-git pkgname=( 'kodi-rpi-git' @@ -17,7 +19,7 @@ pkgname=( # recommend manually setting -DUSE_LTO=OFF to -DUSE_LTO=$(nproc) in build() _clangbuild= -pkgver=21.x.65474.67a26c5336 +pkgver=21.x.65499.720bf1673e pkgrel=1 arch=('aarch64' 'armv7h') url="https://github.com/graysky2/xbmc/tree/gs-gbm_omega" @@ -29,7 +31,7 @@ makedepends=( 'libmodplug' 'libmpeg2' 'libnfs' 'libplist' 'libpulse' 'libxrandr' 'libxslt' 'lirc' 'lzo' 'mesa' 'nasm' 'pipewire' 'python-pycryptodomex' 'python-pillow' 'python-pybluez' - 'python-simplejson' 'shairplay' 'smbclient' 'sndio' 'spdlog' + 'python-simplejson' 'shairplay' 'smbclient' 'sndio' 'spdlog' 'taglib' 'tinyxml' 'swig' 'upower' 'giflib' 'rapidjson' 'ghostscript' 'meson' 'gtest' 'graphviz' 'libinput' 'libxkbcommon' 'pcre' 'libdisplay-info' 'tinyxml2' ) @@ -63,11 +65,10 @@ source=( "https://mirrors.kodi.tv/build-deps/sources/fstrcmp-$_fstrcmp_version.tar.gz" "https://mirrors.kodi.tv/build-deps/sources/flatbuffers-$_flatbuffers_version.tar.gz" "https://mirrors.kodi.tv/build-deps/sources/libudfread-$_libudfread_version.tar.gz" - https://taglib.github.io/releases/taglib-1.13.1.tar.gz "ArchARM-kodi-init-v$_init_version.tar.gz::https://github.com/graysky2/kodi-standalone-service/archive/v$_init_version.tar.gz" kodi.config.txt 000-temp-revert-fences.patch - 0001-taglib-use-1.13.1-for-internal-build-like-LE.patch + 0001-ffmpeg-build-with-lto-when-DUSE_LTO-ON.patch ) backup=(boot/kodi.config.txt etc/conf.d/kodi-standalone) noextract=( @@ -79,7 +80,6 @@ noextract=( "fstrcmp-$_fstrcmp_version.tar.gz" "flatbuffers-$_flatbuffers_version.tar.gz" "libudfread-$_libudfread_version.tar.gz" - taglib-1.13.1.tar.gz ) sha256sums=('SKIP' 'f38c4a4e7a4f4da6d8e83b8852489aa3bb6588a915dc41f5ee89d9aad305a06e' @@ -90,11 +90,10 @@ sha256sums=('SKIP' 'e4018e850f80700acee8da296e56e15b1eef711ab15157e542e7d7e1237c3476' '8aff985da30aaab37edf8e5b02fda33ed4cbdd962699a8e2af98fdef306f4e4d' '2bf16726ac98d093156195bb049a663e07d3323e079c26912546f4e05c77bac5' - 'c8da2b10f1bfec2cd7dbfcd33f4a2338db0765d851a50583d410bacf055cfd0b' '8f8ab84a0cf3bd382edb118e475b336ca2fe1e1d4da3ad8e4637f8278ed9179c' '9ba55fd29b3ef64de3869b092493a233eeb83a23d5ae378299ef9d335f271123' 'e812fc2f74d71915c3179785a8f99647612bd21ce96f866769ee1bc58682ee3b' - 'c0efb77425f86e8a743d59529c4ab0b2d634d53413db1c6f71974c000bc31c14') + '9d2d52787abf59ceaf116e5d9e7b2ed33ce789d74766c9e407da34e86c796999') pkgver() { cd "xbmc-$_gitname" @@ -112,8 +111,8 @@ prepare() { # fix https://forum.kodi.tv/showthread.php?tid=376430 patch -p1 -i ../000-temp-revert-fences.patch - # modify to use internal taglib v1.13.1 due to build fails for armv7h with v2.0+ - patch -p1 -i ../0001-taglib-use-1.13.1-for-internal-build-like-LE.patch + # use LTO for ffmpeg builds + patch -p1 -i ../0001-ffmpeg-build-with-lto-when-DUSE_LTO-ON.patch } build() { @@ -149,7 +148,7 @@ build() { -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib - -DUSE_LTO=OFF + -DUSE_LTO=ON -DVERBOSE=ON -DENABLE_LDGOLD=OFF -DENABLE_AIRTUNES=ON @@ -186,7 +185,6 @@ build() { -DFSTRCMP_URL="$srcdir/fstrcmp-$_fstrcmp_version.tar.gz" -DFLATBUFFERS_URL="$srcdir/flatbuffers-$_flatbuffers_version.tar.gz" -DUDFREAD_URL="$srcdir/libudfread-$_libudfread_version.tar.gz" - -DTAGLIB_URL="$srcdir/taglib-1.13.1.tar.gz" -DAPP_RENDER_SYSTEM=gles -DCORE_PLATFORM_NAME="x11 gbm" ) @@ -204,7 +202,7 @@ package_kodi-rpi-git() { 'libplist' 'libpulse' 'libxslt' 'lirc' 'mariadb-libs' 'mesa' 'libpipewire' 'python-pillow' 'python-pycryptodomex' 'python-simplejson' 'shairplay' 'smbclient' 'sndio' 'spdlog' 'sqlite' - 'tinyxml' 'libxkbcommon' 'polkit' 'linux>=5.4.35' 'lzo' 'libinput' + 'taglib' 'tinyxml' 'libxkbcommon' 'polkit' 'linux>=5.4.35' 'lzo' 'libinput' 'pcre' 'libdisplay-info' 'tinyxml2' ) [[ -n "$_clangbuild" ]] && depends+=('glu')