From 6ca7dbffd6db9cdcee6f9d53bef357cf7a772ad5 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Sun, 13 Jun 2021 20:02:38 +0200 Subject: [PATCH 01/10] enigma2: split out glibc (r)dependencies Needed for build against musl libc Signed-off-by: Andrea Adami --- meta-openpli/recipes-openpli/enigma2/enigma2.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta-openpli/recipes-openpli/enigma2/enigma2.bb b/meta-openpli/recipes-openpli/enigma2/enigma2.bb index eb719d8e53..88d9c52dc9 100644 --- a/meta-openpli/recipes-openpli/enigma2/enigma2.bb +++ b/meta-openpli/recipes-openpli/enigma2/enigma2.bb @@ -24,19 +24,21 @@ RDEPENDS_${PN} = " \ alsa-conf \ enigma2-fonts \ ethtool \ - glibc-gconv-iso8859-15 \ ${PYTHON_RDEPS} \ " +RDEPENDS_${PN}_append_libc-glibc = " glibc-gconv-iso8859-15" + RRECOMMENDS_${PN} = " \ enigma2-plugin-skins-pli-hd \ hotplug-e2-helper \ - glibc-gconv-utf-16 \ python-sendfile \ ofgwrite \ virtual/enigma2-mediaservice \ " +RRECOMMENDS_${PN}_append_libc-glibc = " glibc-gconv-utf-16" + PYTHON_RDEPS = " \ python-codecs \ python-core \ From 0dfe39071824bbffa8ba9708e8bed7dda82fce13 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Sun, 13 Jun 2021 20:06:33 +0200 Subject: [PATCH 02/10] openpli-image: split out glibc-binary-localedata-en-gb Needed for build against musl libc Signed-off-by: Andrea Adami --- meta-openpli/recipes-openpli/images/openpli-image.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-openpli/recipes-openpli/images/openpli-image.bb b/meta-openpli/recipes-openpli/images/openpli-image.bb index b1831c0e37..0e3d55fd47 100644 --- a/meta-openpli/recipes-openpli/images/openpli-image.bb +++ b/meta-openpli/recipes-openpli/images/openpli-image.bb @@ -19,7 +19,6 @@ IMAGE_INSTALL = "\ e2fsprogs-tune2fs \ fakelocale \ fuse-exfat \ - glibc-binary-localedata-en-gb \ kernel-params \ modutils-loadscript \ cifs-utils \ @@ -43,6 +42,8 @@ IMAGE_INSTALL = "\ vsftpd \ " +IMAGE_INSTALL_append_libc-glibc = " glibc-binary-localedata-en-gb" + export IMAGE_BASENAME = "openpli" IMAGE_LINGUAS = "" IMAGE_FEATURES += "package-management" From bd881fe0c5cfd03c0d61d444baab59a31c528968 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Thu, 17 Jun 2021 14:53:48 +0200 Subject: [PATCH 03/10] libtuxtxt: fix build with musl fix warnings patches sent upstream Signed-off-by: Andrea Adami --- ...add-function-prototype-for-writeproc.patch | 28 +++++++++++++ .../0002-libtuxtxt-fix-build-warnings.patch | 41 +++++++++++++++++++ ...e-unnecessary-unset-DEBUG-workaround.patch | 33 +++++++++++++++ .../0004-libtuxtxt-fix-build-with-musl.patch | 36 ++++++++++++++++ .../recipes-multimedia/tuxtxt/libtuxtxt.bb | 13 ++++-- 5 files changed, 147 insertions(+), 4 deletions(-) create mode 100644 meta-openpli/recipes-multimedia/tuxtxt/files/0001-libtuxtxt-add-function-prototype-for-writeproc.patch create mode 100644 meta-openpli/recipes-multimedia/tuxtxt/files/0002-libtuxtxt-fix-build-warnings.patch create mode 100644 meta-openpli/recipes-multimedia/tuxtxt/files/0003-libtuxtxt-remove-unnecessary-unset-DEBUG-workaround.patch create mode 100644 meta-openpli/recipes-multimedia/tuxtxt/files/0004-libtuxtxt-fix-build-with-musl.patch diff --git a/meta-openpli/recipes-multimedia/tuxtxt/files/0001-libtuxtxt-add-function-prototype-for-writeproc.patch b/meta-openpli/recipes-multimedia/tuxtxt/files/0001-libtuxtxt-add-function-prototype-for-writeproc.patch new file mode 100644 index 0000000000..6e3fe6f838 --- /dev/null +++ b/meta-openpli/recipes-multimedia/tuxtxt/files/0001-libtuxtxt-add-function-prototype-for-writeproc.patch @@ -0,0 +1,28 @@ +From f0752587e4ebf12bc835aee5c9e96a22ded00ea9 Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Thu, 17 Jun 2021 12:40:36 +0200 +Subject: [PATCH 1/4] libtuxtxt: add function prototype for writeproc() + +silence build warning about implicit declaration + +Signed-off-by: Andrea Adami +--- + tuxtxt_common.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tuxtxt_common.h b/tuxtxt_common.h +index 7fa5168..1e72b5f 100644 +--- a/tuxtxt_common.h ++++ b/tuxtxt_common.h +@@ -23,6 +23,8 @@ + + #include + ++void writeproc(const char* dest, const char *value); ++ + const char *ObjectSource[] = + { + "(illegal)", +-- +2.17.1 + diff --git a/meta-openpli/recipes-multimedia/tuxtxt/files/0002-libtuxtxt-fix-build-warnings.patch b/meta-openpli/recipes-multimedia/tuxtxt/files/0002-libtuxtxt-fix-build-warnings.patch new file mode 100644 index 0000000000..2d150e99ae --- /dev/null +++ b/meta-openpli/recipes-multimedia/tuxtxt/files/0002-libtuxtxt-fix-build-warnings.patch @@ -0,0 +1,41 @@ +From 1f31172bd370875da49a6538911e2259e29154b5 Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Thu, 17 Jun 2021 11:24:55 +0200 +Subject: [PATCH 2/4] libtuxtxt: fix build warnings + +In file included from ../git/libtuxtxt/libtuxtxt.c:40: +../git/libtuxtxt/tuxtxt_common.h: In function 'tuxtxt_RenderCharIntern': +../git/libtuxtxt/tuxtxt_common.h:4372:14: + warning: comparison of distinct pointer types lacks a cast + 4372 | if ((p > pstart) && (memcmp(p-4,bgra[bgcolor],4)==0)) + | ^ +../git/libtuxtxt/tuxtxt_common.h:4387:14: + warning: comparison of distinct pointer types lacks a cast + 4387 | if ((p > pstart) && (memcmp(p-4,bgra[fgcolor],4)==0)) + | ^ +../git/libtuxtxt/tuxtxt_common.h:4415:13: + warning: comparison of distinct pointer types lacks a cast + 4415 | if ((p > pstart) && (memcmp(p-4,bgra[fgcolor],4)==0)) + | ^ + +Signed-off-by: Andrea Adami +--- + tuxtxt_common.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tuxtxt_common.h b/tuxtxt_common.h +index 1e72b5f..5e994d7 100644 +--- a/tuxtxt_common.h ++++ b/tuxtxt_common.h +@@ -4346,7 +4346,7 @@ void tuxtxt_RenderCharIntern(tstRenderInfo* renderinfo,int Char, tstPageAttr *At + for (Row = he; Row; Row--) /* row counts up, but down may be a little faster :) */ + { + int pixtodo = (renderinfo->usettf ? renderinfo->sbit->width : curfontwidth); +- char *pstart = p; ++ unsigned char *pstart = p; + + for (Bit = xfactor * (renderinfo->sbit->left + renderinfo->TTFShiftX); Bit > 0; Bit--) /* fill left margin */ + { +-- +2.17.1 + diff --git a/meta-openpli/recipes-multimedia/tuxtxt/files/0003-libtuxtxt-remove-unnecessary-unset-DEBUG-workaround.patch b/meta-openpli/recipes-multimedia/tuxtxt/files/0003-libtuxtxt-remove-unnecessary-unset-DEBUG-workaround.patch new file mode 100644 index 0000000000..7176924c31 --- /dev/null +++ b/meta-openpli/recipes-multimedia/tuxtxt/files/0003-libtuxtxt-remove-unnecessary-unset-DEBUG-workaround.patch @@ -0,0 +1,33 @@ +From aadba41fc81e8860fafa1fb6fb5059025a16318b Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Thu, 17 Jun 2021 10:25:14 +0200 +Subject: [PATCH 3/4] libtuxtxt: remove unnecessary unset DEBUG workaround + +Fix build warning about redefined DEBUG +To disable debug just add --without-debug when doing configure. + +Signed-off-by: Andrea Adami +--- + libtuxtxt.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/libtuxtxt.c b/libtuxtxt.c +index 476c7db..0376c04 100644 +--- a/libtuxtxt.c ++++ b/libtuxtxt.c +@@ -18,12 +18,6 @@ + * * + ******************************************************************************/ + +-#ifdef DEBUG +-#undef DEBUG +-#endif +- +-#define DEBUG 0 +- + #include + #include + +-- +2.17.1 + diff --git a/meta-openpli/recipes-multimedia/tuxtxt/files/0004-libtuxtxt-fix-build-with-musl.patch b/meta-openpli/recipes-multimedia/tuxtxt/files/0004-libtuxtxt-fix-build-with-musl.patch new file mode 100644 index 0000000000..41ca484587 --- /dev/null +++ b/meta-openpli/recipes-multimedia/tuxtxt/files/0004-libtuxtxt-fix-build-with-musl.patch @@ -0,0 +1,36 @@ +From 1bf1641c1d87749c6cdde2228f4c94fc9792941b Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Mon, 14 Jun 2021 23:49:35 +0200 +Subject: [PATCH 4/4] libtuxtxt: fix build with musl + +fix +libtuxtxt.c:47:46: error: + 'PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' + undeclared here (not in a function); + did you mean 'PTHREAD_MUTEX_INITIALIZER'? + +Signed-off-by: Andrea Adami +--- + libtuxtxt.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libtuxtxt.c b/libtuxtxt.c +index 0376c04..bc947e2 100644 +--- a/libtuxtxt.c ++++ b/libtuxtxt.c +@@ -38,7 +38,12 @@ + ******************************************************************************/ + + static int tuxtxt_initialized=0; ++ ++#ifdef __GLIBC__ + static pthread_mutex_t tuxtxt_control_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; ++#else ++static pthread_mutex_t tuxtxt_control_lock = {{PTHREAD_MUTEX_RECURSIVE}}; ++#endif + static pthread_mutex_t tuxtxt_key_queue_lock = PTHREAD_MUTEX_INITIALIZER; + + int tuxtxt_init() +-- +2.17.1 + diff --git a/meta-openpli/recipes-multimedia/tuxtxt/libtuxtxt.bb b/meta-openpli/recipes-multimedia/tuxtxt/libtuxtxt.bb index 5812b6184e..fa362003d9 100644 --- a/meta-openpli/recipes-multimedia/tuxtxt/libtuxtxt.bb +++ b/meta-openpli/recipes-multimedia/tuxtxt/libtuxtxt.bb @@ -3,16 +3,21 @@ LICENSE = "LGPLv2.1" LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" DEPENDS = "libpng freetype zlib" -inherit gitpkgv +inherit gitpkgv GITHUB_URI ?= "git://github.com" -SRC_URI = "${GITHUB_URI}/OpenPLi/tuxtxt.git" +SRC_URI = "${GITHUB_URI}/OpenPLi/tuxtxt.git \ + file://0001-libtuxtxt-add-function-prototype-for-writeproc.patch \ + file://0002-libtuxtxt-fix-build-warnings.patch \ + file://0003-libtuxtxt-remove-unnecessary-unset-DEBUG-workaround.patch \ + file://0004-libtuxtxt-fix-build-with-musl.patch \ + " S = "${WORKDIR}/git/libtuxtxt" PV = "2.0+git${SRCPV}" PKGV = "2.0+git${GITPKGV}" -EXTRA_OECONF = "--with-boxtype=generic DVB_API_VERSION=5" - inherit autotools pkgconfig + +EXTRA_OECONF = "--with-boxtype=generic DVB_API_VERSION=5 --without-debug" From e021770af0080010d457807d60a102d1249c2e93 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Thu, 17 Jun 2021 14:55:32 +0200 Subject: [PATCH 04/10] tuxtxt-enigma2: fix build with musl fix warnings patches sent upstream Signed-off-by: Andrea Adami --- ...gma2-fix-warning-and-build-with-musl.patch | 33 +++++++++++ ...t-enigma2-try-to-guess-return-values.patch | 56 +++++++++++++++++++ .../tuxtxt/tuxtxt-enigma2.bb | 5 +- 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 meta-openpli/recipes-multimedia/tuxtxt/files/0001-tuxtxt-enigma2-fix-warning-and-build-with-musl.patch create mode 100644 meta-openpli/recipes-multimedia/tuxtxt/files/0002-tuxtxt-enigma2-try-to-guess-return-values.patch diff --git a/meta-openpli/recipes-multimedia/tuxtxt/files/0001-tuxtxt-enigma2-fix-warning-and-build-with-musl.patch b/meta-openpli/recipes-multimedia/tuxtxt/files/0001-tuxtxt-enigma2-fix-warning-and-build-with-musl.patch new file mode 100644 index 0000000000..a70f1f6004 --- /dev/null +++ b/meta-openpli/recipes-multimedia/tuxtxt/files/0001-tuxtxt-enigma2-fix-warning-and-build-with-musl.patch @@ -0,0 +1,33 @@ +From 874596b1768a0e9fdc1919fd9b28be0575fd205f Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Tue, 15 Jun 2021 00:17:39 +0200 +Subject: [PATCH 1/2] tuxtxt-enigma2: fix warning and build with musl + +fix + | ../git/tuxtxt/tuxtxt.c:215:15: error: storage size of 's' isn't known + | 215 | struct stat s; + | | ^ + +With glibc this is only: + warning: implicit declaration of function 'stat' [-Wimplicit-function-declaration] + +Signed-off-by: Andrea Adami +--- + tuxtxt.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tuxtxt.h b/tuxtxt.h +index 7f40b09..c99ae5d 100644 +--- a/tuxtxt.h ++++ b/tuxtxt.h +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + #include + #include + +-- +2.17.1 + diff --git a/meta-openpli/recipes-multimedia/tuxtxt/files/0002-tuxtxt-enigma2-try-to-guess-return-values.patch b/meta-openpli/recipes-multimedia/tuxtxt/files/0002-tuxtxt-enigma2-try-to-guess-return-values.patch new file mode 100644 index 0000000000..12c9dbf59f --- /dev/null +++ b/meta-openpli/recipes-multimedia/tuxtxt/files/0002-tuxtxt-enigma2-try-to-guess-return-values.patch @@ -0,0 +1,56 @@ +From 1089cc8c9adf3229f0fbd32de539f2384d7646a3 Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Thu, 17 Jun 2021 13:45:12 +0200 +Subject: [PATCH 2/2] tuxtxt-enigma2: try to guess return values + + fix compiler warnings + The return values used here are hard to guess. Please review. + +../git/tuxtxt/tuxtxt.c: In function 'tuxtxt_run_ui': +../git/tuxtxt/tuxtxt.c:267:3: + warning: 'return' with no value, in function returning non-void + 267 | return; + | ^~~~~~ +../git/tuxtxt/tuxtxt.c:178:5: + note: declared here + 178 | int tuxtxt_run_ui(int pid, int demux) + | ^~~~~~~~~~~~~ +../git/tuxtxt/tuxtxt.c:277:3: + warning: 'return' with no value, in function returning non-void + 277 | return; + | ^~~~~~ +../git/tuxtxt/tuxtxt.c:178:5: + note: declared here + 178 | int tuxtxt_run_ui(int pid, int demux) + | ^~~~~~~~~~~~~ + +Signed-off-by: Andrea Adami +--- + tuxtxt.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tuxtxt.c b/tuxtxt.c +index f550688..9907420 100644 +--- a/tuxtxt.c ++++ b/tuxtxt.c +@@ -264,7 +264,7 @@ int tuxtxt_run_ui(int pid, int demux) + if (tuxtxt_cache.vtxtpid == -1 || renderinfo.fb == -1 || renderinfo.sx == -1 || renderinfo.ex == -1 || renderinfo.sy == -1 || renderinfo.ey == -1) + { + printf("TuxTxt \n"); +- return; ++ return -1; + } + + /* initialisations */ +@@ -274,7 +274,7 @@ int tuxtxt_run_ui(int pid, int demux) + tuxtxt_close(); + } + #endif +- return; ++ return 0; + } + + /* main loop */ +-- +2.17.1 + diff --git a/meta-openpli/recipes-multimedia/tuxtxt/tuxtxt-enigma2.bb b/meta-openpli/recipes-multimedia/tuxtxt/tuxtxt-enigma2.bb index f70296bc0f..e5980a89de 100644 --- a/meta-openpli/recipes-multimedia/tuxtxt/tuxtxt-enigma2.bb +++ b/meta-openpli/recipes-multimedia/tuxtxt/tuxtxt-enigma2.bb @@ -7,7 +7,10 @@ DESCRIPTION = "tuxbox tuxtxt for enigma2" inherit gitpkgv GITHUB_URI ?= "git://github.com" -SRC_URI = "${GITHUB_URI}/OpenPLi/tuxtxt.git" +SRC_URI = "${GITHUB_URI}/OpenPLi/tuxtxt.git \ + file://0001-tuxtxt-enigma2-fix-warning-and-build-with-musl.patch \ + file://0002-tuxtxt-enigma2-try-to-guess-return-values.patch \ + " S = "${WORKDIR}/git/tuxtxt" From 61b81d54e96b40e50d2fc45e2e26600589b92025 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Thu, 17 Jun 2021 15:35:48 +0200 Subject: [PATCH 05/10] dvd+rw-tools: fix build with musl fix growisofs.c:661:17: warning: implicit declaration of function 'major' growisofs.c:662:17: warning: implicit declaration of function 'minor' Signed-off-by: Andrea Adami --- .../dvd+rw-tools/dvd+rw-tools_7.1.bb | 2 +- .../dvd+rw-tools/files/add-major-minor.patch | 11 +++++++++++ .../dvd+rw-tools/files/fix-glibc2.28_major.patch | 12 ------------ 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 meta-openpli/recipes-multimedia/dvd+rw-tools/files/add-major-minor.patch delete mode 100644 meta-openpli/recipes-multimedia/dvd+rw-tools/files/fix-glibc2.28_major.patch diff --git a/meta-openpli/recipes-multimedia/dvd+rw-tools/dvd+rw-tools_7.1.bb b/meta-openpli/recipes-multimedia/dvd+rw-tools/dvd+rw-tools_7.1.bb index 9511b6770b..ad0d5e9a12 100644 --- a/meta-openpli/recipes-multimedia/dvd+rw-tools/dvd+rw-tools_7.1.bb +++ b/meta-openpli/recipes-multimedia/dvd+rw-tools/dvd+rw-tools_7.1.bb @@ -13,7 +13,7 @@ SRC_URI = "http://fy.chalmers.se/~appro/linux/DVD+RW/tools/dvd+rw-tools-${PV}.ta file://08-cdrkit-code.dpatch;apply=yes \ file://09-cdrkit-doc.dpatch;apply=yes \ file://10-includes.dpatch;apply=yes \ - file://fix-glibc2.28_major.patch \ + file://add-major-minor.patch \ " do_configure() { diff --git a/meta-openpli/recipes-multimedia/dvd+rw-tools/files/add-major-minor.patch b/meta-openpli/recipes-multimedia/dvd+rw-tools/files/add-major-minor.patch new file mode 100644 index 0000000000..b76d560a1c --- /dev/null +++ b/meta-openpli/recipes-multimedia/dvd+rw-tools/files/add-major-minor.patch @@ -0,0 +1,11 @@ +add 'minor' and 'major' for glibc and musl +--- a/growisofs.c 2021-06-17 15:06:03.161597057 +0200 ++++ b/growisofs.c 2021-06-17 15:04:34.601229248 +0200 +@@ -440,6 +440,7 @@ + #include + #include + #include ++#include + #include + #include + #include "mp.h" diff --git a/meta-openpli/recipes-multimedia/dvd+rw-tools/files/fix-glibc2.28_major.patch b/meta-openpli/recipes-multimedia/dvd+rw-tools/files/fix-glibc2.28_major.patch deleted file mode 100644 index 66e50714bf..0000000000 --- a/meta-openpli/recipes-multimedia/dvd+rw-tools/files/fix-glibc2.28_major.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/growisofs.c 2018-08-17 23:10:21.389101104 +0200 -+++ b/growisofs.c 2018-08-17 23:11:10.307819704 +0200 -@@ -440,6 +440,9 @@ - #include - #include - #include -+#ifdef __GLIBC__ -+#include -+#endif - #include - #include - #include "mp.h" From 81bd682bfa942f3ac7520e59bf46518e230fc4a0 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Tue, 15 Jun 2021 01:35:57 +0200 Subject: [PATCH 06/10] wsdd: fix build with musl fix error: #warning redirecting incorrect #include to [-Werror=cpp] 1 | #warning redirecting incorrect #include to | ^~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Andrea Adami --- meta-openpli/recipes-connectivity/samba/wsdd/wsdd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-openpli/recipes-connectivity/samba/wsdd/wsdd.c b/meta-openpli/recipes-connectivity/samba/wsdd/wsdd.c index 03cf1bf98e..c0f1987e21 100644 --- a/meta-openpli/recipes-connectivity/samba/wsdd/wsdd.c +++ b/meta-openpli/recipes-connectivity/samba/wsdd/wsdd.c @@ -49,7 +49,12 @@ #include #include #include + +#ifdef __GLIBC__ #include +#else +#include +#endif #include #include From 76b525c67cee8c07ab39299d8f91d23b3a9a7564 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Tue, 15 Jun 2021 01:46:37 +0200 Subject: [PATCH 07/10] streamproxy: fix build with musl fix ../../git/src/webrequest.cpp:15:10: fatal error: sys/unistd.h: No such file patch sent upstream Signed-off-by: Andrea Adami --- ...0001-streamproxy-fix-build-with-musl.patch | 34 +++++++++++++++++++ .../streamproxy/streamproxy.bb | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 meta-openpli/recipes-openpli/streamproxy/files/0001-streamproxy-fix-build-with-musl.patch diff --git a/meta-openpli/recipes-openpli/streamproxy/files/0001-streamproxy-fix-build-with-musl.patch b/meta-openpli/recipes-openpli/streamproxy/files/0001-streamproxy-fix-build-with-musl.patch new file mode 100644 index 0000000000..5ccdcbfbba --- /dev/null +++ b/meta-openpli/recipes-openpli/streamproxy/files/0001-streamproxy-fix-build-with-musl.patch @@ -0,0 +1,34 @@ +From bb7800494d834f517c0d97768ef3cc1d2521d4eb Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Tue, 15 Jun 2021 01:41:13 +0200 +Subject: [PATCH 1/1] streamproxy: fix build with musl + +fix + | ../../git/src/webrequest.cpp:15:10: fatal error: sys/unistd.h: + No such file or directory + | 15 | #include + +Signed-off-by: Andrea Adami +--- + src/webrequest.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/webrequest.cpp b/src/webrequest.cpp +index ce20a45..02e0f24 100644 +--- a/src/webrequest.cpp ++++ b/src/webrequest.cpp +@@ -12,7 +12,11 @@ using std::string; + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#else ++#include ++#endif + #include + + WebRequest::WebRequest(const ConfigMap &config_map_in, const HeaderMap &headers_in, +-- +2.17.1 + diff --git a/meta-openpli/recipes-openpli/streamproxy/streamproxy.bb b/meta-openpli/recipes-openpli/streamproxy/streamproxy.bb index 2921f7e696..bbccb00fd3 100644 --- a/meta-openpli/recipes-openpli/streamproxy/streamproxy.bb +++ b/meta-openpli/recipes-openpli/streamproxy/streamproxy.bb @@ -11,6 +11,8 @@ PKGV = "2+git${GITPKGV}" RDEPENDS_${PN} = "enigma2-plugin-systemplugins-transcodingsetup" SRC_URI = "git://github.com/eriksl/streamproxy.git;protocol=git" +SRC_URI_append_libc-musl = " file://0001-streamproxy-fix-build-with-musl.patch" + FILES_${PN} = "${bindir}/streamproxy ${sysconfdir}/init.d/streamproxy.sh ${sysconfdir}/enigma2/streamproxy.conf" CONFFILES_${PN} = "${sysconfdir}/enigma2/streamproxy.conf" S = "${WORKDIR}/git" From c290b24e9d446043de7641e80ec4ef9ae02f4cdb Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Thu, 17 Jun 2021 18:42:59 +0200 Subject: [PATCH 08/10] ofgwrite: fix build with musl see patch headers for the list of fixes note that the recipe exhibits severe warnings patches sent upstream Signed-off-by: Andrea Adami --- ...ite-no-guards-around-sys-sysmacros.h.patch | 53 +++++++++++++ ...02-ofgwrite-fix-build-with-musl-libc.patch | 78 +++++++++++++++++++ ...fine-default-WTMP_FILE-for-musl-libc.patch | 34 ++++++++ .../ofgwrite/files/fix_glibc_major.patch | 36 --------- .../recipes-extended/ofgwrite/ofgwrite.bb | 5 +- 5 files changed, 169 insertions(+), 37 deletions(-) create mode 100644 meta-openpli/recipes-extended/ofgwrite/files/0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch create mode 100644 meta-openpli/recipes-extended/ofgwrite/files/0002-ofgwrite-fix-build-with-musl-libc.patch create mode 100644 meta-openpli/recipes-extended/ofgwrite/files/0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch delete mode 100644 meta-openpli/recipes-extended/ofgwrite/files/fix_glibc_major.patch diff --git a/meta-openpli/recipes-extended/ofgwrite/files/0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch b/meta-openpli/recipes-extended/ofgwrite/files/0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch new file mode 100644 index 0000000000..ad4e75bef4 --- /dev/null +++ b/meta-openpli/recipes-extended/ofgwrite/files/0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch @@ -0,0 +1,53 @@ +From 7e3d1858d17bc1c263f0be95f155b4a3671f4a35 Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Thu, 17 Jun 2021 15:59:04 +0200 +Subject: [PATCH 1/3] ofgwrite: no guards around + +add 'minor' and 'major' for both glibc and musl + +Signed-off-by: Andrea Adami +--- + lib/libmtd.c | 1 + + lib/libmtd_legacy.c | 1 + + libubi.c | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/lib/libmtd.c b/lib/libmtd.c +index 7622532..2eeb540 100644 +--- a/lib/libmtd.c ++++ b/lib/libmtd.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/lib/libmtd_legacy.c b/lib/libmtd_legacy.c +index 3121da9..535b20a 100644 +--- a/lib/libmtd_legacy.c ++++ b/lib/libmtd_legacy.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/libubi.c b/libubi.c +index 1e08b7d..a479aae 100644 +--- a/libubi.c ++++ b/libubi.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + #include "libubi_int.h" + #include "common.h" +-- +2.17.1 + diff --git a/meta-openpli/recipes-extended/ofgwrite/files/0002-ofgwrite-fix-build-with-musl-libc.patch b/meta-openpli/recipes-extended/ofgwrite/files/0002-ofgwrite-fix-build-with-musl-libc.patch new file mode 100644 index 0000000000..232678a8ab --- /dev/null +++ b/meta-openpli/recipes-extended/ofgwrite/files/0002-ofgwrite-fix-build-with-musl-libc.patch @@ -0,0 +1,78 @@ +From f6556ac9d534c528f442aa692fd3fafc3d5a80e8 Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Thu, 17 Jun 2021 16:06:31 +0200 +Subject: [PATCH 2/3] ofgwrite: fix build with musl libc + +fix u_long and u_short + +lib/libfec.c:628:5: error: unknown type name 'u_long' +628 | u_long magic ; + +fix missing rpmatch(line) + +Signed-off-by: Andrea Adami +--- + include/common.h | 9 +++++++++ + lib/common.h | 9 +++++++++ + lib/libfec.c | 5 +++++ + 3 files changed, 23 insertions(+) + +diff --git a/include/common.h b/include/common.h +index 0e9f8cf..236d715 100644 +--- a/include/common.h ++++ b/include/common.h +@@ -102,6 +102,15 @@ extern "C" { + my_fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \ + } while(0) + ++/* musl libc compat */ ++#ifndef HAVE_RPMATCH ++#define rpmatch(line) \ ++ ( (line == NULL)? -1 : \ ++ (*line == 'y' || *line == 'Y')? 1 : \ ++ (*line == 'n' || *line == 'N')? 0 : \ ++ -1 ) ++#endif ++ + /** + * prompt the user for confirmation + */ +diff --git a/lib/common.h b/lib/common.h +index 0e9f8cf..236d715 100644 +--- a/lib/common.h ++++ b/lib/common.h +@@ -102,6 +102,15 @@ extern "C" { + my_fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \ + } while(0) + ++/* musl libc compat */ ++#ifndef HAVE_RPMATCH ++#define rpmatch(line) \ ++ ( (line == NULL)? -1 : \ ++ (*line == 'y' || *line == 'Y')? 1 : \ ++ (*line == 'n' || *line == 'N')? 0 : \ ++ -1 ) ++#endif ++ + /** + * prompt the user for confirmation + */ +diff --git a/lib/libfec.c b/lib/libfec.c +index 060eb32..efb368e 100644 +--- a/lib/libfec.c ++++ b/lib/libfec.c +@@ -46,6 +46,11 @@ + #include + #include + ++/* for musl u_long and u_short */ ++#ifndef __GLIBC__ ++#include ++#endif ++ + /* + * stuff used for testing purposes only + */ +-- +2.17.1 + diff --git a/meta-openpli/recipes-extended/ofgwrite/files/0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch b/meta-openpli/recipes-extended/ofgwrite/files/0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch new file mode 100644 index 0000000000..383b12c4e1 --- /dev/null +++ b/meta-openpli/recipes-extended/ofgwrite/files/0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch @@ -0,0 +1,34 @@ +From 2b425538ce7e6cbdaf4d949e023629c6eefecd4e Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Thu, 17 Jun 2021 17:45:25 +0200 +Subject: [PATCH 3/3] ofgwrite: define default WTMP_FILE for musl libc + +for musl # CONFIG_FEATURE_UTMP is not set + +fix: +| busybox/libbb/messages.c:59:4: error: #error unknown path to wtmp file +| 59 | # error unknown path to wtmp file + +Signed-off-by: Andrea Adami +--- + busybox/libbb/messages.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/busybox/libbb/messages.c b/busybox/libbb/messages.c +index c1b7ba2..651fcff 100644 +--- a/busybox/libbb/messages.c ++++ b/busybox/libbb/messages.c +@@ -50,6 +50,10 @@ const int const_int_0 = 0; + + #if ENABLE_FEATURE_WTMP + /* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */ ++/* in OE musl.cfg for busybox only defines CONFIG_FEATURE_WTMP */ ++#ifndef __GLIBC__ ++#define WTMP_FILE "/var/log/wtmp" ++#endif + const char bb_path_wtmp_file[] ALIGN1 = + # if defined _PATH_WTMP + _PATH_WTMP; +-- +2.17.1 + diff --git a/meta-openpli/recipes-extended/ofgwrite/files/fix_glibc_major.patch b/meta-openpli/recipes-extended/ofgwrite/files/fix_glibc_major.patch deleted file mode 100644 index 14408dbca7..0000000000 --- a/meta-openpli/recipes-extended/ofgwrite/files/fix_glibc_major.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/libubi.c 2018-08-18 12:13:05.231195602 +0200 -+++ b/libubi.c 2018-08-18 12:14:30.229126873 +0200 -@@ -32,6 +32,9 @@ - #include - #include - #include -+#ifdef __GLIBC__ -+#include -+#endif - #include - #include "libubi_int.h" - #include "common.h" ---- a/lib/libmtd.c 2018-08-18 13:20:53.456887400 +0200 -+++ b/lib/libmtd.c 2018-08-18 13:21:18.700276059 +0200 -@@ -29,6 +29,9 @@ - #include - #include - #include -+#ifdef __GLIBC__ -+#include -+#endif - #include - #include - #include ---- a/lib/libmtd_legacy.c 2018-08-18 13:25:53.841638484 +0200 -+++ b/lib/libmtd_legacy.c 2018-08-18 13:26:27.668825122 +0200 -@@ -29,6 +29,9 @@ - #include - #include - #include -+#ifdef __GLIBC__ -+#include -+#endif - #include - #include - #include diff --git a/meta-openpli/recipes-extended/ofgwrite/ofgwrite.bb b/meta-openpli/recipes-extended/ofgwrite/ofgwrite.bb index b7c7fbd473..13dc91824d 100644 --- a/meta-openpli/recipes-extended/ofgwrite/ofgwrite.bb +++ b/meta-openpli/recipes-extended/ofgwrite/ofgwrite.bb @@ -11,7 +11,10 @@ PV = "4.x+git${SRCPV}" PKGV = "4.x+git${GITPKGV}" SRC_URI = "git://github.com/oe-alliance/ofgwrite.git \ - file://fix_glibc_major.patch" + file://0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch \ + file://0002-ofgwrite-fix-build-with-musl-libc.patch \ + file://0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch \ + " S = "${WORKDIR}/git" EXTRA_OEMAKE="" From d49f8fb160523dd0d7973a503e71879d8ec39540 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Thu, 17 Jun 2021 19:46:27 +0200 Subject: [PATCH 09/10] enigma2: fix build with musl v1 Try to make the code more portable. Fixes are listed in the patch header. Note: malloc/mallinfo is not available in musl (deprecated) patch sent upstream Signed-off-by: Andrea Adami --- .../recipes-openpli/enigma2/enigma2.bb | 1 + .../0001-enigma2-fix-build-with-musl.patch | 270 ++++++++++++++++++ 2 files changed, 271 insertions(+) create mode 100644 meta-openpli/recipes-openpli/enigma2/enigma2/0001-enigma2-fix-build-with-musl.patch diff --git a/meta-openpli/recipes-openpli/enigma2/enigma2.bb b/meta-openpli/recipes-openpli/enigma2/enigma2.bb index 88d9c52dc9..951a1e99fa 100644 --- a/meta-openpli/recipes-openpli/enigma2/enigma2.bb +++ b/meta-openpli/recipes-openpli/enigma2/enigma2.bb @@ -113,6 +113,7 @@ PKGV = "2.7+git${GITPKGV}" ENIGMA2_BRANCH ?= "develop" GITHUB_URI ?= "git://github.com" SRC_URI = "${GITHUB_URI}/OpenPLi/${BPN}.git;branch=${ENIGMA2_BRANCH}" +SRC_URI_append_libc-musl = " file://0001-enigma2-fix-build-with-musl.patch" LDFLAGS_prepend = " -lxml2 " diff --git a/meta-openpli/recipes-openpli/enigma2/enigma2/0001-enigma2-fix-build-with-musl.patch b/meta-openpli/recipes-openpli/enigma2/enigma2/0001-enigma2-fix-build-with-musl.patch new file mode 100644 index 0000000000..f7f8b2bef3 --- /dev/null +++ b/meta-openpli/recipes-openpli/enigma2/enigma2/0001-enigma2-fix-build-with-musl.patch @@ -0,0 +1,270 @@ +From 7b264116e251e5932e636008df873325152e3926 Mon Sep 17 00:00:00 2001 +From: Andrea Adami +Date: Tue, 15 Jun 2021 09:59:32 +0200 +Subject: [PATCH 1/1] enigma2: fix build with musl + +fixes: + lib/base/thread.cpp:59:5: error: 'struct sched_param' has no member named '__sched_priority'; + lib/base/e2avahi.cpp:154:37: error: missing sentinel in function call [-Werror=format=] + lib/dvb/epgcache.cpp:400:2: error: 'PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' was not declared in this scope; + lib/dvb/epgtransponderdatareader.cpp:10:65: error: 'PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' was not declared in this scope; + lib/gdi/gpixmap.cpp:9:2: error: #error "no BYTE_ORDER defined!" + lib/gdi/font.cpp:35:31: error: 'PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP' was not declared in this scope; + lib/gdi/pixmapcache.h:11:9: error: 'uint' does not name a type; did you mean 'rint'? + lib/gdi/pixmapcache.cpp:134:30: error: 'MaximumSize' was not declared in this scope + lib/gdi/font.cpp:35:31: error: 'PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP' was not declared in this scope; + lib/gdi/pixmapcache.h:11:9: error: 'uint' does not name a type; did you mean 'rint'? + lib/gdi/pixmapcache.cpp:8:1: error: 'uint' does not name a type; did y + lib/gdi/pixmapcache.cpp:134:30: error: 'MaximumSize' was not declared + + Plugins/Extensions/SocketMMI/src/socket_mmi.cpp:1: + ...../usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect + include to [-Werror=cpp] + +lib/gdi/font.cpp:35:31: error: 'PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP' was not declared in this scope; +main/bsod.cpp:6:10: fatal error: execinfo.h: No such file or directory +main/enigma.cpp:357:18: error: variable 'dump_malloc_stats()::mallinfo mi' has initializer but incomplete type +main/enigma.cpp:357:32: error: invalid use of incomplete type 'struct dump_malloc_stats()::mallinfo' + +Signed-off-by: Andrea Adami +--- + lib/base/e2avahi.cpp | 4 ++++ + lib/base/ebase.h | 4 ++++ + lib/base/eerror.cpp | 12 +++++++++++- + lib/base/thread.cpp | 4 ++++ + lib/dvb/epgcache.cpp | 4 ++++ + lib/dvb/epgtransponderdatareader.cpp | 14 ++++++++++++-- + lib/gdi/font.cpp | 7 ++++++- + lib/gdi/gpixmap.cpp | 4 ++++ + lib/gdi/pixmapcache.h | 4 ++++ + main/bsod.cpp | 6 ++++++ + main/enigma.cpp | 4 ++++ + 11 files changed, 63 insertions(+), 4 deletions(-) + +diff --git a/lib/base/e2avahi.cpp b/lib/base/e2avahi.cpp +index 2c53e39de..fd77d7146 100644 +--- a/lib/base/e2avahi.cpp ++++ b/lib/base/e2avahi.cpp +@@ -151,7 +151,11 @@ static void avahi_service_try_register(AvahiServiceEntry *entry) + AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, + (AvahiPublishFlags)0, + service_name, entry->service_type, ++#ifdef __GLIBC__ + NULL, NULL, entry->port_num, NULL)) ++#else ++ NULL, NULL, entry->port_num, __null)) ++#endif + { + avahi_entry_group_commit(entry->group); + eDebug("[Avahi] Registered %s (%s) on %s:%u", +diff --git a/lib/base/ebase.h b/lib/base/ebase.h +index 79be15b9f..4a59e6349 100644 +--- a/lib/base/ebase.h ++++ b/lib/base/ebase.h +@@ -4,7 +4,11 @@ + #ifndef SWIG + #include + #include ++#ifdef __GLIBC__ + #include ++#else ++#include ++#endif + #include + #include + #include +diff --git a/lib/base/eerror.cpp b/lib/base/eerror.cpp +index 224ab8c1b..a02d61672 100644 +--- a/lib/base/eerror.cpp ++++ b/lib/base/eerror.cpp +@@ -13,7 +13,11 @@ + #ifdef MEMLEAK_CHECK + AllocList *allocList; + pthread_mutex_t memLock = ++#ifdef __GLIBC__ + PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; ++#else ++ {{PTHREAD_MUTEX_RECURSIVE}}; ++#endif + + void DumpUnfreed() + { +@@ -79,7 +83,13 @@ void DumpUnfreed() + int debugLvl = lvlDebug; + static bool debugTime = false; + +-static pthread_mutex_t DebugLock = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP; ++static pthread_mutex_t DebugLock = ++#ifdef __GLIBC__ ++ PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP; ++#else ++ PTHREAD_MUTEX_INITIALIZER; ++#endif ++ + #define RINGBUFFER_SIZE 16384 + static char ringbuffer[RINGBUFFER_SIZE]; + static unsigned int ringbuffer_head; +diff --git a/lib/base/thread.cpp b/lib/base/thread.cpp +index f64eb4c19..91e91af64 100644 +--- a/lib/base/thread.cpp ++++ b/lib/base/thread.cpp +@@ -56,7 +56,11 @@ int eThread::runAsync(int prio, int policy) + if (prio || policy) + { + struct sched_param p; ++#ifdef __GLIBC__ + p.__sched_priority=prio; ++#else ++ p.sched_priority=prio; ++#endif + pthread_attr_setschedpolicy(&attr, policy); + pthread_attr_setschedparam(&attr, &p); + } +diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp +index 378f8a36a..3398def2c 100644 +--- a/lib/dvb/epgcache.cpp ++++ b/lib/dvb/epgcache.cpp +@@ -397,7 +397,11 @@ void eventData::cacheCorrupt(const char* context) + + eEPGCache* eEPGCache::instance; + static pthread_mutex_t cache_lock = ++#ifdef __GLIBC__ + PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; ++#else ++ {{PTHREAD_MUTEX_RECURSIVE}}; ++#endif + + DEFINE_REF(eEPGCache) + +diff --git a/lib/dvb/epgtransponderdatareader.cpp b/lib/dvb/epgtransponderdatareader.cpp +index e182c6004..5fa652d07 100644 +--- a/lib/dvb/epgtransponderdatareader.cpp ++++ b/lib/dvb/epgtransponderdatareader.cpp +@@ -7,8 +7,18 @@ + + + eEPGTransponderDataReader* eEPGTransponderDataReader::instance; +-pthread_mutex_t eEPGTransponderDataReader::known_channel_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +-pthread_mutex_t eEPGTransponderDataReader::last_channel_update_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; ++pthread_mutex_t eEPGTransponderDataReader::known_channel_lock = ++#ifdef __GLIBC__ ++ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; ++#else ++ {{PTHREAD_MUTEX_RECURSIVE}}; ++#endif ++pthread_mutex_t eEPGTransponderDataReader::last_channel_update_lock = ++#ifdef __GLIBC__ ++ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; ++#else ++ {{PTHREAD_MUTEX_RECURSIVE}}; ++#endif + + DEFINE_REF(eEPGTransponderDataReader) + +diff --git a/lib/gdi/font.cpp b/lib/gdi/font.cpp +index 738b5c46e..837c98437 100644 +--- a/lib/gdi/font.cpp ++++ b/lib/gdi/font.cpp +@@ -32,7 +32,12 @@ + + fontRenderClass *fontRenderClass::instance; + +-static pthread_mutex_t ftlock=PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP; ++static pthread_mutex_t ftlock= ++#ifdef __GLIBC__ ++ PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP; ++#else ++ PTHREAD_MUTEX_INITIALIZER; ++#endif + + struct fntColorCacheKey + { +diff --git a/lib/gdi/gpixmap.cpp b/lib/gdi/gpixmap.cpp +index b33e8b691..825fd56bb 100644 +--- a/lib/gdi/gpixmap.cpp ++++ b/lib/gdi/gpixmap.cpp +@@ -5,9 +5,13 @@ + #include + #include + ++#ifdef __GLIBC__ + #ifndef BYTE_ORDER + #error "no BYTE_ORDER defined!" + #endif ++#else ++#define BYTE_ORDER __BYTE_ORDER ++#endif + + /* surface acceleration threshold: do not attempt to accelerate surfaces smaller than the threshold (measured in bytes) */ + #ifndef GFX_SURFACE_ACCELERATION_THRESHOLD +diff --git a/lib/gdi/pixmapcache.h b/lib/gdi/pixmapcache.h +index 4f41a3001..cb87d8d2e 100644 +--- a/lib/gdi/pixmapcache.h ++++ b/lib/gdi/pixmapcache.h +@@ -3,6 +3,10 @@ + + #include + ++#ifndef __GLIBC__ ++#include ++#endif ++ + #ifndef SWIG + + class PixmapCache +diff --git a/main/bsod.cpp b/main/bsod.cpp +index cac47793b..100645958 100644 +--- a/main/bsod.cpp ++++ b/main/bsod.cpp +@@ -3,7 +3,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -301,6 +303,7 @@ void oops(const mcontext_t &context) + * it's not async-signal-safe and so must not be used in signal + * handlers. + */ ++#ifdef __GLIBC__ + void print_backtrace() + { + void *array[15]; +@@ -320,12 +323,15 @@ void print_backtrace() + } + } + } ++#endif + + void handleFatalSignal(int signum, siginfo_t *si, void *ctx) + { + ucontext_t *uc = (ucontext_t*)ctx; + oops(uc->uc_mcontext); ++#ifdef __GLIBC__ + print_backtrace(); ++#endif + eLog(lvlFatal, "-------FATAL SIGNAL"); + bsodFatal("enigma2, signal"); + } +diff --git a/main/enigma.cpp b/main/enigma.cpp +index f7cbe89f9..f1ff732e0 100644 +--- a/main/enigma.cpp ++++ b/main/enigma.cpp +@@ -354,6 +354,10 @@ const char *getBoxType() + + void dump_malloc_stats(void) + { ++#ifdef __GLIBC__ + struct mallinfo mi = mallinfo(); + eDebug("MALLOC: %d total", mi.uordblks); ++#else ++ eDebug("MALLOC: info not exposed"); ++#endif + } +-- +2.17.1 + From 8592613922afed3f51162498b47c46ad39210675 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Thu, 17 Jun 2021 22:43:34 +0200 Subject: [PATCH 10/10] Revert "ofgwrite: fix build with musl" Patches accepted upstream This reverts commit c290b24e9d446043de7641e80ec4ef9ae02f4cdb. --- ...ite-no-guards-around-sys-sysmacros.h.patch | 53 ------------- ...02-ofgwrite-fix-build-with-musl-libc.patch | 78 ------------------- ...fine-default-WTMP_FILE-for-musl-libc.patch | 34 -------- .../ofgwrite/files/fix_glibc_major.patch | 36 +++++++++ .../recipes-extended/ofgwrite/ofgwrite.bb | 5 +- 5 files changed, 37 insertions(+), 169 deletions(-) delete mode 100644 meta-openpli/recipes-extended/ofgwrite/files/0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch delete mode 100644 meta-openpli/recipes-extended/ofgwrite/files/0002-ofgwrite-fix-build-with-musl-libc.patch delete mode 100644 meta-openpli/recipes-extended/ofgwrite/files/0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch create mode 100644 meta-openpli/recipes-extended/ofgwrite/files/fix_glibc_major.patch diff --git a/meta-openpli/recipes-extended/ofgwrite/files/0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch b/meta-openpli/recipes-extended/ofgwrite/files/0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch deleted file mode 100644 index ad4e75bef4..0000000000 --- a/meta-openpli/recipes-extended/ofgwrite/files/0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 7e3d1858d17bc1c263f0be95f155b4a3671f4a35 Mon Sep 17 00:00:00 2001 -From: Andrea Adami -Date: Thu, 17 Jun 2021 15:59:04 +0200 -Subject: [PATCH 1/3] ofgwrite: no guards around - -add 'minor' and 'major' for both glibc and musl - -Signed-off-by: Andrea Adami ---- - lib/libmtd.c | 1 + - lib/libmtd_legacy.c | 1 + - libubi.c | 1 + - 3 files changed, 3 insertions(+) - -diff --git a/lib/libmtd.c b/lib/libmtd.c -index 7622532..2eeb540 100644 ---- a/lib/libmtd.c -+++ b/lib/libmtd.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/lib/libmtd_legacy.c b/lib/libmtd_legacy.c -index 3121da9..535b20a 100644 ---- a/lib/libmtd_legacy.c -+++ b/lib/libmtd_legacy.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/libubi.c b/libubi.c -index 1e08b7d..a479aae 100644 ---- a/libubi.c -+++ b/libubi.c -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - #include - #include "libubi_int.h" - #include "common.h" --- -2.17.1 - diff --git a/meta-openpli/recipes-extended/ofgwrite/files/0002-ofgwrite-fix-build-with-musl-libc.patch b/meta-openpli/recipes-extended/ofgwrite/files/0002-ofgwrite-fix-build-with-musl-libc.patch deleted file mode 100644 index 232678a8ab..0000000000 --- a/meta-openpli/recipes-extended/ofgwrite/files/0002-ofgwrite-fix-build-with-musl-libc.patch +++ /dev/null @@ -1,78 +0,0 @@ -From f6556ac9d534c528f442aa692fd3fafc3d5a80e8 Mon Sep 17 00:00:00 2001 -From: Andrea Adami -Date: Thu, 17 Jun 2021 16:06:31 +0200 -Subject: [PATCH 2/3] ofgwrite: fix build with musl libc - -fix u_long and u_short - -lib/libfec.c:628:5: error: unknown type name 'u_long' -628 | u_long magic ; - -fix missing rpmatch(line) - -Signed-off-by: Andrea Adami ---- - include/common.h | 9 +++++++++ - lib/common.h | 9 +++++++++ - lib/libfec.c | 5 +++++ - 3 files changed, 23 insertions(+) - -diff --git a/include/common.h b/include/common.h -index 0e9f8cf..236d715 100644 ---- a/include/common.h -+++ b/include/common.h -@@ -102,6 +102,15 @@ extern "C" { - my_fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \ - } while(0) - -+/* musl libc compat */ -+#ifndef HAVE_RPMATCH -+#define rpmatch(line) \ -+ ( (line == NULL)? -1 : \ -+ (*line == 'y' || *line == 'Y')? 1 : \ -+ (*line == 'n' || *line == 'N')? 0 : \ -+ -1 ) -+#endif -+ - /** - * prompt the user for confirmation - */ -diff --git a/lib/common.h b/lib/common.h -index 0e9f8cf..236d715 100644 ---- a/lib/common.h -+++ b/lib/common.h -@@ -102,6 +102,15 @@ extern "C" { - my_fprintf(stderr, "%s: warning!: " fmt "\n", PROGRAM_NAME, ##__VA_ARGS__); \ - } while(0) - -+/* musl libc compat */ -+#ifndef HAVE_RPMATCH -+#define rpmatch(line) \ -+ ( (line == NULL)? -1 : \ -+ (*line == 'y' || *line == 'Y')? 1 : \ -+ (*line == 'n' || *line == 'N')? 0 : \ -+ -1 ) -+#endif -+ - /** - * prompt the user for confirmation - */ -diff --git a/lib/libfec.c b/lib/libfec.c -index 060eb32..efb368e 100644 ---- a/lib/libfec.c -+++ b/lib/libfec.c -@@ -46,6 +46,11 @@ - #include - #include - -+/* for musl u_long and u_short */ -+#ifndef __GLIBC__ -+#include -+#endif -+ - /* - * stuff used for testing purposes only - */ --- -2.17.1 - diff --git a/meta-openpli/recipes-extended/ofgwrite/files/0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch b/meta-openpli/recipes-extended/ofgwrite/files/0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch deleted file mode 100644 index 383b12c4e1..0000000000 --- a/meta-openpli/recipes-extended/ofgwrite/files/0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 2b425538ce7e6cbdaf4d949e023629c6eefecd4e Mon Sep 17 00:00:00 2001 -From: Andrea Adami -Date: Thu, 17 Jun 2021 17:45:25 +0200 -Subject: [PATCH 3/3] ofgwrite: define default WTMP_FILE for musl libc - -for musl # CONFIG_FEATURE_UTMP is not set - -fix: -| busybox/libbb/messages.c:59:4: error: #error unknown path to wtmp file -| 59 | # error unknown path to wtmp file - -Signed-off-by: Andrea Adami ---- - busybox/libbb/messages.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/busybox/libbb/messages.c b/busybox/libbb/messages.c -index c1b7ba2..651fcff 100644 ---- a/busybox/libbb/messages.c -+++ b/busybox/libbb/messages.c -@@ -50,6 +50,10 @@ const int const_int_0 = 0; - - #if ENABLE_FEATURE_WTMP - /* This is usually something like "/var/adm/wtmp" or "/var/log/wtmp" */ -+/* in OE musl.cfg for busybox only defines CONFIG_FEATURE_WTMP */ -+#ifndef __GLIBC__ -+#define WTMP_FILE "/var/log/wtmp" -+#endif - const char bb_path_wtmp_file[] ALIGN1 = - # if defined _PATH_WTMP - _PATH_WTMP; --- -2.17.1 - diff --git a/meta-openpli/recipes-extended/ofgwrite/files/fix_glibc_major.patch b/meta-openpli/recipes-extended/ofgwrite/files/fix_glibc_major.patch new file mode 100644 index 0000000000..14408dbca7 --- /dev/null +++ b/meta-openpli/recipes-extended/ofgwrite/files/fix_glibc_major.patch @@ -0,0 +1,36 @@ +--- a/libubi.c 2018-08-18 12:13:05.231195602 +0200 ++++ b/libubi.c 2018-08-18 12:14:30.229126873 +0200 +@@ -32,6 +32,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ ++#include ++#endif + #include + #include "libubi_int.h" + #include "common.h" +--- a/lib/libmtd.c 2018-08-18 13:20:53.456887400 +0200 ++++ b/lib/libmtd.c 2018-08-18 13:21:18.700276059 +0200 +@@ -29,6 +29,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ ++#include ++#endif + #include + #include + #include +--- a/lib/libmtd_legacy.c 2018-08-18 13:25:53.841638484 +0200 ++++ b/lib/libmtd_legacy.c 2018-08-18 13:26:27.668825122 +0200 +@@ -29,6 +29,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ ++#include ++#endif + #include + #include + #include diff --git a/meta-openpli/recipes-extended/ofgwrite/ofgwrite.bb b/meta-openpli/recipes-extended/ofgwrite/ofgwrite.bb index 13dc91824d..b7c7fbd473 100644 --- a/meta-openpli/recipes-extended/ofgwrite/ofgwrite.bb +++ b/meta-openpli/recipes-extended/ofgwrite/ofgwrite.bb @@ -11,10 +11,7 @@ PV = "4.x+git${SRCPV}" PKGV = "4.x+git${GITPKGV}" SRC_URI = "git://github.com/oe-alliance/ofgwrite.git \ - file://0001-ofgwrite-no-guards-around-sys-sysmacros.h.patch \ - file://0002-ofgwrite-fix-build-with-musl-libc.patch \ - file://0003-ofgwrite-define-default-WTMP_FILE-for-musl-libc.patch \ - " + file://fix_glibc_major.patch" S = "${WORKDIR}/git" EXTRA_OEMAKE=""