package/ltrace: fix musl build
PATCH 1/1 package/ltrace: fix musl build
Fix the following musl build failure raised since commit bf9583a50276f52edbc37d9f85df5f2cc7fdb5dc:
checking host system type... mips-buildroot-linux-musl
Fixes:
- http://autobuild.buildroot.org/results/a3a5c46e8562d3f091a9b4b205322168fbf9d16b
--- package/ltrace/0004-fix-musl-build.patch | 71 ++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 package/ltrace/0004-fix-musl-build.patch
package/ltrace/0004-fix-musl-build.patch new file +71 -0
@@ -0,0 +1,71 @@ +From 2070162fef54fceeb62fd2a6989dde4948f807d7 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine <[email protected]> +Date: Thu, 2 Nov 2023 16:59:41 +0100 +Subject: [PATCH] fix musl build + +Signed-off-by: Fabrice Fontaine <[email protected]> +Upstream: unsent yet +--- + configure.ac | 1 + + sysdeps/linux-gnu/mips/plt.c | 2 ++ + sysdeps/linux-gnu/ppc/regs.c | 2 ++ + sysdeps/linux-gnu/xtensa/plt.c | 2 ++ + 4 files changed, 7 insertions(+) + +diff --git a/configure.ac b/configure.ac +index c83dd02..8015f0d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -33,6 +33,7 @@ AC_CANONICAL_HOST + + case "${host_os}" in + linux-gnu*) HOST_OS="linux-gnu" ;; ++ linux-musl*) HOST_OS="linux-gnu" ;; + linux-uclibc*) HOST_OS="linux-gnu" ;; + *) AC_MSG_ERROR([unkown host-os ${host_os}]) ;; + esac +diff --git a/sysdeps/linux-gnu/mips/plt.c b/sysdeps/linux-gnu/mips/plt.c +index c7c10ac..ab96961 100644 +--- a/sysdeps/linux-gnu/mips/plt.c ++++ b/sysdeps/linux-gnu/mips/plt.c +@@ -23,7 +23,9 @@ + + #include <sys/ptrace.h> + #include <errno.h> ++#ifdef __GLIBC__ + #include <error.h> ++#endif + #include <gelf.h> + #include <inttypes.h> + #include <string.h> +diff --git a/sysdeps/linux-gnu/ppc/regs.c b/sysdeps/linux-gnu/ppc/regs.c +index 40d7e7a..71a0d35 100644 +--- a/sysdeps/linux-gnu/ppc/regs.c ++++ b/sysdeps/linux-gnu/ppc/regs.c +@@ -27,7 +27,9 @@ + #include <sys/ptrace.h> + #include <asm/ptrace.h> + #include <errno.h> ++#ifdef __GLIBC__ + #include <error.h> ++#endif + + #include "proc.h" + #include "common.h" +diff --git a/sysdeps/linux-gnu/xtensa/plt.c b/sysdeps/linux-gnu/xtensa/plt.c +index dd0a0f1..b281510 100644 +--- a/sysdeps/linux-gnu/xtensa/plt.c ++++ b/sysdeps/linux-gnu/xtensa/plt.c +@@ -19,7 +19,9 @@ + */ + + #include <errno.h> ++#ifdef __GLIBC__ + #include <error.h> ++#endif + #include <gelf.h> + #include <inttypes.h> + #include <string.h> +-- +2.42.0 +
Signature · 6 lines
2.42.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 9 lines · On Sat, 4 Nov 2023 16:58:57 +0100 Fabrice Fontaine…
Fix the following musl build failure raised since commit
bf9583a50276f52edbc37d9f85df5f2cc7fdb5dc:checking host system type... mips-buildroot-linux-musl
Fixes:
- http://autobuild.buildroot.org/results/a3a5c46e8562d3f091a9b4b205322168fbf9d16bSigned-off-by Fabrice Fontaine <[email protected]>
Thanks for solving this issue.
package/ltrace/0004-fix-musl-build.patch line 7
Quoted 2 lines
package/ltrace/0004-fix-musl-build.patch new file +2
-0+Signed-off-by: Fabrice Fontaine <[email protected]> +Upstream: unsent yet
Doesn't that defeat the purpose of the Upstream: flag entirely? Isn't the idea precisely to strongly encourage (not to say "require") that patches be sent upstream?
Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Fabrice,
Quoted 3 lines · On Sat, 4 Nov 2023 18:41:42 +0100 Thomas Petazzoni via buildroot…
Doesn't that defeat the purpose of the Upstream: flag entirely? Isn't the idea precisely to strongly encourage (not to say "require") that patches be sent upstream?
There has still been no feedback from you on this, so I looked into this a bit more, and it's messy.
ltrace.org points to https://gitlab.com/cespedes/ltrace as being the Git repo, and this Git repo has changes from a year ago, but absolutely no tags.
On the other side, Buildroot uses https://github.com/dkogan/ltrace/tree/master
as the upstream... which hasn't seen any commit for the last 8 years. Though this one has tags, including a 0.7.3 tag, which it the latest version according to ltrace.org.
And when trying to figure if one if a fork from the other... it's not clear.
Regarding your patch, you made the inclusion of <error.h> conditional on __GLIBC__, but what if the code is using functions from <error.h>? If it builds without <error.h>, then presumably it means the code is no longer using any function from <error.h>, and those includes can be dropped?
Alpine had a different patch, that adds a configure.ac check for <error.h>: https://git.alpinelinux.org/aports/plain/main/ltrace/musl.patch
However, their patch is for 0.7.3, while we use the "latest" commit from master.
So overall, quite messy stuff, so I decided to mark ltrace as unavailable for musl:
https://gitlab.com/buildroot.org/buildroot/-/commit/859bd545821a838454577c4c1c9106837cda51cb
Best regards,
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot