Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build on Rpi 3+ with AArch64 #171

Open
ghost opened this issue Feb 28, 2022 · 6 comments
Open

Can't build on Rpi 3+ with AArch64 #171

ghost opened this issue Feb 28, 2022 · 6 comments

Comments

@ghost
Copy link

ghost commented Feb 28, 2022

I am not sure if this is an issue with arch, my setup or ffmpegdirect. I am trying to build but I get an -fpic error. I noticed someone else had the same issue and they compiled with -flto. In my PKGBUILD, I added the option of lto but it gave me a different error. I tried to add -fpic to my flags through /etc/makepkg.conf but it didn't work

without lto
/home/alarm/packages/ffmpeg/src/inputstream.ffmpegdirect-19.0.1-Nexus/build/build/depends/lib/libhogweed.a(bignum.o): in function nettle_mpz_sizeinbase_256_s': /home/alarm/packages/ffmpeg/src/inputstream.ffmpegdirect-19.0.1-Nexus/build/build/nettle/src/nettle/bignum.c:61:(.text+0xd8): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol __gmpz_sizeinbase' defined in .text section in /home/alarm/packages/ffmpeg/src/inputstream.ffmpegdirect-19.0.1-Nexus/build/build/depends/lib/libgmp.a(sizeinbase.o)
/usr/bin/ld: /home/alarm/packages/ffmpeg/src/inputstream.ffmpegdirect-19.0.1-Nexus/build/build/nettle/src/nettle/bignum.c:61: warning: too many GOT entries for -fpic, please recompile with -fPIC
collect2: error: ld returned 1 exit status
make[5]: *** [CMakeFiles/inputstream.ffmpegdirect.dir/build.make:330: inputstream.ffmpegdirect.so.20.1.0] Error 1
make[4]: *** [CMakeFiles/Makefile2:110: CMakeFiles/inputstream.ffmpegdirect.dir/all] Error 2
make[3]: *** [Makefile:156: all] Error 2
make[2]: *** [CMakeFiles/inputstream.ffmpegdirect.dir/build.make:88: inputstream.ffmpegdirect-prefix/src/inputstream.ffmpegdirect-stamp/inputstream.ffmpegdirect-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:163: CMakeFiles/inputstream.ffmpegdirect.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
==> ERROR: A failure occurred in build().

With lto:
make[5]: *** [CMakeFiles/inputstream.ffmpegdirect.dir/build.make:330: inputstream.ffmpegdirect.so.20.1.0] Error 1
make[5]: *** Deleting file 'inputstream.ffmpegdirect.so.20.1.0'
make[4]: *** [CMakeFiles/Makefile2:110: CMakeFiles/inputstream.ffmpegdirect.dir/all] Error 2
make[3]: *** [Makefile:156: all] Error 2
make[2]: *** [CMakeFiles/inputstream.ffmpegdirect.dir/build.make:88: inputstream.ffmpegdirect-prefix/src/inputstream.ffmpegdirect-stamp/inputstream.ffmpegdirect-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:163: CMakeFiles/inputstream.ffmpegdirect.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
==> ERROR: A failure occurred in build().

Can someone point me in the right direction?

@ghost ghost changed the title Can't build on AA Can't build on Rpi 3+ with AArch64 Feb 28, 2022
@ghost
Copy link
Author

ghost commented Mar 1, 2022

I'm trying to build the Nexus version. I changed my PKGBUILD to download the Nexus version of ffmpegdirect and kodi.

@phunkyfish
Copy link
Collaborator

phunkyfish commented Mar 1, 2022

Can you explain the steps you went through to get to this error?

try following this closed issue thread: #89

@ghost
Copy link
Author

ghost commented Mar 1, 2022

Thanks for the help. I modified the PKGBUILD to grab the Nexus version of each. I then did a makepkg command. I tied both with the option of lto and makeflags. I also tried without the options line in the PKGBUILD. I also tried adding the -fpic flag to the cmake command in the /etc/makepkg.conf.

In the closed thread, he said he used lto. I tried this by adding the options(lto) but it did not compile. I could try adding it to make cmake command in the /etc/makepkg.conf.

# Maintainer: ivanich
pkgname=kodi-addon-inputstream-ffmpegdirect
pkgver=20.0.1
pkgrel=1
pkgdesc="Inputstream ffmpegdirect kodi plugin"
_koditarget=Nexus
_gitname=inputstream.ffmpegdirect
_kodiver=master
arch=('armv6h' 'armv7h' 'aarch64' 'i686' 'x86_64')
url="https://github.com/xbmc/${_gitname}"
license=('GPL')
groups=('kodi')
makedepends=('cmake' 'git' 'autoconf' 'automake' 'patch' 'nasm')
provides=('kodi-addon-inputstream-ffmpegdirect')
depends=('kodi')
options=(lto) # also tried makeflags with it set to -fpic
source=("https://github.com/xbmc/inputstream.ffmpegdirect/archive/refs/heads/Nexus.zip"
        "https://github.com/xbmc/xbmc/archive/refs/heads/master.zip"
)

sha256sums=('15735e176c547b9f82a79011e59a292f7ca1aba1976e988bcd2bff59b30cfd93'
            'SKIP')

prepare() {
        cd xbmc-${_kodiver}
}

build() {
        mkdir -p "${_gitname}-${pkgver}-${_koditarget}/build"
        cd "${_gitname}-${pkgver}-${_koditarget}/build"

        cmake \
                -DCMAKE_INSTALL_PREFIX=/usr \
                -DCMAKE_INSTALL_LIBDIR=/usr/lib/kodi \
                -DCMAKE_BUILD_TYPE=Release \
                -DBUILD_SHARED_LIBS=1 \
                -DADDONS_TO_BUILD=${_gitname} \
                -DADDONS_SRC_PREFIX=../.. \
                ../../xbmc-${_kodiver}/cmake/addons
        make
}

package() {
        cd "${_gitname}-${pkgver}-${_koditarget}/build"
        install -d "${pkgdir}/usr"
        mv .install/lib "${pkgdir}/usr/"
        mv .install/share "${pkgdir}/usr/"
}

@phunkyfish
Copy link
Collaborator

Maybe ask the person who solved it for advice on this thread?

@NicolasThierion
Copy link

@stuckinthe I managed to get it compile on rpi Aarch43 thanks to your comment above.

Installed on manjaro arm with the followinf command

yay kodi-addon-inputstream-ff --editmenu

then added options before sources=...

options=("lto")
source=("https://github.com/xbmc/inputstream.ffmpegdirect/archive/refs/heads/Nexus.zip"
        "https://github.com/xbmc/xbmc/archive/refs/heads/master.zip"
)

Your snoppet was close, just missing the double quotes for me.

@opengk
Copy link

opengk commented Jan 5, 2024

Indeed using lto with aarch64 is solving this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants