Skip to contentSkip to conversation

systemd-bootchart: upgrade to v233; fix build with musl

PATCH New Tim Orling 1 participant 1 message Jan 22, 2018

lore
Share & tools
lore

Tim Orling

author
#0 lore raw

PATCH 1/1 systemd-bootchart: upgrade to v233; fix build with musl

* Drop xlocale.h patch, merged upstream
* Rework patches from systemd to fix musl build
- comparison_fn_t is glibc specific
- musl does not provide printf.h
- musl does not provide canonicalize_file_name

---
 .../0001-parse-util-Don-t-use-xlocale.h.patch      |  32 --
 ...fn_t-is-glibc-specific-use-raw-signature-.patch |  36 ++
 .../0002-musl-does-not-provide-printf-h.patch      | 423 +++++++++++++++++++++
 ...l-does-not-provide-canonicalize_file_name.patch |  33 ++
 ...d-bootchart_231.bb => systemd-bootchart_233.bb} |  12 +-
 5 files changed, 501 insertions(+), 35 deletions(-)
 delete mode 100644 meta/recipes-devtools/systemd-bootchart/files/0001-parse-util-Don-t-use-xlocale.h.patch
 create mode 100644 meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
 create mode 100644 meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0002-musl-does-not-provide-printf-h.patch
 create mode 100644 meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0003-musl-does-not-provide-canonicalize_file_name.patch
 rename meta/recipes-devtools/systemd-bootchart/{systemd-bootchart_231.bb => systemd-bootchart_233.bb} (73%)
meta/recipes-devtools/systemd-bootchart/files/0001-parse-util-Don-t-use-xlocale.h.patch deleted +0 -32
deleted file mode 100644
index 5aa0463ac8..0000000000
@@ -1,32 +0,0 @@
-From d379126d56d0b6e935b2d97ca71579e6cc54d1bb Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <[email protected]>
-Date: Tue, 18 Jul 2017 13:37:27 +0300
-Subject: [PATCH] parse-util: Don't use xlocale.h
-
-glibc 2.26 no longer contains the non-standard xlocale.h
-(http://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27)
-
-This change shouldn't break anything as xlocale.h was a subset of
-locale.h.
-
-Signed-off-by: Jussi Kukkonen <[email protected]>
-Upstream-Status: Submitted [https://github.com/systemd/systemd-bootchart/pull/35]
----
- src/parse-util.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/src/parse-util.c b/src/parse-util.c
-index 5635a68..1b2169c 100644
---- a/src/parse-util.c
-+++ b/src/parse-util.c
-@@ -21,7 +21,6 @@
- #include <locale.h>
- #include <stdlib.h>
- #include <string.h>
--#include <xlocale.h>
- 
- #include "macro.h"
- #include "parse-util.h"
--- 
-2.13.2
-
meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch new file +36 -0
new file mode 100644
index 0000000000..f392ceafcc
@@ -0,0 +1,36 @@
+From 45b401a947af944c20b3c451a35dfe53bca5ef3b Mon Sep 17 00:00:00 2001
+From: Tim Orling <[email protected]>
+Date: Thu, 28 Dec 2017 21:24:57 -0800
+Subject: [PATCH 1/3] comparison_fn_t is glibc specific, use raw signature in
+ function pointer
+
+Make it work with musl where comparison_fn_t is not provided
+
+Reuse the approach from systemd:
+systemd/0013-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
+
+Based on work by: Khem Raj <[email protected]>
+
+Signed-off-by: Tim Orling <[email protected]>
+---
+Upstream-Status: Pending
+
+ src/util.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util.h b/src/util.h
+index 561f9e7..e9cfd81 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -57,7 +57,7 @@ extern char **saved_argv;
+  * Normal qsort requires base to be nonnull. Here were require
+  * that only if nmemb > 0.
+  */
+-static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
++static inline void qsort_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
+         if (nmemb <= 1)
+                 return;
+ 
+-- 
+2.13.6
+
meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0002-musl-does-not-provide-printf-h.patch new file +423 -0

423 lines not on this page · raw message

meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0003-musl-does-not-provide-canonicalize_file_name.patch new file +33 -0
new file mode 100644
index 0000000000..7670d95f07
@@ -0,0 +1,33 @@
+From 79396449d264bde58b4daa3ef6dd99f0f0652429 Mon Sep 17 00:00:00 2001
+From: Tim Orling <[email protected]>
+Date: Thu, 28 Dec 2017 22:10:58 -0800
+Subject: [PATCH 3/3] musl does not provide canonicalize_file_name
+
+Reuse the approach from systemd:
+systemd/0007-check-for-missing-canonicalize_file_name.patch
+
+Based on work by: Khem Raj <[email protected]>
+
+Signed-off-by: Tim Orling <[email protected]>
+---
+Upstream-Status: Pending
+
+ src/path-util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/path-util.c b/src/path-util.c
+index 2fb6366..12e2e17 100644
+--- a/src/path-util.c
++++ b/src/path-util.c
+@@ -63,7 +63,7 @@ char **path_strv_resolve(char **l, const char *prefix) {
+                         t = *s;
+ 
+                 errno = 0;
+-                u = canonicalize_file_name(t);
++                u = realpath(t, NULL);
+                 if (!u) {
+                         if (errno == ENOENT) {
+                                 if (prefix) {
+-- 
+2.13.6
+
meta/recipes-devtools/systemd-bootchart/systemd-bootchart_233.bb renamed from meta/recipes-devtools/systemd-bootchart/systemd-bootchart_231.bb +9 -3
similarity index 73%
rename from meta/recipes-devtools/systemd-bootchart/systemd-bootchart_231.bb
rename to meta/recipes-devtools/systemd-bootchart/systemd-bootchart_233.bb
index 4da000e5d0..1ae21b1fbc 100644
@@ -3,12 +3,18 @@ LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c
                     file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe"
 
 SRC_URI = "git://github.com/systemd/systemd-bootchart.git;protocol=https \
-           file://0001-parse-util-Don-t-use-xlocale.h.patch \
 "
 
+SRC_URI_append_libc-musl = " \
+    file://0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \
+    file://0002-musl-does-not-provide-printf-h.patch \
+    file://0003-musl-does-not-provide-canonicalize_file_name.patch \
+    "
+
+
 # Modify these as desired
-PV = "231+git${SRCPV}"
-SRCREV = "9ee2ffc1dc6c8209725e625954bbd89f96cb7139"
+PV = "233+git${SRCPV}"
+SRCREV = "fe1c5e41e6bdb78043dad8fa863fc2df66d1dadf"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.13.6