Skip to contentSkip to conversation

bsd-headers: Define __CONCAT and __STRING

PATCH In review Khem Raj 2 participants 5 messages Sep 20, 2023 – Sep 21, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/3 bsd-headers: Define __CONCAT and __STRING

Sync with other musl distros

---
v2: Rebased

 meta/recipes-core/musl/bsd-headers/sys-cdefs.h | 8 ++++++++
 1 file changed, 8 insertions(+)
meta/recipes-core/musl/bsd-headers/sys-cdefs.h +8 -0
index 209a623c0f0..841a5da8ba4 100644
@@ -1,3 +1,6 @@
+#ifndef _SYS_CDEFS_H_
+#define _SYS_CDEFS_H_
+
 #warning usage of non-standard #include <sys/cdefs.h> is deprecated
 
 #undef __P
@@ -24,3 +27,8 @@
 # define __THROW
 # define __NTH(fct)     fct
 #endif
+
+#define __CONCAT(x,y)   x ## y
+#define __STRING(x)     #x
+
+#endif /* _SYS_CDEFS_H_ */
Signature · 1 line
2.42.0
author
#1 lore raw

PATCH v2 2/3 bsd-headers: Add error.h

error.h is used in many packages and we can use this to provide for these packages and report the portability problems upstream without patching the packages here.

---
v2: Make Subject more relevant to change

 meta/recipes-core/musl/bsd-headers.bb      |  4 +-
 meta/recipes-core/musl/bsd-headers/error.h | 60 ++++++++++++++++++++++
 2 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/musl/bsd-headers/error.h
meta/recipes-core/musl/bsd-headers.bb +3 -1
index 887a8160313..91dc239f888 100644
@@ -1,7 +1,7 @@
 # Copyright (C) 2016 Khem Raj <[email protected]>
 # Released under the MIT license (see COPYING.MIT for the terms)
 
-SUMMARY = "BSD compatible headers"
+SUMMARY = "Legacy compatible headers for musl libc"
 LICENSE = "BSD-3-Clause & BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://sys-queue.h;beginline=1;endline=32;md5=c6352b0f03bb448600456547d334b56f"
 SECTION = "devel"
@@ -9,6 +9,7 @@ SECTION = "devel"
 SRC_URI = "file://sys-queue.h \
            file://sys-tree.h \
            file://sys-cdefs.h \
+           file://error.h \
           "
 do_configure[noexec] = "1"
 do_compile[noexec] = "1"
@@ -21,6 +22,7 @@ do_install() {
 	install -Dm 0644 ${S}/sys-queue.h ${D}${includedir}/sys/queue.h
 	install -Dm 0644 ${S}/sys-tree.h ${D}${includedir}/sys/tree.h
 	install -Dm 0644 ${S}/sys-cdefs.h ${D}${includedir}/sys/cdefs.h
+	install -Dm 0644 ${S}/error.h ${D}${includedir}/error.h
 }
 #
 # We will skip parsing for non-musl systems
meta/recipes-core/musl/bsd-headers/error.h new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.42.0
author
#2 lore raw

PATCH v2 3/3 common-musl: Disable error_at_line detection for musl

In reply to Khem Raj

bsd-headers provide error.h file and static functions to implement error API and related functions, which confuses gnulib provided functions. So lets prefer gnulib provided functions if they are used by a package

---
 meta/site/common-musl | 3 +++
 1 file changed, 3 insertions(+)
meta/site/common-musl +3 -0
index 0fd0413819e..003e46b51dc 100644
@@ -54,3 +54,6 @@ ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
 
 # Xorg
 xorg_cv_malloc0_returns_null=${xorg_cv_malloc0_returns_null=yes}
+
+# gnulib error
+ac_cv_lib_error_at_line=${ac_cv_lib_error_at_line=no}
Signature · 1 line
2.42.0
#3 lore raw

Re: [OE-core] [PATCH v2 3/3] common-musl: Disable error_at_line detection for musl

Quoted 14 lines · Khem Raj

bsd-headers provide error.h file and static functions to implement error API and related functions, which confuses gnulib provided functions. So lets prefer gnulib provided functions if they are used by a package

---
 meta/site/common-musl | 3 +++
 1 file changed, 3 insertions(+)
meta/site/common-musl +0 -0
index 0fd0413819e..003e46b51dc 100644

meta/site/common-musl ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes} · line 59

Quoted 6 lines
meta/site/common-musl +3 -0
@@ -54,3 +54,6 @@ ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
 
 # Xorg
 xorg_cv_malloc0_returns_null=${xorg_cv_malloc0_returns_null=yes}
+
+# gnulib error
+ac_cv_lib_error_at_line=${ac_cv_lib_error_at_line=no}

This is better but our on target cpio build test is failing:

https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/7826/steps/13/logs/stdio

probably as it doesn't see the site cache entry on target.

Cheers,

Richard

author
#4 lore raw

Re: [OE-core] [PATCH v2 3/3] common-musl: Disable error_at_line detection for musl

Quoted 25 lines · Richard Purdie
Quoted 14 lines · Khem Raj

bsd-headers provide error.h file and static functions to implement error API and related functions, which confuses gnulib provided functions. So lets prefer gnulib provided functions if they are used by a package

---
 meta/site/common-musl | 3 +++
 1 file changed, 3 insertions(+)
meta/site/common-musl +0 -0
index 0fd0413819e..003e46b51dc 100644

meta/site/common-musl ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes} · line 59

Quoted 6 lines
meta/site/common-musl +3 -0
@@ -54,3 +54,6 @@ ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
 
 # Xorg
 xorg_cv_malloc0_returns_null=${xorg_cv_malloc0_returns_null=yes}
+
+# gnulib error
+ac_cv_lib_error_at_line=${ac_cv_lib_error_at_line=no}

This is better but our on target cpio build test is failing:

Quoted 3 lines

https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/7826/steps/13/logs/stdio

probably as it doesn't see the site cache entry on target.

Right. We need to fix the testcase to pass it via configure or env. Let me take a look

Quoted 4 lines

Cheers,

Richard