From 1c28f9300f133dc49755b34e4861ab5509609da4 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 17 Aug 2015 02:35:33 -0700 Subject: uclibc: Upgrade to tip of master Drop upstreamed patches convert the rest to git am'able patches Signed-off-by: Khem Raj Signed-off-by: Ross Burton --- meta/recipes-core/uclibc/uclibc-git.inc | 36 +- .../0001-Add-eventfd_read-and-eventfd_write.patch | 120 - ...IPTOS_CLASS_-macros-according-to-RFC-2474.patch | 75 - .../0001-Disable-lrount_tes-function.patch | 37 + ...nt.c-wtent.c-move-functions-from-utxent.c.patch | 319 -- ...1-atexit_old-Do-not-add-it-to-shared-libc.patch | 44 - ...-ldso-limited-support-for-ORIGIN-in-rpath.patch | 230 - ...brt-Use-nodefaultlibs-instead-of-nostdlib.patch | 33 - ...-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch | 28 - ...rk-Hide-pthread_atfork-in-shared-versions.patch | 74 - .../uclibc-git/0001-timex-Sync-with-glibc.patch | 33 - ...-Add-implementation-for-copysignl-for-ppc.patch | 125 + .../uclibc-git/0002-wire-setns-syscall.patch | 68 - .../uclibc-git/0003-Add-argp-implementation.patch | 5811 ++++++++++++++++++++ ...t-localised-optimizations-this-helps-to-h.patch | 30 + .../0005-Always-use-O2-for-compiling-fork.c.patch | 33 + ...-ldso-limited-support-for-ORIGIN-in-rpath.patch | 233 + ...rk-Hide-pthread_atfork-in-shared-versions.patch | 35 + .../uclibc/uclibc-git/argp-headers.patch | 583 -- .../uclibc/uclibc-git/argp-support.patch | 5192 ----------------- .../uclibc-git/compile-arm-fork-with-O2.patch | 21 - .../ldso-mark-_dl_exit-as-noreturn.patch | 48 - .../uclibc/uclibc-git/powerpc_copysignl.patch | 113 - .../uclibc-git/remove_attribute_optimize_Os.patch | 19 - .../uclibc-git/uclibc_enable_log2_test.patch | 35 - meta/recipes-core/uclibc/uclibc.inc | 2 +- 26 files changed, 6318 insertions(+), 7059 deletions(-) delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-Define-IPTOS_CLASS_-macros-according-to-RFC-2474.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-ldso-limited-support-for-ORIGIN-in-rpath.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0001-timex-Sync-with-glibc.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0002-Add-implementation-for-copysignl-for-ppc.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0003-Add-argp-implementation.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0004-Dont-support-localised-optimizations-this-helps-to-h.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0005-Always-use-O2-for-compiling-fork.c.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0006-ldso-limited-support-for-ORIGIN-in-rpath.patch create mode 100644 meta/recipes-core/uclibc/uclibc-git/0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/argp-headers.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/argp-support.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/ldso-mark-_dl_exit-as-noreturn.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch delete mode 100644 meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch diff --git a/meta/recipes-core/uclibc/uclibc-git.inc b/meta/recipes-core/uclibc/uclibc-git.inc index 3c489406d9..14a577f432 100644 --- a/meta/recipes-core/uclibc/uclibc-git.inc +++ b/meta/recipes-core/uclibc/uclibc-git.inc @@ -1,30 +1,20 @@ -SRCREV = "48a0006012679ff0eda6f256da958d73a924fb57" +SRCREV = "ca1c74d67dd115d059a875150e10b8560a9c35a8" PV = "0.9.33+git${SRCPV}" FILESEXTRAPATHS =. "${FILE_DIRNAME}/uclibc-git:" SRC_URI = "git://uclibc.org/uClibc.git;branch=master \ - file://uClibc.machine \ - file://uClibc.distro \ - file://obstack.cfg \ - file://locale.cfg \ - file://uclibc_enable_log2_test.patch \ - file://powerpc_copysignl.patch \ - file://argp-support.patch \ - file://argp-headers.patch \ - file://remove_attribute_optimize_Os.patch \ - file://compile-arm-fork-with-O2.patch \ - file://0001-ldso-limited-support-for-ORIGIN-in-rpath.patch \ - file://0001-atexit_old-Do-not-add-it-to-shared-libc.patch \ - file://0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch \ - file://0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \ - file://0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch \ - file://0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch \ - file://0001-Add-eventfd_read-and-eventfd_write.patch \ - file://0002-wire-setns-syscall.patch \ - file://0001-Define-IPTOS_CLASS_-macros-according-to-RFC-2474.patch \ - file://0001-timex-Sync-with-glibc.patch \ - file://ldso-mark-_dl_exit-as-noreturn.patch \ - " + file://uClibc.machine \ + file://uClibc.distro \ + file://obstack.cfg \ + file://locale.cfg \ + file://0001-Disable-lrount_tes-function.patch \ + file://0002-Add-implementation-for-copysignl-for-ppc.patch \ + file://0003-Add-argp-implementation.patch \ + file://0004-Dont-support-localised-optimizations-this-helps-to-h.patch \ + file://0005-Always-use-O2-for-compiling-fork.c.patch \ + file://0006-ldso-limited-support-for-ORIGIN-in-rpath.patch \ + file://0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \ +" S = "${WORKDIR}/git" diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch deleted file mode 100644 index dd0efc0f36..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch +++ /dev/null @@ -1,120 +0,0 @@ -From e3aae24ede969e2dede1aa19c2ee520cab71ce11 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 20 Feb 2014 00:30:18 -0800 -Subject: [PATCH 1/3] Add eventfd_read() and eventfd_write() - -Signed-off-by: Khem Raj -Upstream-Status: Pending ---- - libc/sysdeps/linux/common/Makefile.in | 2 ++ - libc/sysdeps/linux/common/eventfd_read.c | 27 +++++++++++++++++++++++++++ - libc/sysdeps/linux/common/eventfd_write.c | 28 ++++++++++++++++++++++++++++ - libc/sysdeps/linux/common/sys/eventfd.h | 4 ---- - 4 files changed, 57 insertions(+), 4 deletions(-) - create mode 100644 libc/sysdeps/linux/common/eventfd_read.c - create mode 100644 libc/sysdeps/linux/common/eventfd_write.c - -diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in -index dbf0b0f..45d2e21 100644 ---- a/libc/sysdeps/linux/common/Makefile.in -+++ b/libc/sysdeps/linux/common/Makefile.in -@@ -25,6 +25,8 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \ - capset.c \ - dup3.c \ - eventfd.c \ -+ eventfd_read.c \ -+ eventfd_write.c \ - inotify.c \ - ioperm.c \ - iopl.c \ -diff --git a/libc/sysdeps/linux/common/eventfd_read.c b/libc/sysdeps/linux/common/eventfd_read.c -new file mode 100644 -index 0000000..75f2aaa ---- /dev/null -+++ b/libc/sysdeps/linux/common/eventfd_read.c -@@ -0,0 +1,27 @@ -+/* Copyright (C) 2007-2014 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ . */ -+ -+#include -+#include -+#include -+ -+ -+int -+eventfd_read (int fd, eventfd_t *value) -+{ -+ return read (fd, value, sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0; -+} -diff --git a/libc/sysdeps/linux/common/eventfd_write.c b/libc/sysdeps/linux/common/eventfd_write.c -new file mode 100644 -index 0000000..e1509cf ---- /dev/null -+++ b/libc/sysdeps/linux/common/eventfd_write.c -@@ -0,0 +1,28 @@ -+/* Copyright (C) 2007-2014 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ . */ -+ -+#include -+#include -+#include -+ -+ -+int -+eventfd_write (int fd, eventfd_t value) -+{ -+ return write (fd, &value, -+ sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0; -+} -diff --git a/libc/sysdeps/linux/common/sys/eventfd.h b/libc/sysdeps/linux/common/sys/eventfd.h -index 1bf785f..91b265b 100644 ---- a/libc/sysdeps/linux/common/sys/eventfd.h -+++ b/libc/sysdeps/linux/common/sys/eventfd.h -@@ -33,16 +33,12 @@ __BEGIN_DECLS - value to COUNT. */ - extern int eventfd (int __count, int __flags) __THROW; - --#if 0 /* not (yet) implemented in uClibc */ -- - /* Read event counter and possibly wait for events. */ - extern int eventfd_read (int __fd, eventfd_t *__value); - - /* Increment event counter. */ - extern int eventfd_write (int __fd, eventfd_t __value); - --#endif -- - __END_DECLS - - #endif /* sys/eventfd.h */ --- -1.9.0 - diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Define-IPTOS_CLASS_-macros-according-to-RFC-2474.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Define-IPTOS_CLASS_-macros-according-to-RFC-2474.patch deleted file mode 100644 index d613823695..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0001-Define-IPTOS_CLASS_-macros-according-to-RFC-2474.patch +++ /dev/null @@ -1,75 +0,0 @@ -From be8ed13a90c528adfbe3c8543946bb2c5a2ad713 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 25 Aug 2014 15:50:36 -0700 -Subject: [PATCH] Define IPTOS_CLASS_* macros according to RFC 2474 - -Signed-off-by: Khem Raj -Upstream-status: Pending ---- - include/netinet/ip.h | 42 ++++++++++++++++++++++++++++++------------ - 1 file changed, 30 insertions(+), 12 deletions(-) - -diff --git a/include/netinet/ip.h b/include/netinet/ip.h -index 19e1249..3fe58b9 100644 ---- a/include/netinet/ip.h -+++ b/include/netinet/ip.h -@@ -188,7 +188,25 @@ struct ip_timestamp - #define IPTOS_DSCP_EF 0xb8 - - /* -- * Definitions for IP type of service (ip_tos) -+ * In RFC 2474, Section 4.2.2.1, the Class Selector Codepoints subsume -+ * the old ToS Precedence values. -+ */ -+#define IPTOS_CLASS_MASK 0xe0 -+#define IPTOS_CLASS(class) ((class) & IPTOS_CLASS_MASK) -+#define IPTOS_CLASS_CS0 0x00 -+#define IPTOS_CLASS_CS1 0x20 -+#define IPTOS_CLASS_CS2 0x40 -+#define IPTOS_CLASS_CS3 0x60 -+#define IPTOS_CLASS_CS4 0x80 -+#define IPTOS_CLASS_CS5 0xa0 -+#define IPTOS_CLASS_CS6 0xc0 -+#define IPTOS_CLASS_CS7 0xe0 -+ -+#define IPTOS_CLASS_DEFAULT IPTOS_CLASS_CS0 -+ -+/* -+ * Definitions for IP type of service (ip_tos) [deprecated; use DSCP -+ * and CS definitions above instead.] - */ - #define IPTOS_TOS_MASK 0x1E - #define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) -@@ -199,18 +217,18 @@ struct ip_timestamp - #define IPTOS_MINCOST IPTOS_LOWCOST - - /* -- * Definitions for IP precedence (also in ip_tos) (hopefully unused) -+ * Definitions for IP precedence (also in ip_tos) [also deprecated.] - */ --#define IPTOS_PREC_MASK 0xe0 --#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK) --#define IPTOS_PREC_NETCONTROL 0xe0 --#define IPTOS_PREC_INTERNETCONTROL 0xc0 --#define IPTOS_PREC_CRITIC_ECP 0xa0 --#define IPTOS_PREC_FLASHOVERRIDE 0x80 --#define IPTOS_PREC_FLASH 0x60 --#define IPTOS_PREC_IMMEDIATE 0x40 --#define IPTOS_PREC_PRIORITY 0x20 --#define IPTOS_PREC_ROUTINE 0x00 -+#define IPTOS_PREC_MASK IPTOS_CLASS_MASK -+#define IPTOS_PREC(tos) IPTOS_CLASS(tos) -+#define IPTOS_PREC_NETCONTROL IPTOS_CLASS_CS7 -+#define IPTOS_PREC_INTERNETCONTROL IPTOS_CLASS_CS6 -+#define IPTOS_PREC_CRITIC_ECP IPTOS_CLASS_CS5 -+#define IPTOS_PREC_FLASHOVERRIDE IPTOS_CLASS_CS4 -+#define IPTOS_PREC_FLASH IPTOS_CLASS_CS3 -+#define IPTOS_PREC_IMMEDIATE IPTOS_CLASS_CS2 -+#define IPTOS_PREC_PRIORITY IPTOS_CLASS_CS1 -+#define IPTOS_PREC_ROUTINE IPTOS_CLASS_CS0 - - /* - * Definitions for options. --- -2.1.0 - diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch new file mode 100644 index 0000000000..506f146a79 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch @@ -0,0 +1,37 @@ +From 14b865b3438d0df29b4969148678d8fa8943e1ef Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 16 Aug 2015 20:49:33 -0700 +Subject: [PATCH 1/7] Disable lrount_tes() function + +Its not used anyway, avoids some strict compiler warnings + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + test/math/libm-test.inc | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/test/math/libm-test.inc b/test/math/libm-test.inc +index f50b48b..6d70a95 100644 +--- a/test/math/libm-test.inc ++++ b/test/math/libm-test.inc +@@ -3470,7 +3470,6 @@ logb_test (void) + } + + +-#if 0 + static void + lround_test (void) + { +@@ -3605,7 +3604,6 @@ llround_test (void) + + END (llround); + } +-#endif + + static void + modf_test (void) +-- +2.1.4 + diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch deleted file mode 100644 index 4ac765c334..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch +++ /dev/null @@ -1,319 +0,0 @@ -Upstream-Status: Pending - -From 096abf14d2dc978607ccd8a0d7f42da65d8991f3 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 9 Sep 2012 22:00:04 -0700 -Subject: [PATCH] Revert "utent.c, wtent.c: move functions from utxent.c" - -This reverts commit 84135275cfeebc0b233c1c96eeada4d4178a0b18. ---- - include/utmp.h | 8 +++++ - libc/misc/utmp/utent.c | 80 +++++++++++------------------------------------ - libc/misc/utmp/utxent.c | 4 +-- - libc/misc/utmp/wtent.c | 14 ++------- - 4 files changed, 30 insertions(+), 76 deletions(-) - -Index: git/include/utmp.h -=================================================================== ---- git.orig/include/utmp.h 2013-01-21 16:37:18.000000000 -0800 -+++ git/include/utmp.h 2013-01-21 16:40:56.987583099 -0800 -@@ -56,30 +56,37 @@ - /* Append entry UTMP to the wtmp-like file WTMP_FILE. */ - extern void updwtmp (const char *__wtmp_file, const struct utmp *__utmp) - __THROW; -+libc_hidden_proto(updwtmp) - - /* Change name of the utmp file to be examined. */ - extern int utmpname (const char *__file) __THROW; -+libc_hidden_proto(utmpname) - - /* Read next entry from a utmp-like file. */ - extern struct utmp *getutent (void) __THROW; -+libc_hidden_proto(getutent) - - /* Reset the input stream to the beginning of the file. */ - extern void setutent (void) __THROW; -+libc_hidden_proto(setutent) - - /* Close the current open file. */ - extern void endutent (void) __THROW; -+libc_hidden_proto(endutent) - - /* Search forward from the current point in the utmp file until the - next entry with a ut_type matching ID->ut_type. */ - extern struct utmp *getutid (const struct utmp *__id) __THROW; -+libc_hidden_proto(getutid) - - /* Search forward from the current point in the utmp file until the - next entry with a ut_line matching LINE->ut_line. */ - extern struct utmp *getutline (const struct utmp *__line) __THROW; -+libc_hidden_proto(getutline) - - /* Write out entry pointed to by UTMP_PTR into the utmp file. */ - extern struct utmp *pututline (const struct utmp *__utmp_ptr) __THROW; -- -+libc_hidden_proto(pututline) - - #if 0 /* def __USE_MISC */ - /* Reentrant versions of the file for handling utmp files. */ -Index: git/libc/misc/utmp/utent.c -=================================================================== ---- git.orig/libc/misc/utmp/utent.c 2013-01-21 16:37:18.000000000 -0800 -+++ git/libc/misc/utmp/utent.c 2013-01-21 16:38:14.035578638 -0800 -@@ -19,9 +19,6 @@ - #include - #include - #include --#ifdef __UCLIBC_HAS_UTMPX__ --# include --#endif - #include - - #include -@@ -34,7 +31,7 @@ - static const char *static_ut_name = default_file_name; - - /* This function must be called with the LOCK held */ --static void __setutent_unlocked(void) -+static void __setutent(void) - { - if (static_fd < 0) { - static_fd = open_not_cancel_2(static_ut_name, O_RDWR | O_CLOEXEC); -@@ -53,24 +50,19 @@ - lseek(static_fd, 0, SEEK_SET); - } - #if defined __UCLIBC_HAS_THREADS__ --static void __setutent(void) -+void setutent(void) - { - __UCLIBC_MUTEX_LOCK(utmplock); -- __setutent_unlocked(); -+ __setutent(); - __UCLIBC_MUTEX_UNLOCK(utmplock); - } - #else --static void __setutent(void); --strong_alias(__setutent_unlocked,__setutent) --#endif - strong_alias(__setutent,setutent) -- --#ifdef __UCLIBC_HAS_UTMPX__ --strong_alias(__setutent,setutxent) - #endif -+libc_hidden_def(setutent) - - /* This function must be called with the LOCK held */ --static struct utmp *__getutent_unlocked(void) -+static struct utmp *__getutent(void) - { - if (static_fd < 0) { - __setutent(); -@@ -86,27 +78,19 @@ - return NULL; - } - #if defined __UCLIBC_HAS_THREADS__ --static struct utmp *__getutent(void) -+struct utmp *getutent(void) - { - struct utmp *ret; - - __UCLIBC_MUTEX_LOCK(utmplock); -- ret = __getutent_unlocked(); -+ ret = __getutent(); - __UCLIBC_MUTEX_UNLOCK(utmplock); - return ret; - } - #else --static struct utmp *__getutent(void); --strong_alias(__getutent_unlocked,__getutent) --#endif - strong_alias(__getutent,getutent) -- --#ifdef __UCLIBC_HAS_UTMPX__ --struct utmpx *getutxent(void) --{ -- return (struct utmpx *) __getutent (); --} - #endif -+libc_hidden_def(getutent) - - static void __endutent(void) - { -@@ -117,13 +101,10 @@ - __UCLIBC_MUTEX_UNLOCK(utmplock); - } - strong_alias(__endutent,endutent) -- --#ifdef __UCLIBC_HAS_UTMPX__ --strong_alias(__endutent,endutxent) --#endif -+libc_hidden_def(endutent) - - /* This function must be called with the LOCK held */ --static struct utmp *__getutid_unlocked(const struct utmp *utmp_entry) -+static struct utmp *__getutid(const struct utmp *utmp_entry) - { - struct utmp *lutmp; - unsigned type; -@@ -133,7 +114,7 @@ - type = utmp_entry->ut_type - 1; - type /= 4; - -- while ((lutmp = __getutent_unlocked()) != NULL) { -+ while ((lutmp = __getutent()) != NULL) { - if (type == 0 && lutmp->ut_type == utmp_entry->ut_type) { - /* one of RUN_LVL, BOOT_TIME, NEW_TIME, OLD_TIME */ - return lutmp; -@@ -147,34 +128,26 @@ - return NULL; - } - #if defined __UCLIBC_HAS_THREADS__ --static struct utmp *__getutid(const struct utmp *utmp_entry) -+struct utmp *getutid(const struct utmp *utmp_entry) - { - struct utmp *ret; - - __UCLIBC_MUTEX_LOCK(utmplock); -- ret = __getutid_unlocked(utmp_entry); -+ ret = __getutid(utmp_entry); - __UCLIBC_MUTEX_UNLOCK(utmplock); - return ret; - } - #else --static struct utmp *__getutid(const struct utmp *utmp_entry); --strong_alias(__getutid_unlocked,__getutid) --#endif - strong_alias(__getutid,getutid) -- --#ifdef __UCLIBC_HAS_UTMPX__ --struct utmpx *getutxid(const struct utmpx *utmp_entry) --{ -- return (struct utmpx *) __getutid ((const struct utmp *) utmp_entry); --} - #endif -+libc_hidden_def(getutid) - - static struct utmp *__getutline(const struct utmp *utmp_entry) - { - struct utmp *lutmp; - - __UCLIBC_MUTEX_LOCK(utmplock); -- while ((lutmp = __getutent_unlocked()) != NULL) { -+ while ((lutmp = __getutent()) != NULL) { - if (lutmp->ut_type == USER_PROCESS || lutmp->ut_type == LOGIN_PROCESS) { - if (strncmp(lutmp->ut_line, utmp_entry->ut_line, sizeof(lutmp->ut_line)) == 0) { - break; -@@ -185,13 +158,7 @@ - return lutmp; - } - strong_alias(__getutline,getutline) -- --#ifdef __UCLIBC_HAS_UTMPX__ --struct utmpx *getutxline(const struct utmpx *utmp_entry) --{ -- return (struct utmpx *) __getutline ((const struct utmp *) utmp_entry); --} --#endif -+libc_hidden_def(getutline) - - static struct utmp *__pututline(const struct utmp *utmp_entry) - { -@@ -200,7 +167,7 @@ - the file pointer where they want it, everything will work out. */ - lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); - -- if (__getutid_unlocked(utmp_entry) != NULL) -+ if (__getutid(utmp_entry) != NULL) - lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); - else - lseek(static_fd, (off_t) 0, SEEK_END); -@@ -211,13 +178,7 @@ - return (struct utmp *)utmp_entry; - } - strong_alias(__pututline,pututline) -- --#ifdef __UCLIBC_HAS_UTMPX__ --struct utmpx *pututxline (const struct utmpx *utmp_entry) --{ -- return (struct utmpx *) __pututline ((const struct utmp *) utmp_entry); --} --#endif -+libc_hidden_def(pututline) - - static int __utmpname(const char *new_ut_name) - { -@@ -241,7 +202,4 @@ - return 0; /* or maybe return -(static_ut_name != new_ut_name)? */ - } - strong_alias(__utmpname,utmpname) -- --#ifdef __UCLIBC_HAS_UTMPX__ --strong_alias(__utmpname,utmpxname) --#endif -+libc_hidden_def(utmpname) -Index: git/libc/misc/utmp/utxent.c -=================================================================== ---- git.orig/libc/misc/utmp/utxent.c 2013-01-21 16:37:18.000000000 -0800 -+++ git/libc/misc/utmp/utxent.c 2013-01-21 16:38:14.035578638 -0800 -@@ -13,7 +13,6 @@ - #include - #include - --#if 0 /* moved to utent.c */ - void setutxent(void) - { - setutent (); -@@ -49,12 +48,10 @@ - return utmpname (new_ut_name); - } - --/* moved to wtent.c */ - void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx) - { - updwtmp (wtmpx_file, (const struct utmp *) utmpx); - } --#endif - - /* Copy the information in UTMPX to UTMP. */ - void getutmp (const struct utmpx *utmpx, struct utmp *utmp) -@@ -107,3 +104,4 @@ - utmpx->ut_time = utmp->ut_time; - #endif - } -+ -Index: git/libc/misc/utmp/wtent.c -=================================================================== ---- git.orig/libc/misc/utmp/wtent.c 2013-01-21 16:37:18.000000000 -0800 -+++ git/libc/misc/utmp/wtent.c 2013-01-21 16:38:14.035578638 -0800 -@@ -11,9 +11,6 @@ - #include - #include - #include --#ifdef __UCLIBC_HAS_UTMPX__ --# include --#endif - #include - #include - #include -@@ -36,7 +33,7 @@ - } - #endif - --static void __updwtmp(const char *wtmp_file, const struct utmp *lutmp) -+void updwtmp(const char *wtmp_file, const struct utmp *lutmp) - { - int fd; - -@@ -49,11 +46,4 @@ - } - } - } --strong_alias(__updwtmp,updwtmp) -- --#ifdef __UCLIBC_HAS_UTMPX__ --void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx) --{ -- __updwtmp (wtmpx_file, (const struct utmp *) utmpx); --} --#endif -+libc_hidden_def(updwtmp) diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch b/meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch deleted file mode 100644 index b6dfce483e..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 74667582526b39a1906228574d73a6528f4587eb Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 23 Jun 2012 13:26:30 -0700 -Subject: [PATCH] atexit_old: Do not add it to shared libc - -atexit should only be in either uclibc_nonshared.a -shared libc case or libc.a in static build case - -Signed-off-by: Khem Raj - -Upstream-Status: Pending ---- - libc/stdlib/Makefile.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in -index 3166b8e..3d686d9 100644 ---- a/libc/stdlib/Makefile.in -+++ b/libc/stdlib/Makefile.in -@@ -60,7 +60,6 @@ CSRC-$(if $(findstring yyy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_HAS_WCHAR)$(UCLIBC_HAS_X - - # multi source _atexit.c - CSRC-y += __cxa_atexit.c __cxa_finalize.c __exit_handler.c exit.c on_exit.c --CSRC-$(COMPAT_ATEXIT) += old_atexit.c - - STDLIB_DIR := $(top_srcdir)libc/stdlib - STDLIB_OUT := $(top_builddir)libc/stdlib -@@ -70,11 +69,12 @@ STDLIB_OBJ := $(patsubst %.c,$(STDLIB_OUT)/%.o,$(CSRC-y)) - - libc-y += $(STDLIB_OBJ) - libc-static-y += $(STDLIB_OUT)/atexit.o $(STDLIB_OUT)/system.o -+libc-static-$(COMPAT_ATEXIT) += $(STDLIB_OUT)/old_atexit.o - libc-shared-y += $(STDLIB_OUT)/system.oS - - # this should always be the PIC version, because it could be used in shared libs - libc-nonshared-y += $(STDLIB_OUT)/atexit.os -- -+libc-nonshared-$(COMPAT_ATEXIT) += $(STDLIB_OUT)/old_atexit.os - libc-nomulti-y += $(STDLIB_OUT)/labs.o $(STDLIB_OUT)/atol.o $(STDLIB_OUT)/_stdlib_strto_l.o $(STDLIB_OUT)/_stdlib_strto_ll.o - libc-nomulti-$(UCLIBC_HAS_XLOCALE) += $(STDLIB_OUT)/_stdlib_strto_l_l.o $(STDLIB_OUT)/_stdlib_strto_ll_l.o - --- -1.7.9.5 - diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-ldso-limited-support-for-ORIGIN-in-rpath.patch b/meta/recipes-core/uclibc/uclibc-git/0001-ldso-limited-support-for-ORIGIN-in-rpath.patch deleted file mode 100644 index 7479ec35e1..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0001-ldso-limited-support-for-ORIGIN-in-rpath.patch +++ /dev/null @@ -1,230 +0,0 @@ -From 32eaf738faafad2b16e1f3f5beb91736b3c27a3b Mon Sep 17 00:00:00 2001 -From: Junling Zheng -Date: Fri, 3 Apr 2015 05:02:27 +0000 -Subject: [PATCH] ldso: limited support for $ORIGIN in rpath -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Derived from: -http://lists.busybox.net/pipermail/uclibc/2011-March/045003.html - -However, the above patch introduced '_dl_strchr' in ldso/ldso/dl-elf.c, -and caused the following undefined referencing compiling error: - - | .../libdl.a(libdl.os): In function `search_for_named_library': - | .../dl-elf.c:156: undefined reference to `_dl_strchr' - | collect2: error: ld returned 1 exit status - -This problem would be reproduced through compiling gdb in static mode -using uclibc. - -So, add the definition of '_dl_strchr' to fix it. The '_dl_strstr' is -added as well. - -Upstream-Status: Submitted - -Signed-off-by: Timo Teräs -Signed-off-by: Junling Zheng ---- - ldso/include/dl-string.h | 2 ++ - ldso/ldso/dl-elf.c | 79 +++++++++++++++++++++++++----------------------- - ldso/ldso/ldso.c | 18 +++++++++-- - 3 files changed, 59 insertions(+), 40 deletions(-) - -diff --git a/ldso/include/dl-string.h b/ldso/include/dl-string.h -index aacad10..14ae617 100644 ---- a/ldso/include/dl-string.h -+++ b/ldso/include/dl-string.h -@@ -204,7 +204,9 @@ static __always_inline char * _dl_get_last_path_component(char *path) - # define _dl_strcat strcat - # define _dl_strcpy strcpy - # define _dl_strcmp strcmp -+# define _dl_strchr strchr - # define _dl_strrchr strrchr -+# define _dl_strstr strstr - # define _dl_memcpy memcpy - # define _dl_memcmp memcmp - # define _dl_memset memset -diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c -index 1b06bc1..b323c90 100644 ---- a/ldso/ldso/dl-elf.c -+++ b/ldso/ldso/dl-elf.c -@@ -133,56 +133,60 @@ _dl_protect_relro (struct elf_resolve *l) - * in uClibc/ldso/util/ldd.c */ - static struct elf_resolve * - search_for_named_library(const char *name, unsigned rflags, const char *path_list, -- struct dyn_elf **rpnt) -+ struct dyn_elf **rpnt, const char* origin) - { -- char *path, *path_n, *mylibname; -+ char *mylibname; -+ const char *p, *pn; - struct elf_resolve *tpnt; -- int done; -+ int plen; - - if (path_list==NULL) - return NULL; - -- /* We need a writable copy of this string, but we don't -- * need this allocated permanently since we don't want -- * to leak memory, so use alloca to put path on the stack */ -- done = _dl_strlen(path_list); -- path = alloca(done + 1); -- - /* another bit of local storage */ - mylibname = alloca(2050); - -- _dl_memcpy(path, path_list, done+1); -- - /* Unlike ldd.c, don't bother to eliminate double //s */ - - /* Replace colons with zeros in path_list */ - /* : at the beginning or end of path maps to CWD */ - /* :: anywhere maps CWD */ - /* "" maps to CWD */ -- done = 0; -- path_n = path; -- do { -- if (*path == 0) { -- *path = ':'; -- done = 1; -+ for (p = path_list; p != NULL; p = pn) { -+ pn = _dl_strchr(p + 1, ':'); -+ if (pn != NULL) { -+ plen = pn - p; -+ pn++; -+ } else -+ plen = _dl_strlen(p); -+ -+ if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) { -+ int olen; -+ if (rflags && plen != 7) -+ continue; -+ if (origin == NULL) -+ continue; -+ for (olen = _dl_strlen(origin) - 1; olen >= 0 && origin[olen] != '/'; olen--) -+ ; -+ if (olen <= 0) -+ continue; -+ _dl_memcpy(&mylibname[0], origin, olen); -+ _dl_memcpy(&mylibname[olen], p + 7, plen - 7); -+ mylibname[olen + plen - 7] = 0; -+ } else if (plen != 0) { -+ _dl_memcpy(mylibname, p, plen); -+ mylibname[plen] = 0; -+ } else { -+ _dl_strcpy(mylibname, "."); - } -- if (*path == ':') { -- *path = 0; -- if (*path_n) -- _dl_strcpy(mylibname, path_n); -- else -- _dl_strcpy(mylibname, "."); /* Assume current dir if empty path */ -- _dl_strcat(mylibname, "/"); -- _dl_strcat(mylibname, name); -+ _dl_strcat(mylibname, "/"); -+ _dl_strcat(mylibname, name); - #ifdef __LDSO_SAFE_RUNPATH__ -- if (*mylibname == '/') -+ if (*mylibname == '/') - #endif -- if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != NULL) -- return tpnt; -- path_n = path+1; -- } -- path++; -- } while (!done); -+ if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != NULL) -+ return tpnt; -+ } - return NULL; - } - -@@ -234,7 +238,8 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp - if (pnt) { - pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB]; - _dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt); -- if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL) -+ if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt, -+ tpnt->libname)) != NULL) - return tpnt1; - } - #endif -@@ -243,7 +248,7 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp - /* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */ - if (_dl_library_path) { - _dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path); -- if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt)) != NULL) -+ if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt, NULL)) != NULL) - { - return tpnt1; - } -@@ -257,7 +262,7 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp - if (pnt) { - pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB]; - _dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt); -- if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL) -+ if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt, NULL)) != NULL) - return tpnt1; - } - #endif -@@ -291,7 +296,7 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp - /* Look for libraries wherever the shared library loader - * was installed */ - _dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath); -- tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt); -+ tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt, NULL); - if (tpnt1 != NULL) - return tpnt1; - #endif -@@ -304,7 +309,7 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp - #ifndef __LDSO_CACHE_SUPPORT__ - ":" UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib" - #endif -- , rpnt); -+ , rpnt, NULL); - if (tpnt1 != NULL) - return tpnt1; - -diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c -index 5619629..73bcc41 100644 ---- a/ldso/ldso/ldso.c -+++ b/ldso/ldso/ldso.c -@@ -402,6 +402,20 @@ static ptrdiff_t _dl_build_local_scope (struct elf_resolve **list, - p += _dl_build_local_scope (p, q->tpnt); - return p - list; - } -+ -+static void _dl_setup_progname(const char *argv0) -+{ -+ char image[PATH_MAX]; -+ ssize_t s; -+ -+ s = _dl_readlink("/proc/self/exe", image, sizeof(image)); -+ if (s > 0 && image[0] == '/') { -+ image[s] = 0; -+ _dl_progname = _dl_strdup(image); -+ } else if (argv0) { -+ _dl_progname = argv0; -+ } -+} - - void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr, - ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv -@@ -454,9 +468,7 @@ void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr, - * been fixed up by now. Still no function calls outside of this - * library, since the dynamic resolver is not yet ready. - */ -- if (argv[0]) { -- _dl_progname = argv[0]; -- } -+ _dl_setup_progname(argv[0]); - - #ifdef __DSBT__ - _dl_ldso_dsbt = (void *)tpnt->dynamic_info[DT_DSBT_BASE_IDX]; --- -1.8.3.4 - diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch b/meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch deleted file mode 100644 index ecb9d31645..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 95f9b6f37152b8316735d3c86c0db963ff59e22d Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 23 Jun 2012 16:51:52 -0700 -Subject: [PATCH] librt: Use -nodefaultlibs instead of -nostdlib - -nostdlib disables linking in startup files too which is not -what we want here since it needs to resolve __dso_handle -which comes from crtbeginS.o, otherwise librt has this -undefined reference to a weak undefined __dso_handle that -shows up as error (with gold linker) -when shared libraries are being built which are -linking in librt - -Signed-off-by: Khem Raj -Upstream-Status: Pending ---- - librt/Makefile.in | 1 + - 1 file changed, 1 insertion(+) - -Index: git/librt/Makefile.in -=================================================================== ---- git.orig/librt/Makefile.in 2012-06-24 10:32:59.512653237 -0700 -+++ git/librt/Makefile.in 2012-06-24 11:31:00.660821666 -0700 -@@ -15,6 +15,9 @@ - ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) - LIBS-librt.so += $(top_builddir)lib/libdl.so $(top_builddir)lib/libpthread.so - endif -+START_FILE-librt.so := $(SHARED_START_FILES) -+END_FILE-librt.so := $(SHARED_END_FILES) -+ - - librt_FULL_NAME := librt-$(VERSION).so - diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch deleted file mode 100644 index 7e7c5793f1..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 714f543f4fa8fb3911449b6ce1517481359e0cff Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 23 Jun 2012 14:21:17 -0700 -Subject: [PATCH] nptl/arm: Move aeabi_read_tp to uclibc_nonshared.a - -Otherwise it creates wrong references from shared libs - -Signed-off-by: Khem Raj -Upstream-Status: Pending ---- - libc/sysdeps/linux/arm/Makefile.arch | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -Index: git/libc/sysdeps/linux/arm/Makefile.arch -=================================================================== ---- git.orig/libc/sysdeps/linux/arm/Makefile.arch 2013-05-23 11:13:32.000000000 -0700 -+++ git/libc/sysdeps/linux/arm/Makefile.arch 2013-05-23 11:16:18.304333131 -0700 -@@ -13,7 +13,9 @@ - vfork.S clone.S - - SSRC-$(UCLIBC_HAS_LFS) += mmap64.S --SSRC-$(UCLIBC_HAS_THREADS_NATIVE) += libc-aeabi_read_tp.S libc-thumb_atomics.S -+SSRC-$(UCLIBC_HAS_THREADS_NATIVE) += libc-thumb_atomics.S -+libc-nonshared-$(UCLIBC_HAS_THREADS_NATIVE) += $(ARCH_OUT)/libc-aeabi_read_tp.os -+libc-static-$(UCLIBC_HAS_THREADS_NATIVE) += $(ARCH_OUT)/libc-aeabi_read_tp.o - CSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += makecontext.c - SSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += getcontext.S setcontext.S swapcontext.S - diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch deleted file mode 100644 index 297a40bd04..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch +++ /dev/null @@ -1,74 +0,0 @@ -From d021e6252b33e779857846714fb1899a25c9965d Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 23 Jun 2012 15:59:01 -0700 -Subject: [PATCH] nptl/atfork: Hide pthread_atfork in shared versions - -Signed-off-by: Khem Raj -Upstream-Status: Pending ---- - libpthread/nptl/Makefile.in | 4 +++- - libpthread/nptl/pthread_atfork.c | 12 ++++++++++-- - 2 files changed, 13 insertions(+), 3 deletions(-) - -diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in -index 158bcae..3ef7175 100644 ---- a/libpthread/nptl/Makefile.in -+++ b/libpthread/nptl/Makefile.in -@@ -16,6 +16,7 @@ libc-shared-routines-y = forward.c libc-cancellation.c - libc-static-routines-y = alloca_cutoff.c libc-cancellation.c - libpthread-shared-only-routines-y = version.c - libpthread-static-only-routines-y = pthread_atfork.c -+ - libpthread-routines- += $(notdir $(wildcard $(libpthread_DIR)/gen_*.c)) # dummy generated files - libpthread-routines- += allocatestack.c # dummy included by pthread_create.c - libpthread-routines- += pthread_mutex_getprioceiling.c pthread_mutex_setprioceiling.c # XXX: delete those or use them! -@@ -208,7 +209,7 @@ CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables - CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables - - CFLAGS-pt-system.c = -fexceptions -I$(top_srcdir)libc/stdlib -- -+CFLAGS-pthread_atfork.c = -DNOT_IN_libc - # - # The rest of this file is uClibc specific. - # -@@ -224,3 +225,4 @@ CFLAGS-OMIT-alloca_cutoff.c = $(CFLAGS-nptl) - CFLAGS-OMIT-forward.c = $(CFLAGS-nptl) - CFLAGS-OMIT-libc-lowlevelock.c = $(CFLAGS-nptl) - CFLAGS-OMIT-libc-cancellation.c = $(CFLAGS-nptl) -+ -diff --git a/libpthread/nptl/pthread_atfork.c b/libpthread/nptl/pthread_atfork.c -index e607d49..6224c17 100644 ---- a/libpthread/nptl/pthread_atfork.c -+++ b/libpthread/nptl/pthread_atfork.c -@@ -38,13 +38,17 @@ - #include - - /* This is defined by newer gcc version unique for each module. */ --extern void *__dso_handle __attribute__ ((__weak__)); -- //,__visibility__ ("hidden"))); -+extern void *__dso_handle __attribute__ ((__weak__, -+ __visibility__ ("hidden"))); - - - /* Hide the symbol so that no definition but the one locally in the - executable or DSO is used. */ - int -+#ifndef __pthread_atfork -+/* Don't mark the compatibility function as hidden. */ -+attribute_hidden -+#endif - __pthread_atfork ( - void (*prepare) (void), - void (*parent) (void), -@@ -53,4 +57,8 @@ __pthread_atfork ( - return __register_atfork (prepare, parent, child, - &__dso_handle == NULL ? NULL : __dso_handle); - } -+#ifndef __pthread_atfork -+extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), -+ void (*child) (void)) attribute_hidden; - strong_alias (__pthread_atfork, pthread_atfork) -+#endif --- -1.7.9.5 - diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-timex-Sync-with-glibc.patch b/meta/recipes-core/uclibc/uclibc-git/0001-timex-Sync-with-glibc.patch deleted file mode 100644 index 5d6a0a5366..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0001-timex-Sync-with-glibc.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f489cc44a209f6c4370e94c9c788fc9cc4820be1 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 25 Aug 2014 16:22:57 -0700 -Subject: [PATCH] timex: Sync with glibc - -Signed-off-by: Khem Raj -Upstream-status: Pending ---- - include/sys/timex.h | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/include/sys/timex.h b/include/sys/timex.h -index 9082a28..57059bd 100644 ---- a/include/sys/timex.h -+++ b/include/sys/timex.h -@@ -67,8 +67,12 @@ struct timex - #define ADJ_ESTERROR 0x0008 /* estimated time error */ - #define ADJ_STATUS 0x0010 /* clock status */ - #define ADJ_TIMECONST 0x0020 /* pll time constant */ --#define ADJ_TICK 0x4000 /* tick value */ --#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ -+#define ADJ_TAI 0x0080 /* set TAI offset */ -+#define ADJ_MICRO 0x1000 /* select microsecond resolution */ -+#define ADJ_NANO 0x2000 /* select nanosecond resolution */ -+#define ADJ_TICK 0x4000 /* tick value */ -+#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ -+#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ - - /* xntp 3.4 compatibility names */ - #define MOD_OFFSET ADJ_OFFSET --- -2.1.0 - diff --git a/meta/recipes-core/uclibc/uclibc-git/0002-Add-implementation-for-copysignl-for-ppc.patch b/meta/recipes-core/uclibc/uclibc-git/0002-Add-implementation-for-copysignl-for-ppc.patch new file mode 100644 index 0000000000..d4275c997e --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0002-Add-implementation-for-copysignl-for-ppc.patch @@ -0,0 +1,125 @@ +From 5d362074e5975b150a35bcfa77eab1bfa4e30de7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 16 Aug 2015 20:50:56 -0700 +Subject: [PATCH 2/7] Add implementation for copysignl for ppc + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + libc/sysdeps/linux/powerpc/Makefile.arch | 2 +- + libc/sysdeps/linux/powerpc/copysignl.c | 89 ++++++++++++++++++++++++++++++++ + 2 files changed, 90 insertions(+), 1 deletion(-) + create mode 100644 libc/sysdeps/linux/powerpc/copysignl.c + +diff --git a/libc/sysdeps/linux/powerpc/Makefile.arch b/libc/sysdeps/linux/powerpc/Makefile.arch +index 4fbcb11..7c09c87 100644 +--- a/libc/sysdeps/linux/powerpc/Makefile.arch ++++ b/libc/sysdeps/linux/powerpc/Makefile.arch +@@ -5,7 +5,7 @@ + # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + # + +-CSRC-y := __syscall_error.c ioctl.c ++CSRC-y := __syscall_error.c ioctl.c copysignl.c + + SSRC-y := \ + __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \ +diff --git a/libc/sysdeps/linux/powerpc/copysignl.c b/libc/sysdeps/linux/powerpc/copysignl.c +new file mode 100644 +index 0000000..000f653 +--- /dev/null ++++ b/libc/sysdeps/linux/powerpc/copysignl.c +@@ -0,0 +1,89 @@ ++/* s_copysignl.c -- long double version of s_copysign.c. ++ * Conversion to long double by Ulrich Drepper, ++ * Cygnus Support, drepper@cygnus.com. ++ */ ++ ++/* ++ * ==================================================== ++ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ++ * ++ * Developed at SunPro, a Sun Microsystems, Inc. business. ++ * Permission to use, copy, modify, and distribute this ++ * software is freely granted, provided that this notice ++ * is preserved. ++ * ==================================================== ++ */ ++ ++/* ++ * copysignl(long double x, long double y) ++ * copysignl(x,y) returns a value with the magnitude of x and ++ * with the sign bit of y. ++ */ ++ ++#include ++#include ++ ++#if __FLOAT_WORD_ORDER == BIG_ENDIAN ++ ++typedef union ++{ ++ long double value; ++ struct ++ { ++ int sign_exponent:16; ++ unsigned int empty:16; ++ uint32_t msw; ++ uint32_t lsw; ++ } parts; ++} ieee_long_double_shape_type; ++ ++#endif ++ ++#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN ++ ++typedef union ++{ ++ long double value; ++ struct ++ { ++ uint32_t lsw; ++ uint32_t msw; ++ int sign_exponent:16; ++ unsigned int empty:16; ++ } parts; ++} ieee_long_double_shape_type; ++ ++#endif ++ ++/* Get int from the exponent of a long double. */ ++ ++#define GET_LDOUBLE_EXP(exp,d) \ ++do { \ ++ ieee_long_double_shape_type ge_u; \ ++ ge_u.value = (d); \ ++ (exp) = ge_u.parts.sign_exponent; \ ++} while (0) ++ ++/* Set exponent of a long double from an int. */ ++ ++#define SET_LDOUBLE_EXP(d,exp) \ ++do { \ ++ ieee_long_double_shape_type se_u; \ ++ se_u.value = (d); \ ++ se_u.parts.sign_exponent = (exp); \ ++ (d) = se_u.value; \ ++} while (0) ++ ++long double copysignl(long double x, long double y); ++libc_hidden_proto(copysignl); ++ ++long double copysignl(long double x, long double y) ++{ ++ uint32_t es1,es2; ++ GET_LDOUBLE_EXP(es1,x); ++ GET_LDOUBLE_EXP(es2,y); ++ SET_LDOUBLE_EXP(x,(es1&0x7fff)|(es2&0x8000)); ++ return x; ++} ++ ++libc_hidden_def(copysignl); +-- +2.1.4 + diff --git a/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch b/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch deleted file mode 100644 index 94c6f68571..0000000000 --- a/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch +++ /dev/null @@ -1,68 +0,0 @@ -From db575359d4b8164ad6c2ac5f36c7a50c065a2864 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 20 Feb 2014 00:44:34 -0800 -Subject: [PATCH 2/3] wire setns syscall - -Signed-off-by: Khem Raj -Upstream-Status: Pending ---- - libc/sysdeps/linux/common/Makefile.in | 1 + - libc/sysdeps/linux/common/bits/sched.h | 4 ++++ - libc/sysdeps/linux/common/setns.c | 18 ++++++++++++++++++ - 3 files changed, 23 insertions(+) - create mode 100644 libc/sysdeps/linux/common/setns.c - -diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in -index 45d2e21..10d9884 100644 ---- a/libc/sysdeps/linux/common/Makefile.in -+++ b/libc/sysdeps/linux/common/Makefile.in -@@ -45,6 +45,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \ - sendfile.c \ - setfsgid.c \ - setfsuid.c \ -+ setns.c \ - setresgid.c \ - setresuid.c \ - signalfd.c \ -diff --git a/libc/sysdeps/linux/common/bits/sched.h b/libc/sysdeps/linux/common/bits/sched.h -index a5eb6ee..9436f66 100644 ---- a/libc/sysdeps/linux/common/bits/sched.h -+++ b/libc/sysdeps/linux/common/bits/sched.h -@@ -85,6 +85,10 @@ extern int unshare (int __flags) __THROW; - - /* Get index of currently used CPU. */ - extern int sched_getcpu (void) __THROW; -+ -+/* Switch process to namespace of type NSTYPE indicated by FD. */ -+extern int setns (int __fd, int __nstype) __THROW; -+ - #endif - - __END_DECLS -diff --git a/libc/sysdeps/linux/common/setns.c b/libc/sysdeps/linux/common/setns.c -new file mode 100644 -index 0000000..376bf26 ---- /dev/null -+++ b/libc/sysdeps/linux/common/setns.c -@@ -0,0 +1,18 @@ -+/* vi: set sw=4 ts=4: */ -+/* -+ * setns() for uClibc -+ * -+ * Copyright (C) 2014 Khem Raj -+ * -+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -+ */ -+ -+#include -+#include -+ -+/* -+ * setns() -+ */ -+#ifdef __NR_setns -+_syscall2(int, setns, int, fd, int, nstype) -+#endif --- -1.9.0 - diff --git a/meta/recipes-core/uclibc/uclibc-git/0003-Add-argp-implementation.patch b/meta/recipes-core/uclibc/uclibc-git/0003-Add-argp-implementation.patch new file mode 100644 index 0000000000..ee9448337c --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-git/0003-Add-argp-implementation.patch @@ -0,0 +1,5811 @@ +From eaae816fb22929469aa4cc3402b91b512fc69549 Mon Sep 17 00:00:00 2001 +From: Salvatore Cro +Date: Sun, 16 Aug 2015 20:53:37 -0700 +Subject: [PATCH 3/7] Add argp implementation + +Argp is an advanced support for parsing unix-style argument vectors. +In addition to the common getopt interface, it provides automatic +response +to `--help' and `--version' options and use of custom parser in +conjunction +with argp native option parser, among others. +Argp support is required by elfutils package and prelink. + +In uClibc argp functionalities has been moved from C library to +libuargp.so +Further the libc.so linker script contains an AS_NEEDED entry so that +it doesn't need to link libuargp.so explicitely. + +Signed-off-by: Salvatore Cro +Signed-off-by: Filippo Arcidiacono +Signed-off-by: Carmelo Amoroso +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + Makefile.in | 9 + + Makerules | 7 +- + Rules.mak | 13 + + extra/Configs/Config.in | 17 + + include/argp.h | 566 ++++++++ + libc/sysdeps/linux/common/bits/getopt_int.h | 136 ++ + libc/unistd/getopt.c | 19 +- + libuargp/Makefile | 14 + + libuargp/Makefile.in | 73 ++ + libuargp/argp-ba.c | 26 + + libuargp/argp-eexst.c | 32 + + libuargp/argp-fmtstream.c | 439 +++++++ + libuargp/argp-fmtstream.h | 314 +++++ + libuargp/argp-fs-xinl.c | 44 + + libuargp/argp-help.c | 1882 +++++++++++++++++++++++++++ + libuargp/argp-parse.c | 949 ++++++++++++++ + libuargp/argp-pv.c | 25 + + libuargp/argp-pvh.c | 32 + + libuargp/argp-xinl.c | 35 + + test/argp/Makefile | 7 + + test/argp/Makefile.in | 12 + + test/argp/argp-ex1.c | 15 + + test/argp/argp-ex2.c | 45 + + test/argp/argp-ex3.c | 153 +++ + test/argp/argp-ex4.c | 167 +++ + test/argp/argp-test.c | 209 +++ + test/argp/bug-argp1.c | 26 + + test/argp/tst-argp1.c | 118 ++ + test/argp/tst-argp2.c | 101 ++ + 29 files changed, 5481 insertions(+), 4 deletions(-) + create mode 100644 include/argp.h + create mode 100644 libc/sysdeps/linux/common/bits/getopt_int.h + create mode 100644 libuargp/Makefile + create mode 100644 libuargp/Makefile.in + create mode 100644 libuargp/argp-ba.c + create mode 100644 libuargp/argp-eexst.c + create mode 100644 libuargp/argp-fmtstream.c + create mode 100644 libuargp/argp-fmtstream.h + create mode 100644 libuargp/argp-fs-xinl.c + create mode 100644 libuargp/argp-help.c + create mode 100644 libuargp/argp-parse.c + create mode 100644 libuargp/argp-pv.c + create mode 100644 libuargp/argp-pvh.c + create mode 100644 libuargp/argp-xinl.c + create mode 100644 test/argp/Makefile + create mode 100644 test/argp/Makefile.in + create mode 100644 test/argp/argp-ex1.c + create mode 100644 test/argp/argp-ex2.c + create mode 100644 test/argp/argp-ex3.c + create mode 100644 test/argp/argp-ex4.c + create mode 100644 test/argp/argp-test.c + create mode 100644 test/argp/bug-argp1.c + create mode 100644 test/argp/tst-argp1.c + create mode 100644 test/argp/tst-argp2.c + +diff --git a/Makefile.in b/Makefile.in +index 04671a4..a450af9 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -39,6 +39,7 @@ include $(top_srcdir)libresolv/Makefile.in + include $(top_srcdir)libutil/Makefile.in + include $(top_srcdir)libpthread/Makefile.in + include $(top_srcdir)librt/Makefile.in ++include $(top_srcdir)libuargp/Makefile.in + include $(top_srcdir)libubacktrace/Makefile.in + + # last included to catch all the objects added by others (locales/threads) +@@ -262,6 +263,7 @@ HEADERS_RM- += sgtty.h + endif + HEADERS_RM-$(HAVE_SHARED) += dlfcn.h bits/dlfcn.h + HEADERS_RM-$(PTHREADS_DEBUG_SUPPORT) += thread_db.h ++HEADERS_RM-$(UCLIBC_HAS_ARGP) += argp.h + HEADERS_RM-$(UCLIBC_HAS_BSD_ERR) += err.h + HEADERS_RM-$(UCLIBC_HAS_CRYPT) += crypt.h + HEADERS_RM-$(UCLIBC_HAS_EPOLL) += sys/epoll.h +@@ -386,6 +388,13 @@ else + -$(INSTALL) -m 755 $(top_builddir)lib/libc.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/ + endif + echo "$(UBACKTRACE_ASNEEDED)" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so ++ifeq ($(UCLIBC_HAS_ARGP),y) ++# Add the AS_NEEDED entry for libuargp.so ++ if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_MAJORNAME) ] ; then \ ++ echo "GROUP ( $(UARGP_ASNEEDED) )" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \ ++ fi ++endif ++ + ifeq ($(UCLIBC_HAS_THREADS),y) + ifneq ($(LINUXTHREADS_OLD),y) + ifeq ($(HARDWIRED_ABSPATH),y) +diff --git a/Makerules b/Makerules +index d6f7e24..e70050d 100644 +--- a/Makerules ++++ b/Makerules +@@ -48,6 +48,7 @@ $(eval $(call add_IS_IN_lib,libresolv,$(libresolv-a-y) $(libresolv-so-y))) + $(eval $(call add_IS_IN_lib,librt,$(librt-a-y) $(librt-so-y))) + $(eval $(call add_IS_IN_lib,libutil,$(libutil-a-y) $(libutil-so-y))) + $(eval $(call add_IS_IN_lib,libubacktrace,$(libubacktrace-a-y) $(libubacktrace-so-y))) ++$(eval $(call add_IS_IN_lib,libuargp,$(libuargp-a-y) $(libuargp-so-y))) + + shared_objs = $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y) \ + $(libcrypt-so-y) $(libdl-so-y) \ +@@ -55,12 +56,12 @@ shared_objs = $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y) \ + $(libpthread-so-y) $(libpthread-nonshared-y) $(libthread_db-so-y) \ + $(libresolv-so-y) $(librt-so-y) \ + $(ldso-y) \ +- $(libutil-so-y) $(libubacktrace-so-y) ++ $(libutil-so-y) $(libubacktrace-so-y) $(libuargp-so-y) + + ar_objs = $(libc-y) $(libc-static-y) $(libcrypt-a-y) \ + $(libdl-a-y) $(libintl-a-y) $(libm-a-y) $(libnsl-a-y) \ + $(libpthread-a-y) $(libthread_db-a-y) \ +- $(libresolv-a-y) $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y) ++ $(libresolv-a-y) $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y) $(libuargp-a-y) + ifeq ($(DOPIC),y) + ar_objs := $(ar_objs:.o=.os) + endif +@@ -498,7 +499,7 @@ files.dep := $(libc-a-y) $(libc-so-y) $(libc-nonshared-y) \ + $(librt-a-y) $(librt-so-y) $(libresolv-a-y) $(libresolv-so-y) \ + $(libcrypt-a-y) $(libcrypt-so-y) $(libutil-a-y) $(libutil-so-y) \ + $(libnsl-a-y) $(libnsl-so-y) $(ldso-y) $(libdl-a-y) $(libdl-so-y) \ +- $(libubacktrace-a-y) $(libubacktrace-so-y) ++ $(libubacktrace-a-y) $(libubacktrace-so-y) $(libuargp-so-y) $(libuargp-a-y) + .depends.dep := \ + $(patsubst %.s,%.s.dep,$(filter %.s,$(files.dep))) \ + $(patsubst %.o,%.o.dep,$(filter %.o,$(files.dep))) \ +diff --git a/Rules.mak b/Rules.mak +index de9ffb3..a2baf58 100644 +--- a/Rules.mak ++++ b/Rules.mak +@@ -602,6 +602,19 @@ export UBACKTRACE_ASNEEDED:=$(shell $(CC) -Wl,--help 2>/dev/null | grep -q -- -- + else + export UBACKTRACE_ASNEEDED:="" + endif ++ifeq ($(UCLIBC_HAS_ARGP),y) ++ifeq ($(HARDWIRED_ABSPATH),y) ++# Only used in installed libc.so linker script ++UARGP_FULL_NAME := $(subst //,/,$(RUNTIME_PREFIX)$(MULTILIB_DIR)/libuargp.so.$(MAJOR_VERSION)) ++else ++UARGP_FULL_NAME := libuargp.so.$(MAJOR_VERSION) ++endif ++export UARGP_ASNEEDED:=$(shell $(CC) -Wl,--help 2>/dev/null | grep -q -- --as-needed && \ ++ echo "GROUP ( AS_NEEDED ( $(UARGP_FULL_NAME) ) )" || \ ++ echo "GROUP ( $(UARGP_FULL_NAME) )") ++else ++export UARGP_ASNEEDED:="" ++endif + endif + + # Add a bunch of extra pedantic annoyingly strict checks +diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in +index 242e45a..b36d4c9 100644 +--- a/extra/Configs/Config.in ++++ b/extra/Configs/Config.in +@@ -1943,6 +1943,23 @@ config UCLIBC_HAS_GNU_GETSUBOPT + Answer Y if you want to include getsubopt(). + + Most people will answer Y. ++ ++config UCLIBC_HAS_ARGP ++ bool "Support argp (as standalone shared object)" ++ default n ++ help ++ Argp is an interface for parsing unix-style argument vectors. Unlike ++ the common getopt interface, it provides many advanced features in ++ addition to parsing options, such as automatic output in response to ++ `--help' and `--version' options. ++ A library can export an argp option parser, which programs can easily ++ use in conjunction with their own option parser. ++ A new shared object "libuargp" is created. The "libc.so" linker script ++ contains the AS_NEEDED entry for getting the libuargp linked automatically. ++ Argp support is needed by elfutils libdw. ++ ++ Most people can safely answer N. ++ + endmenu + + +diff --git a/include/argp.h b/include/argp.h +new file mode 100644 +index 0000000..9d53728 +--- /dev/null ++++ b/include/argp.h +@@ -0,0 +1,566 @@ ++/* Hierarchial argument parsing, layered over getopt. ++ Copyright (C) 1995-1999, 2003, 2004, 2005, 2006, 2007, 2009 ++ Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Written by Miles Bader . ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. ++ ++ Modified for uClibc by: Salvatore Cro ++*/ ++ ++#ifndef _ARGP_H ++#define _ARGP_H ++ ++#include ++#include ++#include ++ ++#define __need_error_t ++#include ++ ++#ifndef __const ++# define __const const ++#endif ++ ++#ifndef __THROW ++# define __THROW ++#endif ++#ifndef __NTH ++# define __NTH(fct) fct __THROW ++#endif ++ ++#ifndef __attribute__ ++/* This feature is available in gcc versions 2.5 and later. */ ++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__) ++# define __attribute__(Spec) /* empty */ ++# endif ++/* The __-protected variants of `format' and `printf' attributes ++ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ ++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__) ++# define __format__ format ++# define __printf__ printf ++# endif ++#endif ++ ++/* GCC 2.95 and later have "__restrict"; C99 compilers have ++ "restrict", and "configure" may have defined "restrict". */ ++#ifndef __restrict ++# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)) ++# if defined restrict || 199901L <= __STDC_VERSION__ ++# define __restrict restrict ++# else ++# define __restrict ++# endif ++# endif ++#endif ++ ++#ifndef __error_t_defined ++typedef int error_t; ++# define __error_t_defined ++#endif ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/* A description of a particular option. A pointer to an array of ++ these is passed in the OPTIONS field of an argp structure. Each option ++ entry can correspond to one long option and/or one short option; more ++ names for the same option can be added by following an entry in an option ++ array with options having the OPTION_ALIAS flag set. */ ++struct argp_option ++{ ++ /* The long option name. For more than one name for the same option, you ++ can use following options with the OPTION_ALIAS flag set. */ ++ __const char *name; ++ ++ /* What key is returned for this option. If > 0 and printable, then it's ++ also accepted as a short option. */ ++ int key; ++ ++ /* If non-NULL, this is the name of the argument associated with this ++ option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */ ++ __const char *arg; ++ ++ /* OPTION_ flags. */ ++ int flags; ++ ++ /* The doc string for this option. If both NAME and KEY are 0, This string ++ will be printed outdented from the normal option column, making it ++ useful as a group header (it will be the first thing printed in its ++ group); in this usage, it's conventional to end the string with a `:'. */ ++ __const char *doc; ++ ++ /* The group this option is in. In a long help message, options are sorted ++ alphabetically within each group, and the groups presented in the order ++ 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with ++ if this field 0 will inherit the group number of the previous entry, or ++ zero if it's the first one, unless its a group header (NAME and KEY both ++ 0), in which case, the previous entry + 1 is the default. Automagic ++ options such as --help are put into group -1. */ ++ int group; ++}; ++ ++/* The argument associated with this option is optional. */ ++#define OPTION_ARG_OPTIONAL 0x1 ++ ++/* This option isn't displayed in any help messages. */ ++#define OPTION_HIDDEN 0x2 ++ ++/* This option is an alias for the closest previous non-alias option. This ++ means that it will be displayed in the same help entry, and will inherit ++ fields other than NAME and KEY from the aliased option. */ ++#define OPTION_ALIAS 0x4 ++ ++/* This option isn't actually an option (and so should be ignored by the ++ actual option parser), but rather an arbitrary piece of documentation that ++ should be displayed in much the same manner as the options. If this flag ++ is set, then the option NAME field is displayed unmodified (e.g., no `--' ++ prefix is added) at the left-margin (where a *short* option would normally ++ be displayed), and the documentation string in the normal place. For ++ purposes of sorting, any leading whitespace and punctuation is ignored, ++ except that if the first non-whitespace character is not `-', this entry ++ is displayed after all options (and OPTION_DOC entries with a leading `-') ++ in the same group. */ ++#define OPTION_DOC 0x8 ++ ++/* This option shouldn't be included in `long' usage messages (but is still ++ included in help messages). This is mainly intended for options that are ++ completely documented in an argp's ARGS_DOC field, in which case including ++ the option in the generic usage list would be redundant. For instance, ++ if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to ++ distinguish these two cases, -x should probably be marked ++ OPTION_NO_USAGE. */ ++#define OPTION_NO_USAGE 0x10 ++ ++struct argp; /* fwd declare this type */ ++struct argp_state; /* " */ ++struct argp_child; /* " */ ++ ++/* The type of a pointer to an argp parsing function. */ ++ty