While trying to build the latest git, I've come up with a few patches that may be useful. I've built the RPi/RPi2 and Generic x86_64 targets.
BUILDING FOR x86_64:
After running $ PROJECT=Generic ARCH=x86_64 make image, the first error that appears is with Samba:
cp: cannot overwrite non-directory '(...)/http://LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel/image/system/usr/lib64' with directory '(...)/http://LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel/samba-4.7.4/.install_pkg/usr/lib64'
This is caused by some perl modules. In http://LibreELEC.tv/packages/network/samba/package.mk, there is already a command to remove then:
But this is not enough, because while some systems install perl modules into /usr/share/, some install then into /usr/lib*/. Thus I've had to insert the following lines in the package.mk for samba:
rm -rf $INSTALL/usr/lib64/perl*
rmdir $INSTALL/usr/lib64
This will remove the lib64 directory, but only if the only files under it were the perl modules. This way it will fail again if something else install there. This is a bug but I don't know if with samba, gentoo or libreelec, because this causes the perl files to be installed under /usr/lib64/ under the 32-bit raspberry pi builds!
After continuing the build, the next error is with open-vm-tools about libdnet:
../include/config.h:290:5: error: type of 'strlcpy' does not match original declaration [-Werror=lto-type-mismatch]
This can be fixed by creating the following patch in http://LibreELEC.tv/packages/network/libdnet/patches/00-fix_strlcpy_strlcat.patch:
diff -Naur libdnet-1.12/acconfig.h libdnet-1.12-patch/acconfig.h
--- libdnet-1.12/acconfig.h 2018-02-01 15:55:19.346009246 -0500
+++ libdnet-1.12-patch/acconfig.h 2018-02-01 15:59:14.826008240 -0500
@@ -20,11 +20,11 @@
#endif
#ifndef HAVE_STRLCAT
-int strlcat(char *, const char *, int);
+size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
-int strlcpy(char *, const char *, int);
+size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRSEP
diff -Naur libdnet-1.12/include/config.h.in libdnet-1.12-patch/include/config.h.in
--- libdnet-1.12/include/config.h.in 2018-02-01 15:51:57.346010109 -0500
+++ libdnet-1.12-patch/include/config.h.in 2018-02-01 15:59:47.316008101 -0500
@@ -282,11 +282,11 @@
#endif
#ifndef HAVE_STRLCAT
-int strlcat(char *, const char *, int);
+size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
-int strlcpy(char *, const char *, int);
+size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRSEP
diff -Naur libdnet-1.12/trunk/acconfig.h libdnet-1.12-patch/trunk/acconfig.h
--- libdnet-1.12/trunk/acconfig.h 2018-02-01 15:51:57.356010109 -0500
+++ libdnet-1.12-patch/trunk/acconfig.h 2018-02-01 16:00:08.526008010 -0500
@@ -20,11 +20,11 @@
#endif
#ifndef HAVE_STRLCAT
-int strlcat(char *, const char *, int);
+size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
-int strlcpy(char *, const char *, int);
+size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRSEP
diff -Naur libdnet-1.12/trunk/include/config.h.in libdnet-1.12-patch/trunk/include/config.h.in
--- libdnet-1.12/trunk/include/config.h.in 2018-02-01 15:51:57.356010109 -0500
+++ libdnet-1.12-patch/trunk/include/config.h.in 2018-02-01 16:00:34.786007898 -0500
@@ -282,11 +282,11 @@
#endif
#ifndef HAVE_STRLCAT
-int strlcat(char *, const char *, int);
+size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
-int strlcpy(char *, const char *, int);
+size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRSEP
Display More
This is because the auto configuration files for libdnet had the wrong type defined for strlcpy and strlcat.
After resuming the build again, yet another errors happens, this time with the slang package, but this will not happen in every gentoo system:
onig-module.c:27:10: fatal error: oniguruma.h: No such file or directory
This is caused by having this library installed under /usr in the host. To fix it, simply disable it by adding this line to http://LibreELEC.tv/packages/devel/slang/package.mk:
After this, LibreELEC will build successfully!
BUILDING FOR RASPBERRY PI/RASPBERRY PI 2:
This time I didn't look deep into the problems, just worked around them.
The package nss had trouble building, showing the following error:
Raspbery Pi: ../../../../dist/Linux4.12_arm_armv6zk-libreelec-linux-gnueabi-gcc-7.2.0_glibc_PTH_OPT.OBJ/lib/libfreebl.a: error adding symbols: Archive has no index; run ranlib to add one
Raspberry Pi 2: ../../../dist/Linux4.12_arm_armv7ve-libreelec-linux-gnueabi-gcc-7.2.0_glibc_PTH_OPT.OBJ/lib/libfreebl.a: error adding symbols: Archive has no index; run ranlib to add one
All that I did was run ranlib in the libraries:
Raspberry Pi: LibreELEC.tv $ ./build.LibreELEC-RPi.arm-9.0-devel/toolchain/bin/armv6zk-libreelec-linux-gnueabi-ranlib ./build.LibreELEC-RPi.arm-9.0-devel/nss-3.29.5/dist/Linux4.12_arm_armv6zk-libreelec-linux-gnueabi-gcc-7.2.0_glibc_PTH_OPT.OBJ/lib/libfreebl.a
Raspberry Pi 2: LibreELEC.tv $ ./build.LibreELEC-RPi2.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-ranlib ./build.LibreELEC-RPi2.arm-9.0-devel/nss-3.29.5/dist/Linux4.12_arm_armv7ve-libreelec-linux-gnueabi-gcc-7.2.0_glibc_PTH_OPT.OBJ/lib/libfreebl.a
After this, the error kept happening. Here is the list of libraries that I've had to run ranlib on:
libfreebl.a
libdbm.a
libnssckfw.a
libnssb.a
libsmime.a
libssl.a
libnss.a
libsectool.a
libpkcs12.a
libpkcs7.a
libcerthi.a
libcryptohi.a
libpk11wrap.a
libsoftokn.a
libcertdb.a
libnsspki.a
libnssdev.a
libpkixtop.a
libpkixutil.a
libpkixsystem.a
libpkixcrlsel.a
libpkixmodule.a
libpkixstore.a
libpkixparams.a
libpkixchecker.a
libpkixpki.a
libpkixresults.a
libpkixcertsel.a
libcrmf.a
libjar.a
I couldn't run ranlib in all of them at the same time, because some were not created yet. But after a few, they would all appear and the same time and I could run all the remaining commands in one go.
That's it! Everything worked perfectly.
(By the way, the build command is outdated in the wiki for RPi)