OSDN Git Service

uclinux-h8/uclibc-ng.git
8 years agonew test is only for MALLOC_STANDARD
Waldemar Brodkorb [Wed, 9 Dec 2015 06:35:28 +0000 (07:35 +0100)]
new test is only for MALLOC_STANDARD

8 years agobsd supports the same floating point classification functions as c99
Waldemar Brodkorb [Sun, 6 Dec 2015 17:09:10 +0000 (18:09 +0100)]
bsd supports the same floating point classification functions as c99

Fixes inetd compile. From OpenWrt.

Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
8 years agoReduce the initial buffer size for open_memstream
Waldemar Brodkorb [Sun, 6 Dec 2015 17:05:32 +0000 (18:05 +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@openwrt.org>
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
8 years agoDefine __attribute_const__
Waldemar Brodkorb [Sun, 6 Dec 2015 16:59:04 +0000 (17:59 +0100)]
Define __attribute_const__

Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
8 years agoDo not support localised optimizations this helps to have a global -O level
Khem Raj [Mon, 17 Aug 2015 03:58:59 +0000 (20:58 -0700)]
Do not support localised optimizations this helps to have a global -O level

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
8 years agoAvoid unnecessary rebuilds due to compiler flag changes
Waldemar Brodkorb [Sun, 6 Dec 2015 16:53:50 +0000 (17:53 +0100)]
Avoid unnecessary rebuilds due to compiler flag changes

Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
8 years agosync with glibc, add some missing defines
Waldemar Brodkorb [Tue, 8 Dec 2015 17:30:57 +0000 (18:30 +0100)]
sync with glibc, add some missing defines

These are already used by some applications, so add it.

8 years agoadd definitions for O_PATH
Waldemar Brodkorb [Mon, 7 Dec 2015 19:20:56 +0000 (20:20 +0100)]
add definitions for O_PATH

Only alpha, hppa and sparc need non-default value.

8 years agosh: add back sh2 specific assembly for clone()
Waldemar Brodkorb [Mon, 7 Dec 2015 06:42:25 +0000 (07:42 +0100)]
sh: add back sh2 specific assembly for clone()

In gcc 5.x there is a compile failure, for sh2 builds
as shad no longer is accepted. Strange that it is working for
4.9.x. Add back old assembly code.

8 years agoallow linuxthreads for superh (sh2 noMMU)
Waldemar Brodkorb [Mon, 7 Dec 2015 06:42:08 +0000 (07:42 +0100)]
allow linuxthreads for superh (sh2 noMMU)

8 years agomips: fix definition.
Steve Ellcey [Wed, 7 May 2014 20:10:48 +0000 (13:10 -0700)]
mips: fix definition.

glibc [BZ# 16922]

* sysdeps/mips/sys/asm.h (INT_SUB): Fix definition.
(LONG_SUB): Ditto.
(PTR_SUB): Ditto.

glibc commit 5057ad3b50

Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
8 years agoremove __UCLIBC_ASM_GLOBAL_DIRECTIVE__
Waldemar Brodkorb [Sat, 5 Dec 2015 19:52:47 +0000 (20:52 +0100)]
remove __UCLIBC_ASM_GLOBAL_DIRECTIVE__

.globl can be used for every architecture so remove the define.
Sync with GNU C library.

8 years agoremove __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
Waldemar Brodkorb [Sat, 5 Dec 2015 07:10:51 +0000 (08:10 +0100)]
remove __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__

It's even no longer required for non-ported ppc64
architecture. Sync with GNU C library.
This simplify the macros in include/libc-symbols.h.

8 years agobfin: fix clashing with newer gcc
Waldemar Brodkorb [Mon, 30 Nov 2015 17:32:12 +0000 (18:32 +0100)]
bfin: fix clashing with newer gcc

See here for a discussion about the problem:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47779

Latest gcc/binutils git can generate a working uClibc-ng
toolchain. Binaries tested on Arcturus uCBF54x board via
chroot from original firmware.

8 years agobfin: use vfork.S again
Waldemar Brodkorb [Mon, 30 Nov 2015 17:31:53 +0000 (18:31 +0100)]
bfin: use vfork.S again

Actually revert 711ad9f92c1cf992c4a3d9f4f709bd692be7789c, as
it breaks vfork() on real hardware. So the common
implementation no longer works for bfin.

8 years agoxtensa: avoid some compiler warnings
Waldemar Brodkorb [Tue, 24 Nov 2015 21:07:16 +0000 (22:07 +0100)]
xtensa: avoid some compiler warnings

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
8 years agoxtensa: remove ldso workaround by real pointer check
Waldemar Brodkorb [Mon, 23 Nov 2015 18:07:31 +0000 (19:07 +0100)]
xtensa: remove ldso workaround by real pointer check

An abort() is only generated when gcc does not implement
a trap handler for the target architecture.
This fixes the abort() generation. Latest gcc git master
also contains a trap handler for xtensa.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Walemar Brodkorb <wbx@uclibc-ng.org>
8 years agomips: remove ISA choice
Waldemar Brodkorb [Fri, 13 Nov 2015 17:56:50 +0000 (18:56 +0100)]
mips: remove ISA choice

We don't add cpu specific CFLAGS to the build, so the
ISA config symbols for MIPS are noops.
Simple remove them.

Reported-By: Bryan Hundven <bryanhundven@gmail.com>
8 years agometag: add missing header file
Waldemar Brodkorb [Fri, 13 Nov 2015 05:37:45 +0000 (06:37 +0100)]
metag: add missing header file

When installing header files a warning is generated, because
the header is mandatory.

8 years agotests/tls: Implement TLS macros for metag
James Hogan [Wed, 11 Nov 2015 11:17:37 +0000 (11:17 +0000)]
tests/tls: Implement TLS macros for metag

Implement the TLS macros in tls-macros.h for metag.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
8 years agoi386: use socketcall even if newer linux exposes direct syscalls
Waldemar Brodkorb [Fri, 13 Nov 2015 05:13:42 +0000 (06:13 +0100)]
i386: use socketcall even if newer linux exposes direct syscalls

The changeset 9dea5dc921b5f4045a18c63eb92e84dc274d17eb in the Linux kernel
expose the direct syscalls for sockets. For example udhcpc then will use sendto
syscall directly and get an EINVAL error. Disable direct syscalls as it was done
for SPARC in the past. Musl and GNU libc are not affected, as they already
disable direct socket syscalls on i386.

Reported-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
8 years agoh8300: do not use LDFLAGS, they are wrong. testsuite compile fails with it
Waldemar Brodkorb [Wed, 11 Nov 2015 05:35:07 +0000 (06:35 +0100)]
h8300: do not use LDFLAGS, they are wrong. testsuite compile fails with it

8 years agoh8300: disable test using mprotect(), not available for h8300
Waldemar Brodkorb [Wed, 11 Nov 2015 05:34:08 +0000 (06:34 +0100)]
h8300: disable test using mprotect(), not available for h8300

8 years agoreduce timeoutfactor, fasten test runs!
Waldemar Brodkorb [Wed, 11 Nov 2015 05:33:39 +0000 (06:33 +0100)]
reduce timeoutfactor, fasten test runs!

8 years agofanotify: include needed Linux definitions
Waldemar Brodkorb [Sun, 8 Nov 2015 19:41:42 +0000 (20:41 +0100)]
fanotify: include needed Linux definitions

To support older Linux kernel f.e. 2.6.32.68 include all
required definitions. Copied from musl libc fanotify.h.

Reported by Thomas Petazzoni from Buildroot project.

8 years agoadd support for euidaccess/eaccess legacy functions
Waldemar Brodkorb [Sun, 8 Nov 2015 19:38:23 +0000 (20:38 +0100)]
add support for euidaccess/eaccess legacy functions

Implementation taken from musl libc project.
Missing functions recognized by buildroot autobuilders
with failing open-vm-tools.

8 years agounistd: fix #if condition
Thomas Petazzoni [Tue, 3 Nov 2015 14:57:41 +0000 (15:57 +0100)]
unistd: fix #if condition

Commit dfa593d4d881116723a4401b466ea964fb12327b ("syncfs: add system
call support") modified the #if condition around the definition of the
syncfs() prototype in a way that doesn't build, causing build failures
of any file including <unistd.h>:

output/host/usr/powerpc-buildroot-linux-uclibc/sysroot/usr/include/unistd.h:988:14: error: #if with no expression
 #if __USE_GNU

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reported-by: Xi-Sheng Luo <lxsjason@gmail.com>
8 years agosh4a: allow to build a sh4a toolchain
Waldemar Brodkorb [Mon, 2 Nov 2015 06:04:36 +0000 (07:04 +0100)]
sh4a: allow to build a sh4a toolchain

Add correct compiler settings.

8 years agoh8300: fix compile with 4.2.x kernel
Waldemar Brodkorb [Wed, 28 Oct 2015 21:10:09 +0000 (22:10 +0100)]
h8300: fix compile with 4.2.x kernel

8 years agoARC: With NPTL support, GP is no longer used for PIC
Vineet Gupta [Wed, 21 Oct 2015 07:12:25 +0000 (12:42 +0530)]
ARC: With NPTL support, GP is no longer used for PIC

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
8 years agoNPTL/ARC: fix __lll_lock_wait_private redefinition for static links
Vineet Gupta [Wed, 21 Oct 2015 07:12:24 +0000 (12:42 +0530)]
NPTL/ARC: fix __lll_lock_wait_private redefinition for static links

Commit 2d9740a65a "uclibc: nptl: fix __lll_lock_wait_private multiple definition"
did a sweeping change which did for all in tree arches at that time (ARC
wasn't)

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
8 years agoNPTL/ARCv2: Implement full memory barrier for NPTL
Vineet Gupta [Wed, 21 Oct 2015 07:12:23 +0000 (12:42 +0530)]
NPTL/ARCv2: Implement full memory barrier for NPTL

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
8 years agoalpha: add special umount2 handling
Waldemar Brodkorb [Thu, 22 Oct 2015 01:48:09 +0000 (03:48 +0200)]
alpha: add special umount2 handling

Only on Linux alpha __NR_oldumount is defined and a umount not
umount2 syscall, but with two parameter is used.
Add special handling for it and an alias for umount2() users.

There was a discussion about this special handling, but it seems
it was never committed upstream:
http://marc.info/?l=linux-alpha&m=137455037930738&w=2

Runtime tested with qemu-alpha and a statically linked busybox
binary.

8 years agoalpha: fix kernel_stat struct
Waldemar Brodkorb [Thu, 22 Oct 2015 01:47:43 +0000 (03:47 +0200)]
alpha: fix kernel_stat struct

8 years agoalpha: fix header name
Waldemar Brodkorb [Thu, 22 Oct 2015 01:47:13 +0000 (03:47 +0200)]
alpha: fix header name

8 years agoconfdata: fix invalid write
Ben Boeckel [Sat, 17 Oct 2015 15:58:44 +0000 (11:58 -0400)]
confdata: fix invalid write

stndup will copy *up to* the size parameter, not allocate a buffer of
that size, so the buffer is not necessarily large enough to fit the
".old" extension.

Caught with glibc's MALLOC_CHECK_=3.

Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
8 years agocleanup special purpose warnings
Waldemar Brodkorb [Sun, 18 Oct 2015 23:38:29 +0000 (01:38 +0200)]
cleanup special purpose warnings

8 years agomips: sync header with glibc
Waldemar Brodkorb [Sun, 18 Oct 2015 23:32:48 +0000 (01:32 +0200)]
mips: sync header with glibc

Fixes following compile error, when UCLIBC_HAS_CONTEXT_FUNCS is enabled
on a mips64 build:

  CC libc/sysdeps/linux/common/_exit.os
libc/sysdeps/linux/mips/swapcontext.S: Assembler messages:
libc/sysdeps/linux/mips/swapcontext.S:110: Error: Illegal operands `s.d fs6,(30*8+296)($4)'
libc/sysdeps/linux/mips/swapcontext.S:111: Error: Illegal operands `s.d fs7,(31*8+296)($4)'
libc/sysdeps/linux/mips/swapcontext.S:149: Error: Illegal operands `l.d fs6,(30*8+296)($2)'
libc/sysdeps/linux/mips/swapcontext.S:150: Error: Illegal operands `l.d fs7,(31*8+296)($2)'

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8 years agolm32: add new architecture
Waldemar Brodkorb [Sat, 17 Oct 2015 09:17:07 +0000 (11:17 +0200)]
lm32: add new architecture

Add support for FPGA systems from Lattice Semiconductor
http://www.latticesemi.com
Merge https://github.com/m-labs/uclibc-lm32.git

8 years agoia64: enable and fix compile issues
Waldemar Brodkorb [Fri, 16 Oct 2015 17:25:44 +0000 (19:25 +0200)]
ia64: enable and fix compile issues

Enable ia64 in the menu.
Fix build for architectures withou ld.so support.
Fix syntax error in bits/byteswap.h.

8 years agosyncfs: add system call support
Bartosz Golaszewski [Wed, 14 Oct 2015 15:14:01 +0000 (17:14 +0200)]
syncfs: add system call support

Add support for the syncfs() system call.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agofanotify: add system call support
Bartosz Golaszewski [Wed, 14 Oct 2015 15:14:00 +0000 (17:14 +0200)]
fanotify: add system call support

Add support for fanotify_init() and fanotify_mark() syscalls. The header
file is taken from glibc.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
8 years agofix static binaries linked with pthread and compiled with ssp
Waldemar Brodkorb [Mon, 12 Oct 2015 14:21:54 +0000 (16:21 +0200)]
fix static binaries linked with pthread and compiled with ssp

Move TLS initialization for static builds up to the calling
function as suggested by Daniel Fahlgren.

Reported-By: Daniel Fahlgren <daniel@fahlgren.se>
8 years agorestrict linuxthreads/nptl choice
Waldemar Brodkorb [Fri, 9 Oct 2015 04:30:14 +0000 (06:30 +0200)]
restrict linuxthreads/nptl choice

For architectures supporting no MMU systems, allow to use
Linuxthreads. BFLAT does not support TLS right now, so NPTL
can not be used.

8 years agoxtensa: support call0 ABI
Max Filippov [Tue, 15 Sep 2015 22:49:49 +0000 (01:49 +0300)]
xtensa: support call0 ABI

Most changes are mechanical replacement of 'retw' instruction with
'abi_ret' macro, defined to 'retw' or 'ret' according to ABI.
Assembly code that makes calls is duplicated for call0 ABI with changed
register numbers for parameters/return value and call instruction.
'entry' instructions are replaced with 'abi_entry' macro.

More interesting changes:
- non-leaf assembly functions (e.g. _dl_tlsdesc_dynamic,
  _dl_linux_resolve, SYSCALL_ERROR_HANDLER, PSEUDO) now need to preserve
  registers around intermediate calls they make, use temporary stack
  frame for that;
- setjmp/longjmp only need to save and restore return address, stack
  pointer and callee-saved registers in the jmpbuf;
- __clone and syscall functions had hardcoded offsets to parameter
  passed on stack, on call0 ABI they don't need stack frame, so the
  offset is different. Replace these offsets with FRAMESIZE macro.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
8 years agolibc: posix_fallocate must return an error number on failure
Yuriy Kolerov [Wed, 23 Sep 2015 12:43:39 +0000 (15:43 +0300)]
libc: posix_fallocate must return an error number on failure

posix_fallocate implementation in uClibc relies on fallocate
system call - it just returns what fallocate returns. However
fallocate returns -1 on failure and assigns an error number
to errno variable. In the same time posix_fallocate must
return an error number but not -1.

What does this patch: if fallocate returns -1 then posix_fallocate
returns errno. Otherwise posix_fallocate returns 0 on success.

However there is a side effect - posix_fallocate sets errno on
failure because fallocate does it. But POSIX does not forbid it
thus it's not a problem.

Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
8 years agolibc: fix sign extension in fallocate()
Yuriy Kolerov [Wed, 23 Sep 2015 12:43:38 +0000 (15:43 +0300)]
libc: fix sign extension in fallocate()

For common generic syscall ABI fallocate syscall handler in kernel
expects a 64-bit signed arguments for offset and len. However uClibc
has 2 wrappers for this syscall: fallocate and fallocate64.

On 32-bit machines fallocate (not fallocate64) expects 32-bit values of
offset and len. Thus in this case uClibc's fallocate must pass to the
syscall those values with sign extension. High word of 64-bit value must
be 0 or 0xFFFFFFFF depending on sign of the original 32-bit value (offset
or len). It is how sign extansion works - all high bits of the negative
value must be 1.

So on 32-bit machines uClibc's fallocate does sign extension incorrectly
when 32-bit values are passed (offset or len). It just fills the second
word of 64-bit value by zeros. E.g. fallocate works incorrectly when offset
or length is negative value - in this case kernel thinks that positive
values are passed.

Solution is to call fallocate64 from fallocate and pass 32-bit values of
offset and len to fallocate64. off_t type is automatically converted to
off64_t with an appropriate sign extension. Then fallocate64 invokes
kernel's system call properly.

This error is detected in LTP's test kernel/syscalls/fallocate02:

    ----------->8----------
    fallocate(..., 1, -1024, 1024) failed, expected errno:22: TEST_ERRNO=0
    fallocate(..., 1, 1024, -1024) failed, expected errno:22: TEST_ERRNO=0
    fallocate(..., 1, 12288, -1024) failed, expected errno:22: TEST_ERRNO=0
    fallocate(..., 1, -24576, 1024) failed, expected errno:22: TEST_ERRNO=0
    ----------->8----------

fallocate does not emit an error because negative values are passed to the
kernel without sign extension and kernel thinks that it got valid positive
values.

Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
8 years agolibc: fix setting return value and errno in fallocate()
Yuriy Kolerov [Wed, 23 Sep 2015 12:43:37 +0000 (15:43 +0300)]
libc: fix setting return value and errno in fallocate()

fallocate system call must return 0 on success. On error, -1 is returned
and errno is set to indicate the error.

However there is an error in fallocate which is fixed by this patch - it
does not set errno and returns invalid value on error (it returns error
code instead of -1).

This error is detected in LTP's test kernel/syscalls/fallocate02:

    ----------->8----------
    fallocate(..., 1, 0, 1024) failed, expected errno:9: TEST_ERRNO=0
    fallocate(..., 1, -1024, 1024) failed, expected errno:22: TEST_ERRNO=0
    fallocate(..., 1, 1024, -1024) failed, expected errno:22: TEST_ERRNO=0
    fallocate(..., 1, 12288, 0) failed, expected errno:22: TEST_ERRNO=0
    fallocate(..., 1, 12288, -1024) failed, expected errno:22: TEST_ERRNO=0
    fallocate(..., 1, -24576, 1024) failed, expected errno:22: TEST_ERRNO=0
    ----------->8----------

Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
8 years agoadd new architecture support for or1k
Waldemar Brodkorb [Thu, 8 Oct 2015 18:28:39 +0000 (20:28 +0200)]
add new architecture support for or1k

Information about Openrisc:
http://opencores.org/or1k/Main_Page
Integrated from:
https://github.com/openrisc/uClibc-or1k

8 years agoNPTL: fix CFLAGS for cancellation points
Max Filippov [Tue, 15 Sep 2015 03:18:38 +0000 (06:18 +0300)]
NPTL: fix CFLAGS for cancellation points

Stack unwinding that happens during NPTL thread cancellation needs
cancellable syscall wrapper functions to be compiled with -fexceptions
-fasynchronous-unwind-tables to be able to unwind to cleanup handlers
registered before syscall invocation.

Add these flags for all cancellable syscall wrappers.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
8 years agoRevert "tgmath.h: disable builtins"
Waldemar Brodkorb [Fri, 11 Sep 2015 11:34:14 +0000 (13:34 +0200)]
Revert "tgmath.h: disable builtins"

This reverts commit d1671548b968103f4df1b80659e60ae1fc5a67b3.

You get following errors while compiling freeswitch:
awgn.c: In function 'awgn_init_dbov':                                                                                   awgn.c:110:5: error: void value not ignored as it ought to be                                                                s->rms = pow(10.0, level/20.0)*32768.0;

Reverting this commit allows to build the code.

8 years agotst-mkostemps: fix test case on read-only root filesystem
Waldemar Brodkorb [Sun, 30 Aug 2015 04:50:59 +0000 (06:50 +0200)]
tst-mkostemps: fix test case on read-only root filesystem

Better use /tmp as embedded systems might have a read-only root.
Fix two wrong asserts.

8 years agoldso: install backward compatibility symlink by default
Waldemar Brodkorb [Sat, 22 Aug 2015 18:40:42 +0000 (20:40 +0200)]
ldso: install backward compatibility symlink by default

Simplify the switch from uClibc to uClibc-ng suggested
by Alexey Brodkin <Alexey.Brodkin@synopsys.com>.
Gcc always uses .0 ld.so link, so install it by default.

8 years agoquieten compile warnings
Waldemar Brodkorb [Sat, 22 Aug 2015 18:41:31 +0000 (20:41 +0200)]
quieten compile warnings

Sync with glibc, quietens gcc warnings.

8 years agoadd tests for mkostemps()
Romain Naour [Sat, 22 Aug 2015 19:08:36 +0000 (21:08 +0200)]
add tests for mkostemps()

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
8 years agonptl_db/db_info: fix the incorrect initial size for dtvp
Junling Zheng [Mon, 20 Jul 2015 13:33:57 +0000 (13:33 +0000)]
nptl_db/db_info: fix the incorrect initial size for dtvp

When debugging a program on ARMv7 with thread-local storage declared using
"__thread", attempting to print a thread-local variable will result in the
following message:

Cannot find thread-local storage for Thread <snip> (LWP <snip>), executable
file /tmp/tls: capability not available

This can be traced back to uclibc libpthread/nptl_db/td_thr_tls_get_addr.c
which gdb uses to look up the address of the TLS. The function returns
TD_NOCAPAB due to a mismatch in size between the DTV pointer and the size
recorded in the db description. The problem lies in libpthread/nptl_db/db_info.c
which initializes the db with the sizeof the union dtv. Instead it should
be the sizeof a pointer to union dtv.

Fixed the initial size for dtvp to sizeof a pointer, instead of sizeof
the union.

Refer to:
http://sourceware.org/ml/libc-alpha/2006-10/msg00088.html
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=416b630981788c1f08e746e19765aa0e5c2a1360

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
8 years agoRevert "ldso: install backward compatibility symlink by default"
Waldemar Brodkorb [Wed, 19 Aug 2015 00:18:24 +0000 (02:18 +0200)]
Revert "ldso: install backward compatibility symlink by default"

This reverts commit 9b9abfbd25d5f95010241bdd72941dafecd56b0e.

Totally wrong patch. sorry.

8 years agoldso: install backward compatibility symlink by default
Waldemar Brodkorb [Fri, 14 Aug 2015 22:23:19 +0000 (00:23 +0200)]
ldso: install backward compatibility symlink by default

Simplify the switch from uClibc to uClibc-ng suggested
by Alexey Brodkin <Alexey.Brodkin@synopsys.com>.
Gcc always uses .0 ld.so link, so install it by default.

8 years agoadd mkstemps, mkstemps64 and mkostemps, mkostemps64 functions
Romain Naour [Sat, 1 Aug 2015 16:31:06 +0000 (18:31 +0200)]
add mkstemps, mkstemps64 and mkostemps, mkostemps64 functions

Change __gen_tempname() prototype in order to pass the additional
suffix lenght. In __gen_tempname() add a new check for suffixlen.
Update some comments in the code.

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
8 years agoglibc compat: bump glibc minor version
Waldemar Brodkorb [Mon, 10 Aug 2015 19:41:27 +0000 (21:41 +0200)]
glibc compat: bump glibc minor version

See this discussion:
http://lists.busybox.net/pipermail/buildroot/2015-August/137229.html

Should help to fix compile issues with boost for ARC.

8 years agogetenv: allow overwriting of function
Waldemar Brodkorb [Mon, 10 Aug 2015 19:39:01 +0000 (21:39 +0200)]
getenv: allow overwriting of function

This fixes static compile issues of sudo, because sudo
uses it's own getenv implementation.

8 years agosh: fix static linking issue
Waldemar Brodkorb [Wed, 29 Jul 2015 19:06:54 +0000 (21:06 +0200)]
sh: fix static linking issue

8 years agosimplify, as the other does not work correctly, suggested by tg
Waldemar Brodkorb [Sat, 25 Jul 2015 17:42:41 +0000 (19:42 +0200)]
simplify, as the other does not work correctly, suggested by tg

8 years agofix inline asm changing the stack pointer leading to segfaults problem
mirabilos [Sat, 25 Jul 2015 16:51:26 +0000 (18:51 +0200)]
fix inline asm changing the stack pointer leading to segfaults problem

8 years agofix MIPS N32 ABI Big Endian setjmp/longjmp
mirabilos [Fri, 24 Jul 2015 22:37:44 +0000 (00:37 +0200)]
fix MIPS N32 ABI Big Endian setjmp/longjmp

access to the jmp_buf structure occasionally happens asymmetrically:
fields defined in pointer size width (64 on N32) can be accessed as
32-bit words, but in that case, a̲l̲l̲ involved code must agree on that…

8 years agointegrate old m68k vfork bugfix of pre-µClibc-ng tree
mirabilos [Fri, 24 Jul 2015 20:18:07 +0000 (22:18 +0200)]
integrate old m68k vfork bugfix of pre-µClibc-ng tree

8 years agofix static builds of pthread apps for x86/x86_64
Waldemar Brodkorb [Wed, 22 Jul 2015 12:54:07 +0000 (14:54 +0200)]
fix static builds of pthread apps for x86/x86_64

Found via buildroot autobuilder.

8 years agoARCv2: update memset() so it could be used without double load/stores
Claudiu Zissulescu [Mon, 20 Jul 2015 14:12:32 +0000 (17:12 +0300)]
ARCv2: update memset() so it could be used without double load/stores

Existing version of memset() relies on existence of 64-bit load/stores.
While ARC HS38 may not have those instructions implemented in SoC.

Proposed implementation checks if "-mno-ll64" option was passed to gcc
(for ARCv2 "-mll64" is set implicitly by default) by checking __LL64__
definition and if it is not defined uses 32-bit load/stores.

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
8 years agotst-sscanf: fix linking for m68k
Waldemar Brodkorb [Sat, 11 Jul 2015 08:50:59 +0000 (10:50 +0200)]
tst-sscanf: fix linking for m68k

8 years agobuiltin_unreachable is not available for older gcc
Waldemar Brodkorb [Thu, 9 Jul 2015 02:51:48 +0000 (21:51 -0500)]
builtin_unreachable is not available for older gcc

8 years agofix parallel build issue when LOCALES are enabled
Waldemar Brodkorb [Sun, 5 Jul 2015 13:33:06 +0000 (15:33 +0200)]
fix parallel build issue when LOCALES are enabled

8 years agotest/tls: xtensa: fix TLS_LD definition
Max Filippov [Fri, 3 Jul 2015 16:51:25 +0000 (19:51 +0300)]
test/tls: xtensa: fix TLS_LD definition

TLS_LD should use linker-provided symbol _TLS_MODULE_BASE_ instead of
symbol it resolves to get thread pointer, otherwise linker relaxation
doesn't work correctly, adding extra offset to thread-local variable
address.

This fixes most of tls/tst-tls* tests.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
8 years agoNPTL/arc: notify kernel of the TP value
Vineet Gupta [Tue, 30 Jun 2015 12:16:56 +0000 (17:46 +0530)]
NPTL/arc: notify kernel of the TP value

Native gdb makes a ptrace (GET_THREAD_AREA) which needs to return the
TP. however when libc sets up TP reg (for main thread), it doesn't call
arc_settls syscall so kernel doesn't know of TP register details
(moreso because clone doesnt have SETTLS flag)

Note that kernel doesn't know about r25 being TP etc.

This commit got lost in merge of NPTL tools into arc-mainline-dev and
showed up again as STAR 9000919529 (native gdb can't debug threaded
apps)

------->8---------------
[ARCLinux]# gdb ./pth
Reading symbols from ./pth...(no debugging symbols found)...done.
(gdb) b main
Breakpoint 1 at 0x106f2
(gdb) r
Starting program: /pth
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
thread_get_info_callback: cannot get thread info: generic error
(gdb) q
------->8---------------
Debugged-by: Anton Kolesov <akolesov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
8 years agouse common ptrace.h for xtensa, fixes buildroot issues compiling enlightment
Waldemar Brodkorb [Wed, 10 Jun 2015 15:17:11 +0000 (10:17 -0500)]
use common ptrace.h for xtensa, fixes buildroot issues compiling enlightment

8 years agouse mktemp, otherwise test is failing. reverts partially 7c721d31e4b7a0bdf6f803b8e7c3...
Waldemar Brodkorb [Wed, 10 Jun 2015 15:16:24 +0000 (10:16 -0500)]
use mktemp, otherwise test is failing. reverts partially 7c721d31e4b7a0bdf6f803b8e7c38996bf60b59f

8 years agomips64: patches from OpenWrt
Waldemar Brodkorb [Wed, 24 Jun 2015 20:54:28 +0000 (15:54 -0500)]
mips64: patches from OpenWrt

Add these changes to get mips64 with n32 ABI working.

8 years agoxtensa: fix stack frame size for NPTL
Max Filippov [Mon, 22 Jun 2015 01:10:55 +0000 (04:10 +0300)]
xtensa: fix stack frame size for NPTL

Cancellable syscalls use call8 to call functions that enable/disable
cancellation, thus they cannot use the default FRAMESIZE.
Redefine FRAMESIZE for such syscalls.

This fixes the following testsuite failure:

  .... tst-mqueue8
  FAIL tst-mqueue8 got 1 expected 0
   going to cancel mq_receive in-time
   in-time mq_receive cancellation succeeded
   going to cancel mq_receive early
   Didn't expect signal from child: got `Segmentation fault'

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
8 years agoxtensa: add ret_ERRVAL definition
Max Filippov [Mon, 22 Jun 2015 01:10:54 +0000 (04:10 +0300)]
xtensa: add ret_ERRVAL definition

ret_ERRVAL is used by mq_timedsend and mq_timedreceive, it needs to be
defined to retw, otherwise error return from those functions segfaults.

This fixes the following testsuite failures:

  .... tst-mqueue1
  FAIL tst-mqueue1 got 1 expected 0
   Didn't expect signal from child: got `Segmentation fault'
  .... tst-mqueue2
  FAIL tst-mqueue2 got 1 expected 0
   Didn't expect signal from child: got `Segmentation fault'
  .... tst-mqueue3
  FAIL tst-mqueue3 got 1 expected 0
   Didn't expect signal from child: got `Segmentation fault'
  .... tst-mqueue4
  FAIL tst-mqueue4 got 1 expected 0
   Didn't expect signal from child: got `Segmentation fault'
  .... tst-mqueue5
  FAIL tst-mqueue5 got 1 expected 0
   Didn't expect signal from child: got `Segmentation fault'
  .... tst-mqueue6
  FAIL tst-mqueue6 got 1 expected 0
   Didn't expect signal from child: got `Segmentation fault'

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
8 years agoadd patch from ldso-future branch
Waldemar Brodkorb [Tue, 23 Jun 2015 19:18:49 +0000 (21:18 +0200)]
add patch from ldso-future branch

Fixes segfaults when gcc 5.1 is used for x86.
http://git.uclibc.org/uClibc/commit/ldso/ldso/i386/dl-sysdep.h?h=ldso-future&id=7de778389d0040be4a21ffc326310e0eb361570a

Mentioned in #uclibc.

8 years agoFix libgcc_s_resume issue with gcc 5.1
Thomas Petazzoni [Wed, 17 Jun 2015 20:52:22 +0000 (22:52 +0200)]
Fix libgcc_s_resume issue with gcc 5.1

When built with gcc 5.1, uClibc-ng fails to build with the following
issue:

   librt/librt_so.a(rt-unwind-resume.oS): In function `_Unwind_Resume':
   rt-unwind-resume.c:(.text+0x3c): undefined reference to

This commit fixes the code in a way similar to what was done in glibc
in commit:

   https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=175cef4163dd60f95106cfd5f593b8a4e09d02c9

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8 years agofix some type differences to linux-next for h8/300
Waldemar Brodkorb [Sat, 13 Jun 2015 18:08:11 +0000 (13:08 -0500)]
fix some type differences to linux-next for h8/300

8 years agoallow endian choice for microblaze biendian architecture
Waldemar Brodkorb [Wed, 10 Jun 2015 13:14:11 +0000 (08:14 -0500)]
allow endian choice for microblaze biendian architecture

8 years agodisable for sparc/mips, need to analyze later
Waldemar Brodkorb [Mon, 8 Jun 2015 17:42:47 +0000 (12:42 -0500)]
disable for sparc/mips, need to analyze later

8 years agoavoid some compiler warnings
Waldemar Brodkorb [Sun, 7 Jun 2015 18:29:33 +0000 (13:29 -0500)]
avoid some compiler warnings

Patch seen here:
http://lists.uclibc.org/pipermail/uclibc/2015-April/048892.html

8 years agojust use 4k pages for microblaze, the config are missing and never committed into...
Waldemar Brodkorb [Sun, 7 Jun 2015 18:15:59 +0000 (13:15 -0500)]
just use 4k pages for microblaze, the config are missing and never committed into uClibc

8 years agoh8300 has no NPTL
Waldemar Brodkorb [Sun, 7 Jun 2015 07:32:35 +0000 (02:32 -0500)]
h8300 has no NPTL

8 years agodisable not available CFLAGS for h8300
Waldemar Brodkorb [Sun, 7 Jun 2015 07:30:16 +0000 (02:30 -0500)]
disable not available CFLAGS for h8300

8 years agoresolve merge conflicts
Waldemar Brodkorb [Thu, 4 Jun 2015 21:54:18 +0000 (16:54 -0500)]
resolve merge conflicts

8 years agouse static directories
Waldemar Brodkorb [Sat, 30 May 2015 08:23:46 +0000 (03:23 -0500)]
use static directories

The list might not exist on target when cross-compiling.

8 years agogetconf.c: undef VERSION
Bernhard Reutner-Fischer [Thu, 28 May 2015 15:05:43 +0000 (17:05 +0200)]
getconf.c: undef VERSION

might come in via nptl so undef it before redefining it

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
8 years agoARC: enable IPv6 in defconfigs
Alexey Brodkin [Mon, 25 May 2015 10:50:42 +0000 (13:50 +0300)]
ARC: enable IPv6 in defconfigs

These days IPv6 is used more and more in different software
packages. And so we're adding IPv6 support by default in uClibc
for ARC cores.

Signed-off-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
8 years agoh8300: Makefile update
Yoshinori Sato [Sat, 23 May 2015 17:06:27 +0000 (02:06 +0900)]
h8300: Makefile update

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
8 years agoh8300: Add new feature
Yoshinori Sato [Sat, 23 May 2015 17:06:26 +0000 (02:06 +0900)]
h8300: Add new feature

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
8 years agoh8300: headers update
Yoshinori Sato [Sat, 23 May 2015 17:06:25 +0000 (02:06 +0900)]
h8300: headers update

- wire up new kernel

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
8 years agoh8300: Assembly functions
Yoshinori Sato [Sat, 23 May 2015 17:06:24 +0000 (02:06 +0900)]
h8300: Assembly functions

- remove symbol prefix
- new startup
- new clone syscall support

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
8 years agoh8300: 64bit integer support
Yoshinori Sato [Sat, 23 May 2015 17:06:23 +0000 (02:06 +0900)]
h8300: 64bit integer support

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
8 years agoh8300: config update
Yoshinori Sato [Sat, 23 May 2015 17:06:22 +0000 (02:06 +0900)]
h8300: config update

- New toolchain
- Add new flags

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
8 years agoimplement experimental pure-sh testsuite runner and generation
mirabilos [Sun, 24 May 2015 17:21:54 +0000 (19:21 +0200)]
implement experimental pure-sh testsuite runner and generation

8 years agoadd thanks file
Waldemar Brodkorb [Thu, 21 May 2015 19:38:31 +0000 (21:38 +0200)]
add thanks file

9 years agosiginfo: add signal info for seccomp related SIGSYS
Daniel Golle [Sun, 17 May 2015 20:49:23 +0000 (22:49 +0200)]
siginfo: add signal info for seccomp related SIGSYS

uClibc doesn't define signal info for the SIGSYS signal which is issued
in case of hitting a syscall prohibited by seccomp.
This is sad as it makes debugging seccomp filter policies impossible on
some architectures (at least ARM and PowerPC, maybe also others) which
do not coincidentally set si_value.sival_int as the syscall number.

To fix this, import the definitions and macros needed from glibc.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>