From 4ffcbe98e82c73c543aa46105413de2586aa1cee Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Thu, 23 Mar 2023 16:11:15 +0800 Subject: debugedit: add recipe This recipe provides find-debuginfo which is used by rpm, more specifically rpmbuild. RPM upstream removed find-debuginfo and switched to use debugedit in the following commit. https://github.com/rpm-software-management/rpm/commit/04b0805a756cdd9466fb9dc717846f5bf15518cc Without debugedit, rpmbuild fails to generate debuginfo package when %debug_package is added to spec file. (From OE-Core rev: f7ada8b4d003473abce5b589cc38aec1e5e5f18a) Signed-off-by: Chen Qi Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- ...0001-tools-Add-error.h-for-non-glibc-case.patch | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 meta/recipes-devtools/debugedit/files/0001-tools-Add-error.h-for-non-glibc-case.patch (limited to 'meta/recipes-devtools/debugedit/files/0001-tools-Add-error.h-for-non-glibc-case.patch') diff --git a/meta/recipes-devtools/debugedit/files/0001-tools-Add-error.h-for-non-glibc-case.patch b/meta/recipes-devtools/debugedit/files/0001-tools-Add-error.h-for-non-glibc-case.patch new file mode 100644 index 0000000000..f6d64cb4e7 --- /dev/null +++ b/meta/recipes-devtools/debugedit/files/0001-tools-Add-error.h-for-non-glibc-case.patch @@ -0,0 +1,102 @@ +From 4c797d3b559ba51bd9ccd9a2036245819acce843 Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Thu, 23 Mar 2023 10:54:21 +0800 +Subject: [PATCH] tools: Add error.h for non-glibc case + +error is glibc specific API, so this patch will mostly not accepted +upstream given that elfutils has been closely tied to glibc + +This is a OE specific workaround for musl. + +Upstream-Status: Inappropriate [OE Specific] + +Signed-off-by: Chen Qi +--- + tools/debugedit.c | 7 ++++++- + tools/error.h | 27 +++++++++++++++++++++++++++ + tools/sepdebugcrcfix.c | 7 ++++++- + 3 files changed, 39 insertions(+), 2 deletions(-) + create mode 100644 tools/error.h + +diff --git a/tools/debugedit.c b/tools/debugedit.c +index 668777a..a72c3c0 100644 +--- a/tools/debugedit.c ++++ b/tools/debugedit.c +@@ -25,7 +25,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -40,6 +39,12 @@ + #include + #include + ++#ifdef __GLIBC__ ++#include ++#else ++#include "error.h" ++#endif ++ + #ifndef MAX + #define MAX(m, n) ((m) < (n) ? (n) : (m)) + #endif +diff --git a/tools/error.h b/tools/error.h +new file mode 100644 +index 0000000..9b24418 +--- /dev/null ++++ b/tools/error.h +@@ -0,0 +1,27 @@ ++#ifndef _ERROR_H_ ++#define _ERROR_H_ ++ ++#include ++#include ++#include ++#include ++#include ++ ++static unsigned int error_message_count = 0; ++ ++static inline void error(int status, int errnum, const char* format, ...) ++{ ++ va_list ap; ++ fprintf(stderr, "%s: ", program_invocation_name); ++ va_start(ap, format); ++ vfprintf(stderr, format, ap); ++ va_end(ap); ++ if (errnum) ++ fprintf(stderr, ": %s", strerror(errnum)); ++ fprintf(stderr, "\n"); ++ error_message_count++; ++ if (status) ++ exit(status); ++} ++ ++#endif /* _ERROR_H_ */ +diff --git a/tools/sepdebugcrcfix.c b/tools/sepdebugcrcfix.c +index da50e6c..c4a9d56 100644 +--- a/tools/sepdebugcrcfix.c ++++ b/tools/sepdebugcrcfix.c +@@ -29,10 +29,15 @@ + #include + #include + #include +-#include + #include + #include + ++#ifdef __GLIBC__ ++#include ++#else ++#include "error.h" ++#endif ++ + #ifndef _ + #define _(x) x + #endif +-- +2.17.1 + -- cgit v1.2.3-54-g00ecf