From 218bacae45c633536bed31c0cbe2f457cb378199 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 31 Mar 2015 22:43:52 +0200 Subject: Revert "librt: Use -nodefaultlibs instead of -nostdlib" This reverts commit 534f44d53146457b3ca686c47efb9207543b88e1. I don't think this is wanted. Signed-off-by: Bernhard Reutner-Fischer --- librt/Makefile.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/librt/Makefile.in b/librt/Makefile.in index fbbf5b447..8555e94db 100644 --- a/librt/Makefile.in +++ b/librt/Makefile.in @@ -15,9 +15,6 @@ LIBS-librt.so := $(LIBS) 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 -- cgit v1.2.3 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 --- Makefile.in | 8 ++++++-- Rules.mak | 3 ++- libc/sysdeps/linux/Makefile.commonarch | 17 +++++++---------- libpthread/nptl/Makefile.in | 2 +- libpthread/nptl/sysdeps/Makefile.commonarch | 2 +- .../nptl/sysdeps/unix/sysv/linux/Makefile.commonarch | 2 +- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/Makefile.in b/Makefile.in index e76449372..32dbf4598 100644 --- a/Makefile.in +++ b/Makefile.in @@ -57,8 +57,9 @@ ifeq ($(HAVE_DOT_CONFIG),y) $(top_builddir)include/bits/uClibc_config.h: $(conf) $(KCONFIG_CONFIG) $(top_srcdir)extra/scripts/conf-header.sh | $(top_builddir)include/bits @$(disp_gen) $(Q)$< -s $(Kconfig) - $(Q)$(top_srcdir)extra/scripts/conf-header.sh $(KCONFIG_CONFIG) > $@ + $(Q)$(top_srcdir)extra/scripts/conf-header.sh $(KCONFIG_CONFIG) > $@.tmp $(Q)$(MAKE) headers-y + $(Q)mv $@.tmp $@ # The above doesn't work for threads, though. Just using check-symlinks for now. # XXX: FIXME: this is ugly @@ -183,7 +184,10 @@ headers-y += $(target-headers-sysdep) headers: $(top_builddir)include/bits/uClibc_config.h | subdirs subdirs: $(addprefix $(top_builddir),$(subdirs)) -pregen-headers: $(top_builddir)include/bits/sysnum.h $(pregen-headers-y) + +$(pregen-headers-y): $(headers_dep) + +pregen-headers: $(pregen-headers-y) pregen: headers pregen-headers $(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers) diff --git a/Rules.mak b/Rules.mak index e88eda1f1..77ca3cc43 100644 --- a/Rules.mak +++ b/Rules.mak @@ -165,7 +165,8 @@ libpthread.depend := $(top_builddir)lib/libpthread.so endif interp := $(top_builddir)lib/interp.os ldso := $(top_builddir)lib/$(UCLIBC_LDSO) -headers_dep := $(top_builddir)include/bits/sysnum.h +headers_dep := $(top_builddir)include/bits/sysnum.h \ + $(top_builddir)include/bits/uClibc_config.h sub_headers := $(headers_dep) #LIBS :=$(interp) -L$(top_builddir)lib -lc 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 diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in index 0a981cde3..55eeba2a1 100644 --- a/libpthread/nptl/Makefile.in +++ b/libpthread/nptl/Makefile.in @@ -92,7 +92,7 @@ $(top_builddir)lib/libpthread.a: $(libpthread-a-y) $(Q)$(RM) $@ $(do_ar) -$(libpthread_OUT)/pthread-errnos.h: $(top_srcdir)extra/scripts/gen-as-const.awk | headers +$(libpthread_OUT)/pthread-errnos.h: $(top_srcdir)extra/scripts/gen-as-const.awk $(libpthread_OUT)/pthread-errnos.h: $(libpthread_DIR)/pthread-errnos.sym @$(disp_gen) $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< \ diff --git a/libpthread/nptl/sysdeps/Makefile.commonarch b/libpthread/nptl/sysdeps/Makefile.commonarch index a5952a67b..7f531f542 100644 --- a/libpthread/nptl/sysdeps/Makefile.commonarch +++ b/libpthread/nptl/sysdeps/Makefile.commonarch @@ -40,7 +40,7 @@ librt_arch_COBJ = $(patsubst %.c,$(libpthread_arch_OUT)/%.o,$(librt_arch_CSRC)) librt_arch_SOBJ = $(patsubst %.S,$(libpthread_arch_OUT)/%.o,$(librt_arch_SSRC)) librt_arch_OBJS = $(librt_arch_COBJ) $(librt_arch_SOBJ) -$(libpthread_arch_OUT)/tcb-offsets.h: $(top_srcdir)extra/scripts/gen-as-const.awk | headers +$(libpthread_arch_OUT)/tcb-offsets.h: $(top_srcdir)extra/scripts/gen-as-const.awk $(libpthread_arch_OUT)/tcb-offsets.h: $(libpthread_arch_DIR)/tcb-offsets.sym @$(disp_gen) $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< \ diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch index e4a5fc55d..4e147734c 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch @@ -137,7 +137,7 @@ endif PTHREAD_LINUX_SYM := $(notdir $(wildcard $(libpthread_linux_DIR)/*.sym)) PTHREAD_LINUX_SYM_H := $(addprefix $(libpthread_linux_OUT)/,$(PTHREAD_LINUX_SYM:.sym=.h)) -$(PTHREAD_LINUX_SYM_H): $(top_srcdir)extra/scripts/gen-as-const.awk | headers +$(PTHREAD_LINUX_SYM_H): $(top_srcdir)extra/scripts/gen-as-const.awk $(PTHREAD_LINUX_SYM_H): $(libpthread_linux_OUT)/%.h: $(libpthread_linux_DIR)/%.sym @$(disp_gen) $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< \ -- 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 --- Makefile.in | 4 +--- Makerules | 17 +++++++++-------- ldso/ldso/Makefile.in | 1 + libc/Makefile.in | 3 +-- libc/sysdeps/linux/Makefile.commonarch | 1 - librt/Makefile.in | 2 +- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Makefile.in b/Makefile.in index 32dbf4598..a86f29a7d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,7 +13,7 @@ sub_headers := headers ifeq ($(HAVE_DOT_CONFIG),y) -all: pregen libs +all: pregen libs startfiles libs: pregen # In this section, we need .config @@ -219,8 +219,6 @@ install: install_runtime install_dev RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)$(MULTILIB_DIR) $(RUNTIME_PREFIX)$(MULTILIB_DIR)) -startfiles: $(crt-y) - $(top_builddir)extra/scripts/unifdef: |$(top_builddir)extra/scripts $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c $(hcompile.u) diff --git a/Makerules b/Makerules index fd6bb190d..10dc5298f 100644 --- a/Makerules +++ b/Makerules @@ -22,9 +22,9 @@ ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y) libs: $(lib-gdb-y) endif libs: $(lib-a-y) -$(lib-a-y): | $(top_builddir)lib endif objs: all_objs +$(lib-so-y) $(lib-a-y): | $(top_builddir)lib # apply unconditional per-directory flags define add_IS_IN_lib @@ -451,18 +451,18 @@ CFLAGS-initfini.s := -S -g0 $(PICFLAG) -fno-inline-functions -finhibit-size-dire $(top_builddir)lib/initfini.s: $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c | $(top_builddir)lib $(compile.c) -$(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s | $(top_builddir)lib - $(Q)sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \ - gawk -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp +$(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s + $(do_sed) -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \ + $(AWK) -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp $(Q)mv $@.tmp $@ $(top_builddir)lib/crti.S: $(top_builddir)lib/initfini.s $(top_builddir)lib/defs.h - $(Q)sed -n -e '1,/@HEADER_ENDS/p' \ + $(do_sed) -n -e '1,/@HEADER_ENDS/p' \ -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \ -e '/@TRAILER_BEGINS/,$$p' $< > $@ $(top_builddir)lib/crtn.S: $(top_builddir)lib/initfini.s - $(Q)sed -n -e '1,/@HEADER_ENDS/p' \ + $(do_sed) -n -e '1,/@HEADER_ENDS/p' \ -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \ -e '/@TRAILER_BEGINS/,$$p' $< > $@ @@ -482,9 +482,10 @@ CRTS_COMPAT := #endif startfiles = $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC) -$(crt-y): $(startfiles) +startfiles: $(startfiles) $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC): | headers -$(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC) $(LINK_FLAT_CRTS) $(SHARED_START_FILES) $(SHARED_END_FILES) : | $(top_builddir)lib +$(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC) \ + $(LINK_FLAT_CRTS) $(SHARED_START_FILES) $(SHARED_END_FILES): | $(top_builddir)lib $(top_builddir)lib/$(NONSHARED_LIBNAME): $(libc-nonshared-y) $(Q)$(RM) $@ diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in index 56f4a4556..bdd1d5e32 100644 --- a/ldso/ldso/Makefile.in +++ b/ldso/ldso/Makefile.in @@ -76,6 +76,7 @@ LDFLAGS-$(UCLIBC_LDSO_NAME).so += -T $(ldso:.$(ABI_VERSION)=).lds endif $(ldso): $(ldso:.$(ABI_VERSION)=) +$(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib $(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a ifeq ($(LDSO_PRELINK_SUPPORT),y) $(call create-lds) 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)) diff --git a/librt/Makefile.in b/librt/Makefile.in index 8555e94db..a246d00ee 100644 --- a/librt/Makefile.in +++ b/librt/Makefile.in @@ -73,7 +73,7 @@ $(librt_OUT)/librt_so.a: $(librt-so-y) $(Q)$(RM) $@ $(do_ar) -$(top_builddir)lib/librt.a: $(librt-a-y) | $(top_builddir)lib +$(top_builddir)lib/librt.a: $(librt-a-y) $(Q)$(RM) $@ $(do_ar) -- 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(-) 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 50f076d01c77d8782c455349d702507255abdc9d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 30 Mar 2015 11:15:45 -0500 Subject: Revert "gcc 4.9.x produces some calls to abort()" This reverts commit 69ba9dcaa13bb8bbdc8630265d73298c39945416. --- ldso/ldso/Makefile.in | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in index bdd1d5e32..815264291 100644 --- a/ldso/ldso/Makefile.in +++ b/ldso/ldso/Makefile.in @@ -27,14 +27,6 @@ CFLAGS-$(DODEBUG)-ldso/ldso := -O2 -g CFLAGS-ldso.c := -DLDSO_ELFINTERP=\"$(TARGET_ARCH)/elfinterp.c\" -# avoid ld.so linking error since gcc 4.9.x: undefined reference to abort -ifeq ($(TARGET_ARCH),xtensa) -CFLAGS-ldso.c += -fno-delete-null-pointer-checks -endif -ifeq ($(TARGET_ARCH),sh) -CFLAGS-ldso.c += -fno-delete-null-pointer-checks -endif - LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-$(UCLIBC_LDSO_NAME).so := -Wl,--dsbt-index=1 ifneq ($(SUPPORT_LD_DEBUG),y) LDFLAGS-$(UCLIBC_LDSO_NAME).so := $(LDFLAGS) -- cgit v1.2.3 From 08a82b3d60c36abdf28585e1b421f27431ef2452 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 29 Mar 2015 04:43:37 -0500 Subject: disable new tests, atomic.h is missing --- test/silly/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/silly/Makefile.in b/test/silly/Makefile.in index 9bb4032b5..2114d4d2e 100644 --- a/test/silly/Makefile.in +++ b/test/silly/Makefile.in @@ -5,4 +5,4 @@ RET_hello := 42 RET_tiny := 42 # missing internal headers, disable these -GLIBC_TESTS_DISABLED := tst-atomic_glibc tst-atomic-long_glibc +TESTS_DISABLED := tst-atomic tst-atomic-long -- cgit v1.2.3 From ccd00917a2cb69b80714f9b9d028288ddac23e69 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 29 Mar 2015 16:20:54 -0500 Subject: gcc 4.4 does not have __builtin_unreachable For avr32 we still use gcc 4.4 compiler, so exlude the usage of __builtin_unreachable here. --- ldso/include/dl-syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h index 4749d7abd..0acd2ba4a 100644 --- a/ldso/include/dl-syscall.h +++ b/ldso/include/dl-syscall.h @@ -51,7 +51,7 @@ extern int _dl_errno; static __always_inline attribute_noreturn __cold void _dl_exit(int status) { INLINE_SYSCALL(_dl_exit, 1, status); -#if defined __GNUC__ +#if defined __GNUC__ && !__GNUC_PREREQ (4, 4) __builtin_unreachable(); /* shut up warning: 'noreturn' function does return*/ #else while (1); -- cgit v1.2.3 From f07b6a12c449f2e5987e0b8fdcb6e72be8dbeb07 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 3 Apr 2015 03:54:03 -0500 Subject: fix linking for m68k --- test/misc/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/test/misc/Makefile.in b/test/misc/Makefile.in index d78b276c2..09ff5c3e9 100644 --- a/test/misc/Makefile.in +++ b/test/misc/Makefile.in @@ -45,3 +45,4 @@ CFLAGS_bug-glob2 = -fPIC CFLAGS_opendir-tst1 = -fPIC CFLAGS_tst-inotify = -fPIC CFLAGS_tst-utmp = -fPIC +CFLAGS_tst-utmpx = -fPIC -- cgit v1.2.3 From 64464f53eb2748ee9c615775a347685f2115d040 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 3 Apr 2015 03:57:00 -0500 Subject: add GNU libc test for ifaddrs.c --- test/inet/Makefile.in | 2 +- test/inet/tst-ifaddrs.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 test/inet/tst-ifaddrs.c diff --git a/test/inet/Makefile.in b/test/inet/Makefile.in index 38aec616b..2108d1975 100644 --- a/test/inet/Makefile.in +++ b/test/inet/Makefile.in @@ -3,7 +3,7 @@ # ifeq ($(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6),) TESTS_DISABLED := bug-if1 gethost_r-align gethostid if_nameindex tst-aton \ - tst-network tst-ntoa + tst-network tst-ntoa test-ifaddrs endif ifeq ($(UCLIBC_HAS_SOCKET)$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6),) diff --git a/test/inet/tst-ifaddrs.c b/test/inet/tst-ifaddrs.c new file mode 100644 index 000000000..6e6c01570 --- /dev/null +++ b/test/inet/tst-ifaddrs.c @@ -0,0 +1,99 @@ +/* Test listing of network interface addresses. + Copyright (C) 2002-2015 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 +#include +#include +#include +#include + +static int failures; + +static const char * +addr_string (struct sockaddr *sa, char *buf, size_t size) +{ + if (sa == NULL) + return ""; + + switch (sa->sa_family) + { + case AF_INET: + return inet_ntop (AF_INET, &((struct sockaddr_in *) sa)->sin_addr, + buf, size); + case AF_INET6: + return inet_ntop (AF_INET6, &((struct sockaddr_in6 *) sa)->sin6_addr, + buf, size); +#ifdef AF_LINK + case AF_LINK: + return ""; +#endif + case AF_UNSPEC: + return "---"; + +#ifdef AF_PACKET + case AF_PACKET: + return ""; +#endif + + default: + ++failures; + printf ("sa_family=%d %08x\n", sa->sa_family, + *(int*)&((struct sockaddr_in *) sa)->sin_addr.s_addr); + return ""; + } +} + + +static int +do_test (void) +{ + struct ifaddrs *ifaces, *ifa; + + if (getifaddrs (&ifaces) < 0) + { + if (errno != ENOSYS) + { + printf ("Couldn't get any interfaces: %s.\n", strerror (errno)); + exit (1); + } + /* The function is simply not implemented. */ + exit (0); + } + + puts ("\ +Name Flags Address Netmask Broadcast/Destination"); + + for (ifa = ifaces; ifa != NULL; ifa = ifa->ifa_next) + { + char abuf[64], mbuf[64], dbuf[64]; + printf ("%-15s%#.4x %-15s %-15s %-15s\n", + ifa->ifa_name, ifa->ifa_flags, + addr_string (ifa->ifa_addr, abuf, sizeof (abuf)), + addr_string (ifa->ifa_netmask, mbuf, sizeof (mbuf)), + addr_string (ifa->ifa_broadaddr, dbuf, sizeof (dbuf))); + } + + freeifaddrs (ifaces); + + return failures ? 1 : 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" -- cgit v1.2.3 From bbe05b64872728cd3d78ed0ef06ac963a40c4400 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 9 Apr 2015 13:45:42 -0500 Subject: still required for xtensa --- ldso/ldso/Makefile.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in index 815264291..a0ae7b3cd 100644 --- a/ldso/ldso/Makefile.in +++ b/ldso/ldso/Makefile.in @@ -27,6 +27,11 @@ CFLAGS-$(DODEBUG)-ldso/ldso := -O2 -g CFLAGS-ldso.c := -DLDSO_ELFINTERP=\"$(TARGET_ARCH)/elfinterp.c\" +# avoid ld.so linking error since gcc 4.9.x: undefined reference to abort +ifeq ($(TARGET_ARCH),xtensa) +CFLAGS-ldso.c += -fno-delete-null-pointer-checks +endif + LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-$(UCLIBC_LDSO_NAME).so := -Wl,--dsbt-index=1 ifneq ($(SUPPORT_LD_DEBUG),y) LDFLAGS-$(UCLIBC_LDSO_NAME).so := $(LDFLAGS) -- 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(-) 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 From 611eb585f50911f326f433e9827ca5948348ea7e Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 9 Apr 2015 13:47:33 -0500 Subject: fix compile for m68k --- test/inet/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/test/inet/Makefile.in b/test/inet/Makefile.in index 2108d1975..1cede4761 100644 --- a/test/inet/Makefile.in +++ b/test/inet/Makefile.in @@ -18,3 +18,4 @@ endif CFLAGS_bug-if1 = -fPIC CFLAGS_tst-sock-nonblock = -fPIC +CFLAGS_tst-ifaddrs = -fPIC -- cgit v1.2.3 From a500a54bedc8081b9959cb03214047aead18b164 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 11 Apr 2015 16:34:34 -0500 Subject: Revert "Revert "librt: Use -nodefaultlibs instead of -nostdlib"" This reverts commit 3a14ea8812e8695b5205a70431d513fb905c0daf. --- librt/Makefile.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/librt/Makefile.in b/librt/Makefile.in index a246d00ee..1c1559c4a 100644 --- a/librt/Makefile.in +++ b/librt/Makefile.in @@ -15,6 +15,9 @@ LIBS-librt.so := $(LIBS) 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 -- cgit v1.2.3