quarnster / boxeebox-xbmc

Aiming to get xbmc up and running on the boxee box
Other
118 stars 44 forks source link

New toolchain build test project #160

Open quasar1 opened 9 years ago

quasar1 commented 9 years ago

@quarnster I said i would have a go at using some of the toolchain elements from the boxeebox-intel-sdk toolchain you recently made. Binutls, GCC 4.9.2 Glibc 2.19 Well, I have made some headway on this, tried on OSX and FreeBSD and I'm currently on Ubuntu 15.04 LTS amd64, (I will test on OSX later).

I had to rework the libs totally as I was getting the libc built in 'iconv' causing linking issues. Undefined reference errors. So I made zlib, libiconv, ncurses the first libs to be built, I had to patch libiconv to build, I have tried to build it in the past and always get errors. Anyway it built and I had a mammoth task getting everything 'happy' and Kodi to see them and recognise them properly. I'm not sure if the toolchain is totally stable and working as I had some issues building taglib, but it could be the newer cmake that's in this env. I managed to get afpfs-ng to cross-compile so had a bash at mysql and got that to cross-complie too. Mysql had issues finding the curses.h, I manged to force it and it worked but it made some complaints about the way I did it... but it did build and install.. (might need you to do some magic there).

Build finished compiling with no errors.... Testing build on Boxee:

/tmp/mnt/nas-xbmc/kodi.bin: error while loading shared libraries: ./libstdc++.so.6: ELF file OS ABI invalid

Thought that might happen, incompatible with the older glibc version the Boxee is running.

Kodi config.log: http://pastebin.com/GbxtPGin

I suppose it's not a total fail as I have managed to cross complie certain libs and get libiconv and gettext working so it should compile on Ubuntu 32 and OSX, (will test).

Test build here if you want to take a look: https://www.sendspace.com/file/dwpk2y

Without a toolchain that can do c++11, it's no longer possible to build Kodi 15.

quarnster commented 9 years ago

Binutls, GCC 4.8.2 Glibc 2.19

What about the kernel version? If you didn't use 2.6.28 I'd suggest that that is the reason for:

./libstdc++.so.6: ELF file OS ABI invalid

quasar1 commented 9 years ago

I used kernel 2.6.28, binutls 2.24 I might try that --enable-oldest-abi=setting for glibc again, although I'm unsure what to set it to. Is there way way to find out what ABI the Boxee requires?

A little googling I find this... https://sourceware.org/bugzilla/show_bug.cgi?id=6652 --enable-oldest-abi={GLIBC_2.0,2.2,2.3,GLIBC_2.3}

"I am using GCC 4.3.1, and the 2.6.26-rc6 kernel headers."

Edit: Just tried --enable-oldest-abi=2.7 and it errors out. Back to the drawing board.

quasar1 commented 9 years ago

@quarnster I forgot to ask, your recent changes use sed -i bak is that for building on OSX? Reason being on Ubuntu 15.04 lts amd64 I had to change to -ibak for it to work. I will see what building on my Yosemite build env throws up to compare.

I am working on a PR to address the OSX build changes you made which will hopefully cross-compile on Ubuntu 32 Ubuntu 64 and OSX with minimal changes for each platform. The goal is none.

quarnster commented 9 years ago

Yeah it was for osx. One way to fix could be to set a SED variable to sed on linux and gsed on OSX and then use ${SED} in the command lines

quasar1 commented 9 years ago

Something like this?:

if(${CMAKE_SYSTEM_NAME} STREQUAL "linux")
    set(SED_COMMAND -ibak)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
    set(SED_COMMAND -i bak)
endif()

Then use ${SED_COMMAND} in the commandline where applicable?

quarnster commented 9 years ago

yeah, that could work too

quasar1 commented 9 years ago

Had to do:

if(${CMAKE_SYSTEM_NAME} STREQUAL "linux")
    set(SED_COMMAND -i)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
    set(SED_COMMAND -i bak)
endif()

Appears to be working, needs testing on OSX though.

quasar1 commented 9 years ago

Well it didn't work, it looks like it doesn't like having a cmake command within the string. I was thinking of something like this:

ExternalProject_Add(
    taglib
    URL             http://taglib.github.io/releases/taglib-1.8.tar.gz
    URL_MD5         dcb8bd1b756f2843e18b1fdf3aaeee15
    PATCH_COMMAND
if(${CMAKE_SYSTEM_NAME} STREQUAL "linux")
    (COMMAND sed -e "54,61d" -i taglib/toolkit/taglib.h)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
    (COMMAND sed -e "54,61d" -i bak taglib/toolkit/taglib.h)
endif()
    CONFIGURE_COMMAND   ${BASIC_CMAKE} -DENABLE_STATIC=ON -DENABLE_STATIC_RUNTIME=ON
    DEPENDS         zlib pcre iconv
)

Doesn't work but you get the idea, I just need some guidance on how to pull it off.

EDIT: Found this: https://lists.gnupg.org/pipermail/gnutls-devel/2014-July/007040.html

Going to see if using -i.bak works on linux