This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, 1.0 has been updated
via a9a4e0d0f09420066968b8009e7fa2a3b3f969c6 (commit)
via 21902b578e96fd6b85b9bcda8a0e929fc844ec51 (commit)
via 5a233790c38323afaed5ede000e1ef1234755ad7 (commit)
via b6af57f98021bc3b1b8183cfb501a5c45293cdd7 (commit)
via 75cb2a2b2501e022b94d16d3db2b0e9da1979388 (commit)
via 8e43a1a143b506e391ba5ba988d1d0e88ce9364f (commit)
via 4904b4f317c7250107925ff47f38fc31b4aaaddd (commit)
from afe0dd3c88d8a4c584dcaf68c5b7590a730cf3e6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a9a4e0d0f09420066968b8009e7fa2a3b3f969c6
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Wed Dec 9 07:35:28 2015 +0100
new test is only for MALLOC_STANDARD
commit 21902b578e96fd6b85b9bcda8a0e929fc844ec51
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sun Dec 6 18:09:10 2015 +0100
bsd supports the same floating point classification functions as c99
Fixes inetd compile. From OpenWrt.
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
commit 5a233790c38323afaed5ede000e1ef1234755ad7
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sun Dec 6 18:05:32 2015 +0100
Reduce the initial buffer size for open_memstream
Reduce the initial buffer size for open_memstream (used by vasprintf),
as most strings are usually smaller than that.
Realloc the buffer after finishing the string to further reduce size.
Problem appears in case of UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y,
see
http://dev.openwrt.org/ticket/13024
Signed-off-by: Felix Fietkau <nbd(a)openwrt.org>
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
commit b6af57f98021bc3b1b8183cfb501a5c45293cdd7
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sun Dec 6 18:03:01 2015 +0100
Make malloc_stats() GNU libc compatible
This fix commit 76dfc7ce8c "Some requested additional malloc entry points"
from 2004's
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
commit 75cb2a2b2501e022b94d16d3db2b0e9da1979388
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sun Dec 6 17:59:04 2015 +0100
Define __attribute_const__
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
commit 8e43a1a143b506e391ba5ba988d1d0e88ce9364f
Author: Khem Raj <raj.khem(a)gmail.com>
Date: Sun Aug 16 20:58:59 2015 -0700
Do not support localised optimizations this helps to have a global -O level
Signed-off-by: Khem Raj <raj.khem(a)gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
commit 4904b4f317c7250107925ff47f38fc31b4aaaddd
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sun Dec 6 17:53:50 2015 +0100
Avoid unnecessary rebuilds due to compiler flag changes
Signed-off-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 6 +++---
include/malloc.h | 5 ++---
include/math.h | 7 ++++++-
include/sys/cdefs.h | 6 ++++++
libc/stdio/open_memstream.c | 4 +++-
libc/stdio/vasprintf.c | 2 ++
libc/stdlib/malloc-standard/mallinfo.c | 8 ++------
libpthread/nptl/pthread_mutex_timedlock.c | 2 ++
test/malloc/Makefile.in | 4 ++++
test/malloc/tst-asprintf.c | 27 +++++++++++++++++++++++++++
10 files changed, 57 insertions(+), 14 deletions(-)
create mode 100644 test/malloc/tst-asprintf.c
diff --git a/Rules.mak b/Rules.mak
index 59b408b..7652aab 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -327,6 +327,9 @@ PICFLAG-$(UCLIBC_FORMAT_DSBT_ELF) := -mdsbt -fpic
PICFLAG := $(PICFLAG-y)
PIEFLAG_NAME:=-fPIE
+$(eval $(call check-gcc-var,-fdata-sections))
+$(eval $(call check-gcc-var,-ffunction-sections))
+
# Some nice CPU specific optimizations
ifeq ($(TARGET_ARCH),i386)
$(eval $(call check-gcc-var,-fomit-frame-pointer))
@@ -630,9 +633,6 @@ LDFLAGS_NOSTRIP:=$(LDFLAG-fuse-ld) $(CPU_LDFLAGS-y) -shared \
#$(eval $(call check-ld-var,--gc-sections))
#LDFLAGS_NOSTRIP += $(LDFLAG_--gc-sections)
-$(eval $(call check-gcc-var,-fdata-sections))
-$(eval $(call check-gcc-var,-ffunction-sections))
-
ifeq ($(UCLIBC_BUILD_RELRO),y)
LDFLAGS_NOSTRIP+=-Wl,-z,relro
endif
diff --git a/include/malloc.h b/include/malloc.h
index a289c93..b16a110 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -159,9 +159,8 @@ extern int malloc_trim(size_t pad);
# endif /* __USE_GNU */
#include <stdio.h>
-/* Prints brief summary statistics to the specified file.
- * Writes to stderr if file is NULL. */
-extern void malloc_stats(FILE *file);
+/* Prints brief summary statistics on the stderr. */
+extern void malloc_stats(void);
/* SVID2/XPG mallopt options */
#ifndef M_MXFAST
diff --git a/include/math.h b/include/math.h
index 1b54c9e..2545476 100644
--- a/include/math.h
+++ b/include/math.h
@@ -196,7 +196,7 @@ extern int signgam;
/* ISO C99 defines some generic macros which work on any data type. */
-#ifdef __USE_ISOC99
+#if defined(__USE_ISOC99) || defined(__USE_BSD)
/* Get the architecture specific values describing the floating-point
evaluation. The following symbols will get defined:
@@ -316,6 +316,11 @@ enum
#endif /* Use ISO C99. */
+/* BSD compat */
+#define finite(x) __finite(x)
+#define finitef(x) __finitef(x)
+#define finitel(x) __finitel(x)
+
#ifdef __USE_MISC
/* Support for various different standard error handling behaviors. */
typedef enum
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 4da981f..f725ce9 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -231,6 +231,12 @@
# define __attribute_pure__ /* Ignore */
#endif
+#if __GNUC_PREREQ (2,96)
+# define __attribute_const__ __attribute__((__const__))
+#else
+# define __attribute_const__ /* unimplemented */
+#endif
+
/* At some point during the gcc 3.1 development the `used' attribute
for functions was introduced. We don't want to use it unconditionally
(although this would be possible) since it generates warnings. */
diff --git a/libc/stdio/open_memstream.c b/libc/stdio/open_memstream.c
index 5400fe4..17ef191 100644
--- a/libc/stdio/open_memstream.c
+++ b/libc/stdio/open_memstream.c
@@ -17,6 +17,8 @@
#define COOKIE ((__oms_cookie *) cookie)
+#define MEMSTREAM_BUFSIZ 256
+
typedef struct {
char *buf;
size_t len;
@@ -134,7 +136,7 @@ FILE *open_memstream(char **bufloc, size_t *sizeloc)
register FILE *fp;
if ((cookie = malloc(sizeof(__oms_cookie))) != NULL) {
- if ((cookie->buf = malloc(cookie->len = BUFSIZ)) == NULL) {
+ if ((cookie->buf = malloc(cookie->len = MEMSTREAM_BUFSIZ)) == NULL) {
goto EXIT_cookie;
}
*cookie->buf = 0; /* Set nul terminator for buffer. */
diff --git a/libc/stdio/vasprintf.c b/libc/stdio/vasprintf.c
index a901ee8..fa7926c 100644
--- a/libc/stdio/vasprintf.c
+++ b/libc/stdio/vasprintf.c
@@ -39,6 +39,8 @@ int vasprintf(char **__restrict buf, const char * __restrict format,
if (rv < 0) {
free(*buf);
*buf = NULL;
+ } else {
+ *buf = realloc(*buf, rv + 1);
}
}
diff --git a/libc/stdlib/malloc-standard/mallinfo.c
b/libc/stdlib/malloc-standard/mallinfo.c
index 3064e53..dbe4d49 100644
--- a/libc/stdlib/malloc-standard/mallinfo.c
+++ b/libc/stdlib/malloc-standard/mallinfo.c
@@ -81,16 +81,12 @@ struct mallinfo mallinfo(void)
}
libc_hidden_def(mallinfo)
-void malloc_stats(FILE *file)
+void malloc_stats(void)
{
struct mallinfo mi;
- if (file==NULL) {
- file = stderr;
- }
-
mi = mallinfo();
- fprintf(file,
+ fprintf(stderr,
"total bytes allocated = %10u\n"
"total bytes in use bytes = %10u\n"
"total non-mmapped bytes allocated = %10d\n"
diff --git a/libpthread/nptl/pthread_mutex_timedlock.c
b/libpthread/nptl/pthread_mutex_timedlock.c
index 04187f6..f56f6c5 100644
--- a/libpthread/nptl/pthread_mutex_timedlock.c
+++ b/libpthread/nptl/pthread_mutex_timedlock.c
@@ -28,7 +28,9 @@
* error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
*/
int
+#ifndef __OPTIMIZE__
attribute_optimize("Os")
+#endif
pthread_mutex_timedlock (
pthread_mutex_t *mutex,
const struct timespec *abstime)
diff --git a/test/malloc/Makefile.in b/test/malloc/Makefile.in
index f1726dd..9e7cac9 100644
--- a/test/malloc/Makefile.in
+++ b/test/malloc/Makefile.in
@@ -11,4 +11,8 @@ ifneq ($(UCLIBC_HAS_OBSTACK),y)
TESTS_DISABLED += tst-obstack
endif
+ifneq ($(MALLOC_STANDARD),y)
+TESTS_DISABLED += tst-asprintf
+endif
+
CFLAGS_tst-mallocfork = -fPIC
diff --git a/test/malloc/tst-asprintf.c b/test/malloc/tst-asprintf.c
new file mode 100644
index 0000000..d4c3f76
--- /dev/null
+++ b/test/malloc/tst-asprintf.c
@@ -0,0 +1,27 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <malloc.h>
+
+static void my_stats(void)
+{
+ malloc_stats();
+ fprintf(stderr, "\n");
+}
+
+int main(int argc, char *argv[])
+{
+ char *a, *b;
+
+ my_stats();
+ asprintf(&b, "asdsadasd %ssdf\n", "AAAA");
+ my_stats();
+ asprintf(&a, "asdsadasd %ssdf\n", "AAAA");
+ my_stats();
+ free(a);
+ free(b);
+ my_stats();
+
+ return 0;
+}
hooks/post-receive
--
uClibc-ng - small C library for embedded systems