From eb56ff55d410c8aa37161a0cd14c3d6850e85584 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 31 Mar 2015 22:44:19 +0200 Subject: buildsys: tweak ucontext_i.h prerequisites ucontext_i.h too depends on uClibc_config.h. Update it to look like the other MANGLE generated files and tweak prereqs Fixes: make realclean ; make -j libc/misc/internals/__uClibc_main.i Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/Makefile.commonarch | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'libc') diff --git a/libc/sysdeps/linux/Makefile.commonarch b/libc/sysdeps/linux/Makefile.commonarch index 1bf2dc511..a6842d879 100644 --- a/libc/sysdeps/linux/Makefile.commonarch +++ b/libc/sysdeps/linux/Makefile.commonarch @@ -47,16 +47,13 @@ HEADERCLEAN_$(subst $(top_builddir),,$(ARCH_OUT)): $(do_rm) $(ARCH_HEADERS_OUT) endif -CFLAGS-ucontext_i.c = -S - -$(ARCH_OUT)/ucontext_i.c: $(ARCH_DIR)/ucontext_i.sym - $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< > $@ - -$(ARCH_OUT)/ucontext_i.s: $(ARCH_OUT)/ucontext_i.c - $(compile.c) - -$(ARCH_OUT)/ucontext_i.h: $(ARCH_OUT)/ucontext_i.s - $(do_sed) $(PTHREAD_GENERATE_MANGLE) $< > $@ +$(ARCH_OUT)/ucontext_i.h: $(top_srcdir)extra/scripts/gen-as-const.awk +$(ARCH_OUT)/ucontext_i.h: $(ARCH_OUT)/ucontext_i.sym + @$(disp_gen) + $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< \ + | $(CC) $(CFLAGS) -x c - -S -o - \ + | $(SED) $(PTHREAD_GENERATE_MANGLE) > $@ + @if test ! -s $@ ; then rm -f $@ ; false ; fi pregen-headers-$(UCLIBC_HAS_CONTEXT_FUNCS) += $(ARCH_OUT)/ucontext_i.h -- cgit v1.2.3 From 9df521f763d8dc96f06ee083caad57b8382424fb Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 31 Mar 2015 22:44:22 +0200 Subject: buildsys: Do not build crt upon pregen No need to build crt when just generating headers Signed-off-by: Bernhard Reutner-Fischer --- libc/Makefile.in | 3 +-- libc/sysdeps/linux/Makefile.commonarch | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'libc') diff --git a/libc/Makefile.in b/libc/Makefile.in index 9c8152d44..2abc77dce 100644 --- a/libc/Makefile.in +++ b/libc/Makefile.in @@ -87,8 +87,7 @@ $(libc_OUT)/libc.oS: $(libc-multi-y) | $(top_builddir)lib/libc.a $(top_builddir) $(Q)$(RM) $@ $(compile-m) -$(top_builddir)lib/libc.a: $(libc-a-y) | $(crt-y) - $(Q)$(INSTALL) -d $(dir $@) +$(top_builddir)lib/libc.a: $(libc-a-y) $(Q)$(RM) $@ $(do_ar) diff --git a/libc/sysdeps/linux/Makefile.commonarch b/libc/sysdeps/linux/Makefile.commonarch index a6842d879..f8dc17d8f 100644 --- a/libc/sysdeps/linux/Makefile.commonarch +++ b/libc/sysdeps/linux/Makefile.commonarch @@ -15,7 +15,6 @@ ARCH_SOBJ = $(patsubst %.s,%.o,$(patsubst %.S,%.o,$(addprefix $(ARCH_OUT)/,$(SSR ARCH_OBJS-y = $(ARCH_COBJ) $(ARCH_SOBJ) -crt-y := FORCE libc-y += $(ARCH_OBJS-y) libc-nomulti-y += $(ARCH_SOBJ) objclean-y += CLEAN_$(subst $(top_builddir),,$(ARCH_OUT)) -- cgit v1.2.3 From 0a3cc64d4c8050758482f68c48482e6e375c4ffa Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 31 Mar 2015 22:44:25 +0200 Subject: libc: Fix page-size in getifaddrs() TODO: this could need a cleanup.. Signed-off-by: Bernhard Reutner-Fischer --- libc/inet/ifaddrs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'libc') diff --git a/libc/inet/ifaddrs.c b/libc/inet/ifaddrs.c index 6d9ee8903..0c9310651 100644 --- a/libc/inet/ifaddrs.c +++ b/libc/inet/ifaddrs.c @@ -115,7 +115,8 @@ __netlink_request (struct netlink_handle *h, int type) { struct netlink_res *nlm_next; struct netlink_res **new_nlm_list; - static volatile size_t buf_size = 4096; + static volatile size_t buf_size = 0; + size_t this_buf_size; char *buf; struct sockaddr_nl nladdr; struct nlmsghdr *nlmh; @@ -126,7 +127,15 @@ __netlink_request (struct netlink_handle *h, int type) if (__netlink_sendreq (h, type) < 0) return -1; - size_t this_buf_size = buf_size; + if (buf_size) + this_buf_size = buf_size; + else { +#ifdef PAGE_SIZE + this_buf_size = PAGE_SIZE; +#else + this_buf_size = __pagesize; +#endif + } if (__libc_use_alloca (this_buf_size)) buf = alloca (this_buf_size); else -- cgit v1.2.3 From c269f57d321991998a0aa5cc482c7e0124ccd45f Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 9 Apr 2015 13:47:06 -0500 Subject: return NULL for realloc(p,0) like glibc See discussion here about the issue: https://sourceware.org/bugzilla/show_bug.cgi?id=12547 Fixes testsuite errors. --- libc/stdlib/malloc/realloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc') diff --git a/libc/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c index 8de00665f..8d55289c5 100644 --- a/libc/stdlib/malloc/realloc.c +++ b/libc/stdlib/malloc/realloc.c @@ -30,7 +30,7 @@ realloc (void *mem, size_t new_size) if (! new_size) { free (mem); - return malloc (new_size); + return NULL; } if (! mem) return malloc (new_size); -- cgit v1.2.3