Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH 5/5] debugedit: Use musl-legacy-error
Date: Fri, 22 Sep 2023 14:05:08 -0700	[thread overview]
Message-ID: <20230922210508.24087-5-raj.khem@gmail.com> (raw)
In-Reply-To: <20230922210508.24087-1-raj.khem@gmail.com>

Use error.h to provide GNU extentions for error API
Drop the patch trying to do something about it

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v3: Added

 .../debugedit/debugedit_5.0.bb                |   4 +-
 ...tools-Add-error.h-for-non-glibc-case.patch | 102 ------------------
 2 files changed, 2 insertions(+), 104 deletions(-)
 delete mode 100644 meta/recipes-devtools/debugedit/files/0001-tools-Add-error.h-for-non-glibc-case.patch

diff --git a/meta/recipes-devtools/debugedit/debugedit_5.0.bb b/meta/recipes-devtools/debugedit/debugedit_5.0.bb
index 257238fa245..63ad7babd9a 100644
--- a/meta/recipes-devtools/debugedit/debugedit_5.0.bb
+++ b/meta/recipes-devtools/debugedit/debugedit_5.0.bb
@@ -11,8 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
 
 SRC_URI = "https://sourceware.org/ftp/debugedit/${PV}/debugedit-${PV}.tar.xz"
 
-SRC_URI:append:libc-musl = " \
-           file://0001-tools-Add-error.h-for-non-glibc-case.patch \
+SRC_URI:append:libc-musl = "\
            file://0002-sepdebugcrcfix.c-do-not-use-64bit-variants.patch \
            file://0003-Makefile.am-do-not-update-manual.patch \
            "
@@ -20,6 +19,7 @@ SRC_URI:append:libc-musl = " \
 SRC_URI[sha256sum] = "e9ecd7d350bebae1f178ce6776ca19a648b6fe8fa22f5b3044b38d7899aa553e"
 
 DEPENDS = "elfutils"
+DEPENDS:append:libc-musl = " musl-legacy-error"
 
 inherit pkgconfig autotools
 
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
deleted file mode 100644
index f6d64cb4e7d..00000000000
--- a/meta/recipes-devtools/debugedit/files/0001-tools-Add-error.h-for-non-glibc-case.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-From 4c797d3b559ba51bd9ccd9a2036245819acce843 Mon Sep 17 00:00:00 2001
-From: Chen Qi <Qi.Chen@windriver.com>
-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 <Qi.Chen@windriver.com>
----
- 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 <byteswap.h>
- #include <endian.h>
- #include <errno.h>
--#include <error.h>
- #include <limits.h>
- #include <string.h>
- #include <stdlib.h>
-@@ -40,6 +39,12 @@
- #include <gelf.h>
- #include <dwarf.h>
- 
-+#ifdef __GLIBC__
-+#include <error.h>
-+#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 <stdarg.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+
-+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 <endian.h>
- #include <stdio.h>
- #include <stdlib.h>
--#include <error.h>
- #include <libelf.h>
- #include <gelf.h>
- 
-+#ifdef __GLIBC__
-+#include <error.h>
-+#else
-+#include "error.h"
-+#endif
-+
- #ifndef _
- #define _(x) x
- #endif
--- 
-2.17.1
-
-- 
2.42.0



  parent reply	other threads:[~2023-09-22 21:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 21:05 [PATCH v3 1/5] musl: Update to latest Khem Raj
2023-09-22 21:05 ` [PATCH v3 2/5] bsd-headers: Define __CONCAT and __STRING Khem Raj
2023-09-22 21:05 ` [PATCH v3 3/5] musl-legacy-error: Add recipe Khem Raj
2023-09-22 21:05 ` [PATCH 4/5] elfutils: Depend on musl-legacy-error for musl targets Khem Raj
2023-09-22 21:05 ` Khem Raj [this message]
2023-09-25 16:04 ` [OE-core] [PATCH v3 1/5] musl: Update to latest Alexandre Belloni
2023-09-25 17:26   ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230922210508.24087-5-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox