]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
systemd: Fix build with latest musl
authorKhem Raj <raj.khem@gmail.com>
Wed, 13 Dec 2023 20:40:53 +0000 (12:40 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 20 Dec 2023 12:02:10 +0000 (12:02 +0000)
musl has removed basename from string.h [1] which leads to build
failures now as declaration is gone and it should be coming from
libgen.h

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd/0017-Define-glibc-compatible-basename-for-non-glibc-syste.patch

index 7d74cfcc24501406f13aa271f141782c2da68410..24dd6b0df172d8af6193f68a66013b5adccc25b2 100644 (file)
@@ -13,22 +13,16 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  src/machine/machine-dbus.c | 5 +++++
  1 file changed, 5 insertions(+)
 
-diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
-index 45bc056326..aee51d5da5 100644
---- a/src/machine/machine-dbus.c
-+++ b/src/machine/machine-dbus.c
-@@ -4,6 +4,11 @@
- #include <sys/mount.h>
- #include <sys/wait.h>
+--- a/src/basic/string-util.h
++++ b/src/basic/string-util.h
+@@ -26,6 +26,10 @@
+ #define URI_UNRESERVED      ALPHANUMERICAL "-._~"       /* [RFC3986] */
+ #define URI_VALID           URI_RESERVED URI_UNRESERVED /* [RFC3986] */
  
 +#if !defined(__GLIBC__)
-+#include <string.h>
 +#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
 +#endif
 +
- #include "alloc-util.h"
- #include "bus-common-errors.h"
- #include "bus-get-properties.h"
--- 
-2.39.2
-
+ static inline char* strstr_ptr(const char *haystack, const char *needle) {
+         if (!haystack || !needle)
+                 return NULL;