From e51d746b4b9ed54ddeed48d9e65ffd0811298c49 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 5fe8fc1ac4b5eb0f9e9bb01295c14b99d80ab41e 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 cf0234de47b019ac24e2d361d6386fdfad48f119 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 c78cc48514723c9182a4fb5baa35bd59b8485cc7 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 14 Apr 2015 23:58:41 +0200 Subject: arm: thumb1: Fix conflicting types for _v3 In file included from ./include/sys/syscall.h:33:0, from libc/sysdeps/linux/common/sync_file_range.c:10: libc/sysdeps/linux/common/sync_file_range.c: In function '__sync_file_range_nocancel': ./include/bits/syscalls.h:144:16: error: conflicting types for '_v3' register int _v3 __asm__ ("v3") = _v3tmp; ^ ./libc/sysdeps/linux/arm/sysdep.h:281:7: note: in expansion of macro 'LOAD_ARGS_7' LOAD_ARGS_##nr (args) \ ^ ./libc/sysdeps/linux/arm/sysdep.h:324:2: note: in expansion of macro 'INTERNAL_SYSCALL_RAW' INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args) ^ ./libc/sysdeps/linux/arm/sysdep.h:256:40: note: in expansion of macro 'INTERNAL_SYSCALL' ({ unsigned int _inline_sys_result = INTERNAL_SYSCALL (name, , nr, args); \ ^ libc/sysdeps/linux/common/sync_file_range.c:32:9: note: in expansion of macro 'INLINE_SYSCALL' return INLINE_SYSCALL(sync_file_range, 7, fd, 0, ^ In file included from ./libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h:18:0, from ./include/cancel.h:58, from libc/sysdeps/linux/common/sync_file_range.c:15: ./libc/sysdeps/linux/arm/sysdep.h:280:21: note: previous definition of '_v3' was here register int *_v3 __asm__ ("v3") = _sys_buf; \ ... Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/arm/bits/syscalls.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'libc') diff --git a/libc/sysdeps/linux/arm/bits/syscalls.h b/libc/sysdeps/linux/arm/bits/syscalls.h index 6b747d91b..5544ca652 100644 --- a/libc/sysdeps/linux/arm/bits/syscalls.h +++ b/libc/sysdeps/linux/arm/bits/syscalls.h @@ -87,15 +87,15 @@ { \ int _sys_buf[2]; \ register int __a1 __asm__ ("a1"); \ - register int *_v3 __asm__ ("v3") = _sys_buf; \ - *_v3 = (int) (name); \ + register int *__v3 __asm__ ("v3") = _sys_buf; \ + *__v3 = (int) (name); \ LOAD_ARGS_##nr (args) \ __asm__ __volatile__ ("str r7, [v3, #4]\n" \ "\tldr r7, [v3]\n" \ "\tswi 0 @ syscall " #name "\n" \ "\tldr r7, [v3, #4]" \ : "=r" (__a1) \ - : "r" (_v3) ASM_ARGS_##nr \ + : "r" (__v3) ASM_ARGS_##nr \ : "memory"); \ __internal_sys_result = __a1; \ } \ @@ -129,20 +129,20 @@ register int __a4 __asm__ ("a4") = __a4tmp; #define ASM_ARGS_4 ASM_ARGS_3, "r" (__a4) #define LOAD_ARGS_5(a1, a2, a3, a4, a5) \ - int _v1tmp = (int) (a5); \ + int __v1tmp = (int) (a5); \ LOAD_ARGS_4 (a1, a2, a3, a4) \ - register int _v1 __asm__ ("v1") = _v1tmp; -#define ASM_ARGS_5 ASM_ARGS_4, "r" (_v1) + register int __v1 __asm__ ("v1") = __v1tmp; +#define ASM_ARGS_5 ASM_ARGS_4, "r" (__v1) #define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \ - int _v2tmp = (int) (a6); \ + int __v2tmp = (int) (a6); \ LOAD_ARGS_5 (a1, a2, a3, a4, a5) \ - register int _v2 __asm__ ("v2") = _v2tmp; -#define ASM_ARGS_6 ASM_ARGS_5, "r" (_v2) + register int __v2 __asm__ ("v2") = __v2tmp; +#define ASM_ARGS_6 ASM_ARGS_5, "r" (__v2) #define LOAD_ARGS_7(a1, a2, a3, a4, a5, a6, a7) \ - int _v3tmp = (int) (a7); \ + int __v3tmp = (int) (a7); \ LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6) \ - register int _v3 __asm__ ("v3") = _v3tmp; -#define ASM_ARGS_7 ASM_ARGS_6, "r" (_v3) + register int __v3 __asm__ ("v3") = __v3tmp; +#define ASM_ARGS_7 ASM_ARGS_6, "r" (__v3) #endif /* __ASSEMBLER__ */ -- cgit v1.2.3