mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-10-02 06:21:38 +00:00
0001-Fix-build-with-musl.patch refreshed for 3.11.3 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
46 lines
1.5 KiB
Diff
46 lines
1.5 KiB
Diff
From c7ea1cce7f4f83e9ff27873a96113bdb382bb296 Mon Sep 17 00:00:00 2001
|
|
From: Yi Zhao <yi.zhao@windriver.com>
|
|
Date: Fri, 8 May 2026 22:39:54 +0800
|
|
Subject: [PATCH] Fix build with musl
|
|
|
|
Guard glibc-specific version check with __GLIBC__ macro. When building
|
|
with musl, __GLIBC__ is not defined, so the preprocessor previously fell
|
|
through to the #else branch and defined NO_SNPRINTF, causing a build
|
|
error:
|
|
|
|
vbuf_print.c: In function 'vbuf_print':
|
|
vbuf_print.c:208:46: error: macro 'VBUF_SNPRINTF' passed 5 arguments, but takes just 4
|
|
208 | VSTRING_ADDNUM(fmt, width);
|
|
| ^
|
|
vbuf_print.c:126:9: note: macro 'VBUF_SNPRINTF' defined here
|
|
126 | #define VBUF_SNPRINTF(bp, sz, fmt, arg) do { \
|
|
| ^~~~~~~~~~~~~
|
|
|
|
Wrap the entire block in #ifdef __GLIBC__ so that neither branch
|
|
is entered on musl.
|
|
|
|
Upstream-Status: Pending
|
|
|
|
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
|
---
|
|
src/util/sys_defs.h | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h
|
|
index 09a05bd..15ea8c6 100644
|
|
--- a/src/util/sys_defs.h
|
|
+++ b/src/util/sys_defs.h
|
|
@@ -794,10 +794,12 @@ extern int initgroups(const char *, int);
|
|
#define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
|
|
#define NATIVE_COMMAND_DIR "/usr/sbin"
|
|
#define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
|
|
+#ifdef __GLIBC__
|
|
#if HAVE_GLIBC_API_VERSION_SUPPORT(2, 1)
|
|
#define SOCKADDR_SIZE socklen_t
|
|
#define SOCKOPT_SIZE socklen_t
|
|
#endif
|
|
+#endif
|
|
#ifndef NO_IPV6
|
|
#define HAS_IPV6
|
|
#if HAVE_GLIBC_API_VERSION_SUPPORT(2, 4)
|