Solved fmt link errors when building Kodi 18 alpha 1 from source
#1
I previously built Kodi for LinHES 8.5.1 (based on x86_64 Arch Linux).  However, there were some recent updates to certain libraries and I am trying to compile Kodi from the same PKGBUILD file as before.  The fmt library was not included with LinHES, so I built that from source as well.  When I am trying to build Kodi, I get approximately 20 errors related to linking to fmt and suggesting compiling with -FPIC.  For example:
Code:
/usr/bin/ld.gold: error: /usr/local/lib/libfmt.a(format.cc.o): requires unsupported dynamic reloc 11; recompile with -fPIC

I have tried compiling both fmt and Kodi with -fPIC, but it has not made any impact.  I've also tried adding a PKGBUILD cmake flag of:
Code:
-DENABLE_INTERNAL_FMT=on
but then I get the following error:
Code:
make[2]: ***No rule to make target 'build/lib/libfmt.a', needed by 'kodi-x11'.  Stop.

I'm not quite sure what steps to take next and I was hoping to get some guidance here.  Please let me know what additional information I could provide to get the appropriate feedback.  Thanks!
Reply
#2
cmake -DENABLE_INTERNAL_FMT=on must work. Start from a clean build dir. If it still fails provide the cmake output and the compiler error when running make VERBOSE=1 V=1
Reply
#3
(2018-06-07, 13:53)wsnipex Wrote:
Code:
cmake -DENABLE_INTERNAL_FMT=on must work. Start from a clean build dir. If it still fails provide the cmake output and the compiler error when running make VERBOSE=1 V=1
 @wsnipex I am downloading the released Kodi 18 Alpha 1 from: https://github.com/xbmc/xbmc/archive/18.0a1-Leia.tar.gz
Then I enter the xbmc-18.0a1-Leia folder and run:
Code:
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib -DLIRC_DEVICE=/run/lirc/lircd -DENABLE_AIRTUNES=off -DENABLE_INTERNAL_INTERNAL_FMT=on .

cmake output:
https://pastebin.com/diKw6CSc

Then, per your instructions I ran:
Code:
make VERBOSE=1 V=1
The make log is too large to post on pastebin, so here is the last bit where the error occurs:
https://pastebin.com/rHbypDAL

Let me know if you need the full nearly 4 MB log.  Is there a step somewhere that I am missing?
Reply
#4
Code:
-DENABLE_INTERNAL_INTERNAL_FMT
is wrong.
correct: -DENABLE_INTERNAL_FMT

if that still doesn't work, run make fmt VERBOSE=1 V=1


Alternatively, install our fmt manually:
Code:
cd tools/depends/target/libfmt/
make PREFIX=/usr/local

after that cmake should find it
Reply
#5
I think that was just a typo on my post.  I am not able to copy/paste from the machine that I am compiling from to the machine I am posting from.  I will double-check this evening and try your other suggestions and post back with the results.
Reply
#6
@wsnipex thanks, 
Code:
make fmt VERBOSE=1 V=1
seems to have done the trick.  Working on building the package with PKGBUILD now and if all goes smooth, I will mark as solved.
Reply
#7
@wsnipex I am experiencing this again with beta 2.  I see that there is a build/lib64/libfmt.a but there
Code:
No rule to make target 'build/lib/libfmt.a', needed by 'kodi-x11'
Is there a simple workaround for this?
Reply
#8
you need to provide more info. Full cmake output, CMakeCache.txt and build error
Reply
#9
Try with the following change
diff:

--- a/cmake/modules/FindFmt.cmake
+++ b/cmake/modules/FindFmt.cmake
@@ -40,4 +40,5 @@
PREFIX ${CORE_BUILD_DIR}/fmt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}
+ -DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DFMT_DOC=OFF
Reply
#10
@knappster - Highly recommend that you use my PKGBUILD as a guide: https://aur.archlinux.org/packages/kodi-pre-release/
Need help programming a Streamzap remote?
Reply
#11
Thanks all for the responses.  I will see if @Rechi or @graysky solutions work and if not, I will report back with cmake output for more assistance.
Reply
#12
(2018-09-13, 00:34)knappster Wrote: Thanks all for the responses.  I will see if @Rechi or @graysky solutions work and if not, I will report back with cmake output for more assistance.
 If LinHES is tracking/adjusting their stuff to match Arch's my PKGBUILD will work.
Need help programming a Streamzap remote?
Reply
#13
@Rechi thanks, your patch worked.
@graysky I will try your PKGBUILD over the weekend. Looks like you've put a lot of work into it.
Reply
#14
@graysky your PKGBUILD works well, too. The only change I needed to make was removing the libpulse dependencies. I haven't tested the package on a live system yet and there could be some other minor changes required, but I will keep it in mind for the future. BTW, is there a reason you were using alpha instead of beta for the components?
Reply
#15
(2018-09-16, 15:32)knappster Wrote: @graysky your PKGBUILD works well, too. The only change I needed to make was removing the libpulse dependencies. I haven't tested the package on a live system yet and there could be some other minor changes required, but I will keep it in mind for the future. BTW, is there a reason you were using alpha instead of beta for the components?
 This PKGBUILD maximizes features.  You can omit what you don't need (ie libpulse, afpfs-ng, bluez-libs, libcec, libplist,  libvdpau, lirc, libssh, shairplay, smbclient, speex, etc.), just be sure you're building in a clean chroot that also lacks whatever so cmake doesn't autodetect them.  Use arch-devtools and see the wiki (arch) for usage.

I am using the current tagged components, most of which are "alpha":

https://github.com/xbmc/FFmpeg/tags
https://github.com/xbmc/libdvdcss/tags
https://github.com/xbmc/libdvdnav/tags
https://github.com/xbmc/libdvdread/tags
Need help programming a Streamzap remote?
Reply

Logout Mark Read Team Forum Stats Members Help
fmt link errors when building Kodi 18 alpha 1 from source0