From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 17/17] util-linux: Fix ptest builds on musl
Date: Sat, 19 Dec 2015 23:52:26 +0000 [thread overview]
Message-ID: <3024f5fd79b2e5f3fcbe03bc322317dce4ed20a6.1450568936.git.raj.khem@gmail.com> (raw)
In-Reply-To: <81170e1970685f34735007c496ce175279d46304.1450568936.git.raj.khem@gmail.com>
In-Reply-To: <cover.1450568936.git.raj.khem@gmail.com>
musl doesnt implement error() API, hence provide one
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../util-linux/uuid-test-error-api.patch | 92 ++++++++++++++++++++++
meta/recipes-core/util-linux/util-linux_2.27.1.bb | 1 +
2 files changed, 93 insertions(+)
create mode 100644 meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
diff --git a/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch b/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
new file mode 100644
index 0000000..1b0ff79
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/uuid-test-error-api.patch
@@ -0,0 +1,92 @@
+This patch adds error() API implementation for non-glibc system C libs
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: util-linux-2.27.1/tests/helpers/test_uuidd.c
+===================================================================
+--- util-linux-2.27.1.orig/tests/helpers/test_uuidd.c
++++ util-linux-2.27.1/tests/helpers/test_uuidd.c
+@@ -23,7 +23,6 @@
+ *
+ * make uuidd uuidgen localstatedir=/var
+ */
+-#include <error.h>
+ #include <libgen.h>
+ #include <pthread.h>
+ #include <stdio.h>
+@@ -39,6 +38,17 @@
+ #include "xalloc.h"
+ #include "strutils.h"
+
++#ifdef __GLIBC__
++#include <error.h>
++#else
++extern void (*error_print_progname)(void);
++extern unsigned int error_message_count;
++extern int error_one_per_line;
++
++void error(int, int, const char *, ...);
++void error_at_line(int, int, const char *, unsigned int, const char *, ...);
++#endif
++
+ #define LOG(level,args) if (loglev >= level) { fprintf args; }
+
+ size_t nprocesses = 4;
+@@ -257,6 +267,56 @@ static void object_dump(size_t idx, obje
+ fprintf(stderr, "}\n");
+ }
+
++#ifndef __GLIBC__
++extern char *__progname;
++
++void (*error_print_progname)(void) = 0;
++unsigned int error_message_count = 0;
++int error_one_per_line = 0;
++
++static void eprint(int status, int e, const char *file, unsigned int line, const char *fmt, va_list ap)
++{
++ if (file && error_one_per_line) {
++ static const char *oldfile;
++ static unsigned int oldline;
++ if (line == oldline && strcmp(file, oldfile) == 0)
++ return;
++ oldfile = file;
++ oldline = line;
++ }
++ if (error_print_progname)
++ error_print_progname();
++ else
++ fprintf(stderr, "%s: ", __progname);
++ if (file)
++ fprintf(stderr, "%s:%u: ", file, line);
++ vfprintf(stderr, fmt, ap);
++ if (e)
++ fprintf(stderr, ": %s", strerror(e));
++ putc('\n', stderr);
++ fflush(stderr);
++ error_message_count++;
++ if (status)
++ exit(status);
++}
++
++void error(int status, int e, const char *fmt, ...)
++{
++ va_list ap;
++ va_start(ap,fmt);
++ eprint(status, e, 0, 0, fmt, ap);
++ va_end(ap);
++}
++
++void error_at_line(int status, int e, const char *file, unsigned int line, const char *fmt, ...)
++{
++ va_list ap;
++ va_start(ap,fmt);
++ eprint(status, e, file, line, fmt, ap);
++ va_end(ap);
++}
++#endif /* __GLIBC__ */
++
+ int main(int argc, char *argv[])
+ {
+ size_t i, nfailed = 0, nignored = 0;
diff --git a/meta/recipes-core/util-linux/util-linux_2.27.1.bb b/meta/recipes-core/util-linux/util-linux_2.27.1.bb
index 14a77ca..7549158 100644
--- a/meta/recipes-core/util-linux/util-linux_2.27.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.27.1.bb
@@ -19,6 +19,7 @@ SRC_URI += "file://util-linux-ng-2.16-mount_lock_path.patch \
file://avoid_unsupported_grep_opts.patch \
file://display_testname_for_subtest.patch \
file://avoid_parallel_tests.patch \
+ file://uuid-test-error-api.patch \
"
SRC_URI[md5sum] = "3cd2698d1363a2c64091c2dadc974647"
SRC_URI[sha256sum] = "0a818fcdede99aec43ffe6ca5b5388bff80d162f2f7bd4541dca94fecb87a290"
--
2.6.4
next prev parent reply other threads:[~2015-12-19 23:52 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-19 23:52 [PATCH 00/17] musl fixes phase 2 Khem Raj
2015-12-19 23:52 ` [PATCH 01/17] powertop: Include right headers for timval struct Khem Raj
2015-12-21 12:11 ` Burton, Ross
2015-12-19 23:52 ` [PATCH 02/17] dhcp: Include sys/types.h for u_int* defs Khem Raj
2015-12-21 12:11 ` Burton, Ross
2015-12-19 23:52 ` [PATCH 03/17] blktrace: Include <sys/types.h for dev_t Khem Raj
2015-12-21 12:12 ` Burton, Ross
2015-12-19 23:52 ` [PATCH 04/17] ppp: Fix build with musl Khem Raj
2015-12-19 23:52 ` [PATCH 05/17] tcp-wrappers: " Khem Raj
2015-12-19 23:52 ` [PATCH 06/17] tcmode-default: Use glibc for nativesdk version even on uclibc and musl Khem Raj
2015-12-19 23:52 ` [PATCH 07/17] libtirpc: Fix build for musl Khem Raj
2015-12-29 1:17 ` Khem Raj
2015-12-19 23:52 ` [PATCH 08/17] fts: Add recipe Khem Raj
2015-12-21 12:15 ` Burton, Ross
2015-12-21 13:42 ` Khem Raj
2015-12-25 5:53 ` Khem Raj
2015-12-19 23:52 ` [PATCH 09/17] valgrind: Define __UCLIBC__ for uclibc based systems Khem Raj
2015-12-21 20:38 ` Andre McCurdy
2015-12-21 20:57 ` Andre McCurdy
2015-12-19 23:52 ` [PATCH 10/17] connman: include config.h for HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR Khem Raj
2016-01-08 10:08 ` Burton, Ross
2015-12-19 23:52 ` [PATCH 11/17] libcgroup: Add dependency on fts when building on musl Khem Raj
2015-12-19 23:52 ` [PATCH 12/17] linux-libc-headers: Port patches for linux-headers for musl Khem Raj
2015-12-19 23:52 ` [PATCH 13/17] xserver-xorg: Fix build with musl Khem Raj
2016-01-08 10:10 ` Burton, Ross
2016-01-08 10:23 ` Khem Raj
2015-12-19 23:52 ` [PATCH 14/17] gdk-pixbuf: Fix latent build issue exposed by musl Khem Raj
2015-12-19 23:52 ` [PATCH 15/17] argp-standalone: Add recipe Khem Raj
2015-12-19 23:52 ` [PATCH 16/17] gnutls: Link with libargp on musl and depend on argp-standalone Khem Raj
2015-12-19 23:52 ` Khem Raj [this message]
2016-01-07 15:32 ` [PATCH 00/17] musl fixes phase 2 Burton, Ross
2016-01-07 16:48 ` Khem Raj
2016-01-08 9:40 ` Khem Raj
2016-01-08 9:58 ` Burton, Ross
2016-01-08 10:24 ` 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=3024f5fd79b2e5f3fcbe03bc322317dce4ed20a6.1450568936.git.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