v17 Cannot compile on RPi2 due to libcrossguid errors
#1
Using Arch ARM, I am unable to build 17.4 due to the following error near the very end of the build (shown below). I have been building kodi on the RPi2 like this since version 17 without problems... I am even able to build 17.4rc1 without issue. It is just 17.4 (final) that causes this problem.

Note that I rebuilt the system's libcrossguid with the -fPIC switch before I starting the kodi build, but it still errors out as shown. Am I misinterpreting the error? Is the error telling me I need to add -fPIC to my CFLAGS/CXXFLAGS when building kodi not libcrossguid?

Thanks for any insights.

Code:
_CPU=cortex-a7
cmake -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DCMAKE_PREFIX_PATH=/opt/vc \
    -DCORE_SYSTEM_NAME=rbpi \
    -DWITH_CPU="$_CPU" \
    -DENABLE_EVENTCLIENTS=ON \
    -DENABLE_OPENGL=OFF \
    -DENABLE_X11=OFF \
    -DENABLE_VAAPI=OFF \
    -DENABLE_VDPAU=OFF \
    -DLIRC_DEVICE=/run/lirc/lircd \
    ../"xbmc-$pkgver-$_codename"/project/cmake

  make && make preinstall
...
[100%] Linking CXX executable kodi.bin
/usr/bin/ld: build/lib/libcrossguid.a(guid.cpp.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
build/lib/libcrossguid.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
distcc[25077] ERROR: compile (null) on localhost failed
make[2]: *** [CMakeFiles/kodi.dir/build.make:436: kodi.bin] Error 1
make[1]: *** [CMakeFiles/Makefile2:523: CMakeFiles/kodi.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Need help programming a Streamzap remote?
Reply
#2
Ah, I see now the error means that the kodi build itself requires the -fPIC switch (successfully built it without modifying the system's libcrossguid package... what changed between 17.4rc1 and 17.4 (final) that requires -fPIC and is it expected?
Need help programming a Streamzap remote?
Reply
#3
Not sure what that error is about, but for Raspbian, I do not compile/make a separate package for libcrossguid anymore, I use this cmake flag to build it, it works for 17.4 final:
-DENABLE_INTERNAL_CROSSGUID=ON

See if that works for you.
Reply
#4
@rascas - I get the same error strangely with your switch and without the libcross package installed:
Code:
...

-- Found CrossGuid: /nfs/PKGBUILDs/alarm/kodi-rbp/src/kodi-build/build/lib/libcrossguid.a (found version "8f399e8bd4")

...
[100%] Linking CXX executable kodi.bin
/usr/bin/ld: build/lib/libcrossguid.a(guid.cpp.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
build/lib/libcrossguid.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
distcc[28119] ERROR: compile (null) on localhost failed
make[2]: *** [CMakeFiles/kodi.dir/build.make:436: kodi.bin] Error 1
make[1]: *** [CMakeFiles/Makefile2:523: CMakeFiles/kodi.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

My complete build stanza:
Code:
_CPU=cortex-a7
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DCMAKE_PREFIX_PATH=/opt/vc \
    -DCORE_SYSTEM_NAME=rbpi \
    -DWITH_CPU="$_CPU" \
    -DENABLE_EVENTCLIENTS=ON \
    -DENABLE_OPENGL=OFF \
    -DENABLE_X11=OFF \
    -DENABLE_VAAPI=OFF \
    -DENABLE_VDPAU=OFF \
    -DLIRC_DEVICE=/run/lirc/lircd \
    -DENABLE_INTERNAL_CROSSGUID=ON \
    ../"xbmc-$pkgver-$_codename"/project/cmake
  
  make
  make preinstall
Need help programming a Streamzap remote?
Reply
#5
Which gcc version are you using ? If 7.X it might be the problem, but I am not an expert on that so I am afraid I can help you much more.
Reply
#6
Yes, Arch ARM uses a pretty packages including gcc (currently 7.1.1 I believe).
Need help programming a Streamzap remote?
Reply
#7
Delete the build dir before rebuilding. It seems to have found a previously compiled version of that lib, so it won't be compiling it again.
Reply
#8
(2017-08-24, 08:53)KlotX Wrote: Delete the build dir before rebuilding. It seems to have found a previously compiled version of that lib, so it won't be compiling it again.

I did but it is still there suggesting it's getting build by the package. The solution for building with the internal version is to add -fPIC to the CFLAGS and CXXFLAGS before building:

Code:
CFLAGS+=" -fPIC"
CXXFLAGS+=" -fPIC"

Now I can remove the dependency of the external libcrossguid altogether. Thank you for the suggestion.
Need help programming a Streamzap remote?
Reply

Logout Mark Read Team Forum Stats Members Help
Cannot compile on RPi2 due to libcrossguid errors0