summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-01-31tests: Extend OMIT LDFLAGS logic to test binaries tooLeonid Lisovskiy
In continue of 72215487 "tests: add OMIT logic to remove compilation flag." commit. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-31Make sure to always terminate decoded stringWaldemar Brodkorb
Write a terminating '\0' to dest when the first byte of the encoded data is 0. This corner case was previously missed. Signed-off-by: Daniel Fahlgren <daniel@fahlgren.se> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-31Do not follow compressed items forever.Waldemar Brodkorb
It is possible to get stuck in an infinite loop when receiving a specially crafted DNS reply. Exit the loop after a number of iteration and consider the packet invalid. Signed-off-by: Daniel Fahlgren <daniel@fahlgren.se> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-31libdl: dlopen() mustn't forget RTLD_NODELETE flagLeonid Lisovskiy
If RTLD_NODELETE is passed to dlopen() rather than set on shared library itself, flag propagation to rtld_flags is missed. Test-case taken from glibc. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-30add exp10() from glibcWaldemar Brodkorb
Some software make use of exp10, so add it. Basic testing with LTP. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-27nios2: allow to build toolchainWaldemar Brodkorb
At least allow to compile a toolchain targeting nios2 without MMU.
2016-01-27test: disable tests requiring math headersWaldemar Brodkorb
2016-01-25hppa: unbreak toolchain buildingWaldemar Brodkorb
At least allow to build a toolchain for hppa. Sync some headers with glibc.
2016-01-12Suppress warning "_GNU_SOURCE" redefinedWaldemar Brodkorb
libc/sysdeps/linux/common/euidaccess.c:1:1: warning: "_GNU_SOURCE" redefined In file included from <command-line>:0: ./include/libc-symbols.h:52:1: warning: this is the location of the previous definition Signed-Off-By: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-10bump version for releasev1.0.11Waldemar Brodkorb
2016-01-10h8300: O_DIRECT and O_DIRECTORY swapping.Yoshinori Sato
Different define of latest kernel. kernel define is #define O_DIRECT 00040000 /* direct disk access hint */ #define O_DIRECTORY 00200000 /* must be a directory */ Yoshinori Sato <ysato@users.sourceforge.jp>
2016-01-10ARCH_NATIVE_BIT should in the first place be passed when building utils for hostEugene Rudoy
ARCH_NATIVE_BIT should in the first place be passed when building utils for host (BUILD_CFLAGS-utils). It could also be passed when building utils for target (CFLAGS-utils), but this is actually not necessary as ARCH_NATIVE_BIT and __WORDSIZE are identical in this case. Fixes 5ec4477584b69fe5f1410649b2eb3a63835fb649 (makes it actually work). Signed-off-by: Eugene Rudoy <gene@freetz.org>
2016-01-10order of special checks mattersWaldemar Brodkorb
The order of special checks seems critical for some applications. Xorg 1.18.0 fails to start with XNFreallocarray error. Took me some time to run with MALLOC_DEBUG=2 to find out. MALLOC_STANDARD is not affected.
2016-01-10NPTL: fix infinite recursionWaldemar Brodkorb
fix infinite recursion on application exit triggered by linking libc before libpthread. Patch from OpenWrt. Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-10NPTL: Fix __pthread_once old style declarationWaldemar Brodkorb
Trivial fix. Signed-Off-By: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-10Add implementation for copysignl for i386Waldemar Brodkorb
Patch from OpenWrt. Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-10Implement legacy bcopy/bzero/bcmp/index/rindex as inline functionsWaldemar Brodkorb
patch from OpenWrt. Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-10Provide XTI __t_scalar_t types, like glibcWaldemar Brodkorb
Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-10test-skeleton: Fixes from glibcWaldemar Brodkorb
glibc commits d7a05d0728 test-skeleton: Kill any child process's offspring cc8dcf96e7 test-skeleton: Support temporary files without memory leaks [BZ#18333] Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-09fix compile with DODEBUG=yWaldemar Brodkorb
Since more projects using two-stage cross-compile process we cannot add libgcc_eh.a unconditionally. We must check if a real file is referenced by the cross-compiler. Toolchains with --disabel-shared build have a single libgcc.a containing all required symbols. Tested with a debug build for x86.
2016-01-07disable always failing tst-signal7Waldemar Brodkorb
The required test for the internal NPTL used signals isn't implemented.
2016-01-06Remove alias.Yoshinori Sato
open_cancel and open2_cancel have diffrent argument on open. So can't alias this functions. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
2016-01-06openat argument fix.Yoshinori Sato
If argument passing to register case (ex. -mregparam=3). This case set all parameters set to register from caller. But callee refer to stack. So can't get parameter. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
2016-01-06pthread_atfork handlers not removed during dlcloseWaldemar Brodkorb
Invoke pthread_atfork handler cleanup when removing the associated DSO... If a program loads a DSO (dlopen) that sets up a pthread_atfork handler(s), and then subsequently closes the DSO, the handler(s) are left in place. If fork() is subsequently called, the handlers are invoked even though the DSO has been removed causing crashes or unpredictable code execution. This is because the code in __cxa_finalize(atexit.c)to invoke the unregister_atfork() routine is ifdef'd out with the comment that it hasn't been "looked into this yet...". Refs.: http://bugs.busybox.net/show_bug.cgi?id=8211 http://sourceware.org/bugzilla/show_bug.cgi?id=13502 Add test-case, enable cleanup for NPTL only. Signed-off-by: John Ata <john.ata@baesystems.com> Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-06__ARCH_HAS_DEPRECATED_SYSCALLS__ case fix. getdents is deprecated.Yoshinori Sato
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
2016-01-06h8300: vfork flags update.Yoshinori Sato
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
2016-01-06linuxthreads.old: Implement pthread_tryjoin_np(), pthread_timedjoin_np()Leonid Lisovskiy
Some applications needs it. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-06extra/Configs/Config.in: add syncfs() to Linux-specific functionsAnthony G. Basile
syncfs() was recently added (commit dfa593d4d). But man sync(2) specifies that syncfs() is Linux-specific. This was overlooked in the original commit so we add it to the set of Linux-specific functions supported by uClibc. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-01-03libc: getpass,getutent: allocate buffer dynamicallyWaldemar Brodkorb
Saves 0.6k bss with default buffer size(256). text data bss dec hex filename - 1172 8 408 1588 634 libc/misc/utmp/utent.os - 429 0 256 685 2ad libc/unistd/getpass.os + 1208 8 28 1244 4dc libc/misc/utmp/utent.os + 471 0 4 475 1db libc/unistd/getpass.os ================================================================ +78 -632 Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-03remove pregenerated locale support, we don't support itWaldemar Brodkorb
2016-01-02libc/inet: Unbreak gethostent()Waldemar Brodkorb
Although gethostent() is obsoleted, there is no reason to keep it broken. Fix two problems: * commit f65e66078b "resolver: switch to config parser" leave an extra break statement in case of GETHOSTENT in __read_etc_hosts_r. In result, output buffer wasn't initialized at all. * gethostent static buffer has insufficient size to store aliases, so __read_etc_hosts_r always returns ERANGE. Restore ALIAS_DIM define. Add test-case. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-02Use dynamic buffers for gethostent/gethostbyname/gethostbyaddrWaldemar Brodkorb
Save ~1k static space (.bss) text data bss dec hex filename - 68 0 126 194 c2 libc/inet/gethostent.os - 79 0 460 539 21b libc/inet/gethostbyname2.os - 83 0 460 543 21f libc/inet/gethostbyaddr.os + 98 0 24 122 7a libc/inet/gethostent.os + 110 0 24 134 86 libc/inet/gethostbyname2.os + 113 0 24 137 89 libc/inet/gethostbyaddr.os ================================================================== +91 -974 Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-02libc/pwd_grp: Allocate buffers for non-reentrant functions dynamicallyWaldemar Brodkorb
Saves 3k bss with default buffer size(256). text data bss dec hex filename - 61 0 272 333 14d fgetgrent.os - 61 0 284 345 159 fgetpwent.os - 61 0 292 353 161 fgetspent.os - 57 0 272 329 149 getgrent.os - 61 0 272 333 14d getgrgid.os - 61 0 272 333 14d getgrnam.os - 57 0 284 341 155 getpwent.os - 61 0 284 345 159 getpwnam.os - 61 0 284 345 159 getpwuid.os - 57 0 292 349 15d getspent.os - 61 0 292 353 161 getspnam.os - 61 0 292 353 161 sgetspent.os + 94 0 20 114 72 fgetgrent.os + 94 0 32 126 7e fgetpwent.os + 94 0 40 134 86 fgetspent.os + 87 0 20 107 6b getgrent.os + 94 0 20 114 72 getgrgid.os + 94 0 20 114 72 getgrnam.os + 87 0 32 119 77 getpwent.os + 94 0 32 126 7e getpwnam.os + 94 0 32 126 7e getpwuid.os + 87 0 40 127 7f getspent.os + 94 0 40 134 86 getspnam.os + 94 0 40 134 86 sgetspent.os ===================================================== +387 -3024 Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-02lm32: fix testsuite compile problemsWaldemar Brodkorb
One test fails to compile with a gcc ICE, so disable it for now.
2016-01-02lm32: add missing typesWaldemar Brodkorb
2016-01-02test/Test.mak: Properly define MAKE_SRCS variableLeonid Lisovskiy
Fix typo in d81e53c5fa "New test targets 'compile' and 'run'" commit, MAKE_SRCS variable was never defined. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-02remove attribute hidden, as the function is used in linuxthreads.oldWaldemar Brodkorb
On avr32/cris the build with MALLOC fails, when compiling linuxthreads.
2016-01-02remove deprecated architectures v850/i960Waldemar Brodkorb
Both architectures are more or less deprecated. No Linux upstream support, no gcc support for uClinux.
2016-01-02inet/getaddrinfo: simplest /etc/gai.conf to control IPv6/IPv4 addresses sort ↵Leonid Lisovskiy
order Implement simplest variant of /etc/gai.conf to control getaddrinfo IPv6/IPv4 addresses sorting. Keep the default sort order - IPv6 first, IPv4 second. To invert it, create /etc/gai.conf containing single line: precedence ::ffff:0:0/96 100 Example before: $ nslookup security.debian.org 8.8.8.8 Server: 8.8.8.8 Address 1: 8.8.8.8 google-public-dns-a.google.com Name: security.debian.org Address 1: 2001:a78:5:0:216:35ff:fe7f:be4f villa.debian.org Address 2: 2001:a78:5:1:216:35ff:fe7f:6ceb lobos.debian.org Address 3: 195.20.242.89 wieck.debian.org Address 4: 212.211.132.250 lobos.debian.org Address 5: 212.211.132.32 villa.debian.org After patch & precedence set in /etc/gai.conf: $ nslookup security.debian.org 8.8.8.8 Server: 8.8.8.8 Address 1: 8.8.8.8 google-public-dns-a.google.com Name: security.debian.org Address 1: 195.20.242.89 wieck.debian.org Address 2: 212.211.132.250 lobos.debian.org Address 3: 212.211.132.32 villa.debian.org Address 4: 2001:a78:5:0:216:35ff:fe7f:be4f villa.debian.org Address 5: 2001:a78:5:1:216:35ff:fe7f:6ceb lobos.debian.org bloat-o-meter report: function old new delta getaddrinfo 726 1138 +412 gaih_inet 2660 2692 +32 .rodata 16618 16643 +25 __gai_precedence - 1 +1 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/0 up/down: 882/0) Total: 470 bytes Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-01Add argp implementationSalvatore Cro
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. Disable argp test if feature disabled. Signed-off-by: Salvatore Cro <salvatore.cro@st.com> Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-01Fix "pselect: Use linux pselect6 syscall when available"Leonid Lisovskiy
Commit e3c3bf2b58 introduce use of pselect6, but has following disadvantages: * Use of userspace types in args67 structure - it breaks, for example, configs when 32-bit uClibc-ng compiled against 64-bit kernel. Syscall will always return EINVAL. We must use __kernel_* types and __SYSCALL_SIGSET_T_SIZE. * It have excess checks for NSEC_PER_SEC. Original code from select() implementation has struct timeval => struct timespec conversion, kernel select() syscall implementation do the same. But none of libc versions (glibc, eglibc, musl) I know, perform similar checks for pselect() - there is no structure fields conversions, just struct timespec through all the calls. To have such checks in uClibc-ng we need one example, at least. * It is possible to avoid extra userspace reads from kernel code if sigmask == NULL. I suggest to do it, for a few bytes cost. * Commit didn't add test case to testsuite. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2015-12-29Xtensa is biendian, allow to choose between the modes.Waldemar Brodkorb
2015-12-29xtensa: fix vfork return address calculationsMax Filippov
vfork internally unwinds stack up one frame, saving the original return address in the a3 of the unwound frame. To do this in windowed ABI it needs to exchange two topmost bits of the original return address and of the helper entry point. Current code doesn't do it correctly for addresses above 0x40000000, resulting in illegal instruction exception for configurations that put code high, e.g. for noMMU. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-12-24prepare for release of 1.0.10v1.0.10Waldemar Brodkorb
2015-12-23Replace bltzal with lapc for MIPS R6 builds.Steve Ellcey
The R6 version of MIPS does not support the bltzal instruction. This patch changes dl-startup.h and dl-sysdep.h to use lapc on R6 instead. lapc is a new R6 insruction so older systems need to continue to use bltzal in order to load register $31. Signed-off-by: Steve Ellcey <sellcey@imgtec.com>
2015-12-22Replace MIPS specific memcpy.S/memset.S with version from glibc/newlib.Steve Ellcey
These MIPS specific versions of memcpy.S and memset.S are faster than the current ones and match what is in newlib and glibc. They also have support for the mips32r6 and mips64r6 architectures. Signed-off-by: Steve Ellcey <sellcey@imgtec.com>
2015-12-22pselect: Use linux pselect syscall when availableNicolas S. Dade
Linux has a pselect syscall since 2.6.something. Using it rather than emulating it with sigprocmask+select+sigprocmask is smaller code, and works properly. (The emulation has race conditions when unblocked signals arrive before or after the select) The tv.nsec >= 1E9 handling comes from uclibc's linux select() implementation, which itself uses pselect() internally if the pselect syscall exists. I though it would be good to do the same here. Note that although the libc pselect() API has 6 arguments, the linux kernel syscall as 7 arguments. There is an extra, somewhat vestigial, sizeof the signal mask argument. Signed-off-by: Nicolas S. Dade <nic.dade@gmail.com>
2015-12-22libc/pwd_grp: Create template for non-reentrant functionsWaldemar Brodkorb
Avoid a lot of copy'n'paste code, no functionality change Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2015-12-22Use gcc's __builtin_mempcpy() as __mempcpy(), if possibleWaldemar Brodkorb
Patch from OpenWrt. Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2015-12-22use arch specific thread stack size for nptlWaldemar Brodkorb
Use the arch specific thread stack size for nptl if the size returned by getrlimits exceeds it - fixes threads on systems with only 16 MB RAM. Patch from OpenWRT Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>