public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 15/17] argp-standalone: Add recipe
Date: Sat, 19 Dec 2015 23:52:24 +0000	[thread overview]
Message-ID: <a331b534820b2206c739cc1632d31b2fc2a4ebac.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>

This helps packages like gnutls to compile with musl
any package that needs glibc's implementation of argp
can link to this library

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../argp-standalone/argp-standalone_1.3.bb         | 28 ++++++++
 .../files/0001-throw-in-funcdef.patch              | 84 ++++++++++++++++++++++
 .../argp-standalone/files/0002-isprint.patch       | 51 +++++++++++++
 3 files changed, 163 insertions(+)
 create mode 100644 meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
 create mode 100644 meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
 create mode 100644 meta/recipes-support/argp-standalone/files/0002-isprint.patch

diff --git a/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb b/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
new file mode 100644
index 0000000..a5d20d3
--- /dev/null
+++ b/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
@@ -0,0 +1,28 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "Glibc hierarchical argument parsing standalone library"
+HOMEPAGE = "http://www.lysator.liu.se/~nisse/misc/"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://argp.h;beginline=1;endline=20;md5=008b7e53dea6f9e1d9fdef0d9cf3184a"
+SECTION = "libs"
+
+SRC_URI = "http://www.lysator.liu.se/~nisse/misc/argp-standalone-${PV}.tar.gz \
+           file://0001-throw-in-funcdef.patch \
+           file://0002-isprint.patch \
+          "
+SRC_URI[md5sum] = "720704bac078d067111b32444e24ba69"
+SRC_URI[sha256sum] = "dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be"
+
+inherit autotools
+
+CFLAGS += "-fPIC -U__OPTIMIZE__"
+
+do_install() {
+	install -D -m 0644 ${B}/libargp.a ${D}${libdir}/libargp.a
+	install -D -m 0644 ${S}/argp.h ${D}${includedir}/argp.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
diff --git a/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch b/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
new file mode 100644
index 0000000..a6e2759
--- /dev/null
+++ b/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
@@ -0,0 +1,84 @@
+# --- T2-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+# 
+# T2 SDE: package/.../rng-tools/throw-in-funcdef.patch.argp-standalone
+# Copyright (C) 2006 The T2 SDE Project
+# 
+# More information can be found in the files COPYING and README.
+# 
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
+# of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+# --- T2-COPYRIGHT-NOTE-END ---
+
+
+No __THROW in function implementation.
+	--jsaw
+
+Taken from buildroot
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- argp-standalone-1.4-test2/argp.h.orig	2006-01-06 02:29:59.000000000 +0100
++++ argp-standalone-1.4-test2/argp.h	2006-01-06 02:41:10.000000000 +0100
+@@ -560,17 +560,17 @@
+ # endif
+ 
+ # ifndef ARGP_EI
+-#  define ARGP_EI extern __inline__
++#  define ARGP_EI extern inline
+ # endif
+ 
+ ARGP_EI void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+   __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+ 
+ ARGP_EI int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt)
+ {
+   if (__opt->flags & OPTION_DOC)
+     return 0;
+@@ -582,7 +582,7 @@
+ }
+ 
+ ARGP_EI int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt)
+ {
+   return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
+--- argp-standalone-1.4-test2/argp-parse.c.orig	2006-01-06 02:47:48.000000000 +0100
++++ argp-standalone-1.4-test2/argp-parse.c	2006-01-06 02:48:16.000000000 +0100
+@@ -1290,13 +1290,13 @@
+ /* Defined here, in case a user is not inlining the definitions in
+  * argp.h */
+ void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+   __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+ 
+ int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt) 
+ {
+   if (__opt->flags & OPTION_DOC)
+     return 0;
+@@ -1310,7 +1310,7 @@
+ }
+ 
+ int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt) 
+ {
+   return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
diff --git a/meta/recipes-support/argp-standalone/files/0002-isprint.patch b/meta/recipes-support/argp-standalone/files/0002-isprint.patch
new file mode 100644
index 0000000..1c07eea
--- /dev/null
+++ b/meta/recipes-support/argp-standalone/files/0002-isprint.patch
@@ -0,0 +1,51 @@
+Subject: restrict value range passed to isprint function
+
+According to C standards isprint argument shall be representable as an
+unsigned char or be equal to EOF, otherwise the behaviour is undefined.
+
+Passing arbitrary ints leads to segfault in nm program from elfutils.
+
+Restrict isprint argument range to values representable by unsigned char.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+
+Taken from buildroot
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+Index: b/argp.h
+===================================================================
+--- a/argp.h
++++ b/argp.h
+@@ -23,6 +23,7 @@
+ 
+ #include <stdio.h>
+ #include <ctype.h>
++#include <limits.h>
+ 
+ #define __need_error_t
+ #include <errno.h>
+@@ -577,7 +578,7 @@
+   else
+     {
+       int __key = __opt->key;
+-      return __key > 0 && isprint (__key);
++      return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+     }
+ }
+ 
+Index: b/argp-parse.c
+===================================================================
+--- a/argp-parse.c
++++ b/argp-parse.c
+@@ -1292,7 +1292,7 @@
+       int __key = __opt->key;
+       /* FIXME: whether or not a particular key implies a short option
+        * ought not to be locale dependent. */
+-      return __key > 0 && isprint (__key);
++      return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+     }
+ }
+ 
-- 
2.6.4



  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 ` Khem Raj [this message]
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 ` [PATCH 17/17] util-linux: Fix ptest builds on musl Khem Raj
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=a331b534820b2206c739cc1632d31b2fc2a4ebac.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