OSDN Git Service

uclinux-h8/uClibc.git
9 years agomkostemp: fix implementation master
Anthony G. Basile [Mon, 27 Oct 2014 20:13:34 +0000 (16:13 -0400)]
mkostemp: fix implementation

mkostemp(char *template, int flags) generates a unique temporary
filename from a template.  The flags parameter accepts three of
the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC.  The
current implementation of mkostemp(3) does not respect the flags
and in fact confuses the flags with the file mode which should
always be S_IRUSR | S_IWUSR.  This patch corrects this issue.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: Some more tests under conditionals
Bernhard Reutner-Fischer [Mon, 15 Dec 2014 16:32:57 +0000 (17:32 +0100)]
test: Some more tests under conditionals

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agostdio: Fix printing 0.0
Bernhard Reutner-Fischer [Mon, 15 Dec 2014 15:13:01 +0000 (16:13 +0100)]
stdio: Fix printing 0.0

We were relying on FE_DIVBYZERO being turned off when printing
"%f", +-.0
Avoid the whole issue by looking at the sign-bit (in a rough
approximation).

Note that we do not handle gracefully:
  printf ("\n%llf\n", -0.0);
  printf ("\n%llf\n",  0.0);
nor %Lf for both when NOT cast to long double. Avoiding an FPE due to
broken numbers like these does not make sense to me.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agounistd: allow to turn off getopt_long
Bernhard Reutner-Fischer [Fri, 12 Dec 2014 15:18:12 +0000 (16:18 +0100)]
unistd: allow to turn off getopt_long

The GNU variant of getopt() previously had no way to turn off
getopt_long() support.

9 years agotest: disable ptytest unless HAS_PTY
Bernhard Reutner-Fischer [Fri, 12 Dec 2014 15:06:17 +0000 (16:06 +0100)]
test: disable ptytest unless HAS_PTY

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoconfig: move STDIO_FUTEXES up a bit
Bernhard Reutner-Fischer [Fri, 12 Dec 2014 13:43:55 +0000 (14:43 +0100)]
config: move STDIO_FUTEXES up a bit

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agosigaction: Fix !HAS_REALTIME compilation
Bernhard Reutner-Fischer [Tue, 9 Dec 2014 13:30:39 +0000 (14:30 +0100)]
sigaction: Fix !HAS_REALTIME compilation

In file included from ./include/signal.h:279:0,
 from libc/sysdeps/linux/x86_64/sigaction.c:22:
./include/bits/sigaction.h:32:29: error: unknown type name 'siginfo_t'
   void (*sa_sigaction)(int, siginfo_t *, void *);

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agomips: rename siginfo _timer members
Bernhard Reutner-Fischer [Wed, 3 Dec 2014 16:43:25 +0000 (17:43 +0100)]
mips: rename siginfo _timer members

Rename _timer[12] to si_tid and si_overrun to fix compilation of
strace-4.9+

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: remove some obsolete optimization CFLAGS
Bernhard Reutner-Fischer [Wed, 3 Dec 2014 15:18:54 +0000 (16:18 +0100)]
buildsys: remove some obsolete optimization CFLAGS

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolocale: Add wcsftime()
Bernhard Reutner-Fischer [Tue, 18 Nov 2014 17:27:47 +0000 (18:27 +0100)]
locale: Add wcsftime()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agonptl: compile pt-vfork in ARM-mode
Bernhard Reutner-Fischer [Thu, 13 Nov 2014 19:58:52 +0000 (20:58 +0100)]
nptl: compile pt-vfork in ARM-mode

could need a thumb implementation..

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoConfig.in.arch: enable long double math for xtensa
Max Filippov [Sat, 25 Oct 2014 10:32:35 +0000 (14:32 +0400)]
Config.in.arch: enable long double math for xtensa

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agostatfs: fix compile error when UCLIBC_LINUX_SPECIFIC is not set
Anthony G. Basile [Sat, 6 Sep 2014 23:45:34 +0000 (19:45 -0400)]
statfs: fix compile error when UCLIBC_LINUX_SPECIFIC is not set

statfs() is a Linux-specific function.  When building without
UCLIBC_LINUX_SPECIFIC set, libc_hidden_proto(statfs) in
include/sys/statfs.h is unmatched with libc_hidden_def(statfs)
in libc/sysdeps/linux/common/statfs.c, leading to a compile
error.  This patch fixes this, as well as adds statfs() to the
list of Linux-specific functions in extra/Configs/Config.in.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agom68k: libc: add fmovem* mcffpu condition
Bernhard Reutner-Fischer [Wed, 17 Sep 2014 18:45:26 +0000 (20:45 +0200)]
m68k: libc: add fmovem* mcffpu condition

add fmovem{x,.d,.*} ISA conditional
Fixes assembler errors for 5206.
isa_a, isa_b (or a+, don't remember) do not have emx, use em.d there.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agosparc: update ptrace.h to latest from glibc
Gustavo Zacarias [Sun, 7 Sep 2014 15:01:34 +0000 (12:01 -0300)]
sparc: update ptrace.h to latest from glibc

Update sys/ptrace.h to latest glibc release for a lot of missing
definitions.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agopowerpc: update ptrace.h to latest from glibc
Gustavo Zacarias [Sun, 7 Sep 2014 15:01:33 +0000 (12:01 -0300)]
powerpc: update ptrace.h to latest from glibc

Update sys/ptrace.h to latest glibc release for a lot of missing
definitions.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: remove now redundant lib placement defines
Bernhard Reutner-Fischer [Tue, 16 Sep 2014 20:07:12 +0000 (22:07 +0200)]
buildsys: remove now redundant lib placement defines

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: silence missing prototype warning
Bernhard Reutner-Fischer [Tue, 16 Sep 2014 19:36:54 +0000 (21:36 +0200)]
libc: silence missing prototype warning

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: fix IS_IN_lib*
Bernhard Reutner-Fischer [Mon, 15 Sep 2014 20:13:07 +0000 (22:13 +0200)]
buildsys: fix IS_IN_lib*

define NOT_IN_libc / IS_IN_libxxx appropriately
to fix pthread_once

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agonptl: rephrase *.sym handling
Bernhard Reutner-Fischer [Wed, 10 Sep 2014 20:18:55 +0000 (22:18 +0200)]
nptl: rephrase *.sym handling

Avoids circular dependency warning from make by generating the .h
directly from the .sym files, elimination intermediate files.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: Fix typo
Bernhard Reutner-Fischer [Tue, 9 Sep 2014 11:49:34 +0000 (13:49 +0200)]
buildsys: Fix typo

LDFLAG-fuse-ld looked at a non-existing var, use the correct one

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: add fallocate() and fallocate64()
Anthony G. Basile [Sun, 7 Sep 2014 19:33:46 +0000 (15:33 -0400)]
libc: add fallocate() and fallocate64()

We add the Linux-specific function fallocate() which allows the user to
directly manipulate allocate space for a file.  fallocate() can operate
in different modes, but the default mode is equivalent to posix_fallocate()
which is specified in POSIX.1.

Recent releases of e2fsprogs 1.42.11 and above expect fallocate64() to be
available.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: split multi-source epoll.c
Bernhard Reutner-Fischer [Fri, 5 Sep 2014 11:59:28 +0000 (13:59 +0200)]
libc: split multi-source epoll.c

We cannot override individual functions on a per-arch basis otherwise

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agosparc: remove sparc64/sparcv9 code
Waldemar Brodkorb [Mon, 1 Sep 2014 18:44:20 +0000 (20:44 +0200)]
sparc: remove sparc64/sparcv9 code

The sparc64/sparcv9 code is incomplete. Furthermore there is
no real embedded hardware for sparc64 available, so better remove
it until someone comes up with a complete port.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoldso: Fix compile-error on noMMU
Bernhard Reutner-Fischer [Thu, 4 Sep 2014 11:21:23 +0000 (13:21 +0200)]
ldso: Fix compile-error on noMMU

Thanks to Waldemar Brodkorb for noticing!

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: wcsftime depends on XLOCALE
Bernhard Reutner-Fischer [Thu, 4 Sep 2014 11:16:35 +0000 (13:16 +0200)]
test: wcsftime depends on XLOCALE

Thanks to Waldemar Brodkorb for noticing.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: disable librt shmtest on non-MMU systems
Bernhard Reutner-Fischer [Thu, 4 Sep 2014 11:12:52 +0000 (13:12 +0200)]
test: disable librt shmtest on non-MMU systems

This test fails for non-MMU systems, because it uses fork()
Thanks to Waldemar Brodkorb!

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: tweak check_ld flag probing
Bernhard Reutner-Fischer [Thu, 4 Sep 2014 10:46:56 +0000 (12:46 +0200)]
buildsys: tweak check_ld flag probing

ld was (erroneously) complaining that it failed to merge private bfd
data. Silence this mismatch as seen on m68k with obfd binary.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: refine compile.S
Bernhard Reutner-Fischer [Fri, 29 Aug 2014 19:06:18 +0000 (21:06 +0200)]
buildsys: refine compile.S

filter out all -std=

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: use SED for create-lds
Bernhard Reutner-Fischer [Fri, 29 Aug 2014 18:53:04 +0000 (20:53 +0200)]
buildsys: use SED for create-lds

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: disable test for systems without FPU
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:26 +0000 (12:31 +0200)]
test: disable test for systems without FPU

This test fails for systems without fpu.
For example m68k build for non-mmu/non-fpu systems fail.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: sync with glibc, use do_test
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:30 +0000 (12:31 +0200)]
test: sync with glibc, use do_test

This breaks out of a deadlock, which occurs when testing for powerpc. (qemu)
Otherwise the test suite does not finish.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: get out of the endless while loop, when bind failed
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:29 +0000 (12:31 +0200)]
test: get out of the endless while loop, when bind failed

When bind() fails in this test, then /tmp get filled up with
temp files and upcoming tests will fail, because they need to create
temp files, too. Better exit from the loop.
Test still needs to be investigated to fix the failing bind().

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agom68k: fix typo
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:27 +0000 (12:31 +0200)]
m68k: fix typo

otherwise you get compile warnings, when building for m68k.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: do not depend on compile
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:24 +0000 (12:31 +0200)]
test: do not depend on compile

When you cross-compile the testsuite and then try to run
on a system without gcc/binutils it would be nice if no compiling
or linking is tried. Refresh test/README (suggested by Khem)

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: NPTL: sync WRITE_BUFFER_SIZE with glibc test
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:23 +0000 (12:31 +0200)]
test: NPTL: sync WRITE_BUFFER_SIZE with glibc test

Test on Linux 3.16.1 in Qemu ARM fails with:
 TEST_EXEC nptl/ tst-cancel4
ret == 1 ; expected_ret == 0
make[1]: *** [tst-cancel4.exe] Error 1
The output of failed test is:
minimum write buffer size too large
../Test.mak:89: recipe for target 'tst-cancel4.exe' failed

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agosparc: add missing pthread_spin_lock/pthread_spin_trylock
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:22 +0000 (12:31 +0200)]
sparc: add missing pthread_spin_lock/pthread_spin_trylock

tst-spin1.c compile breaks with:
test/nptl/tst-spin1.c:34: undefined reference to `pthread_spin_lock'

pthread_spin_lock and pthread_spin_trylock is missing while
building sparc. add the meta c files here.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agosparc: remove unused subdirs variable
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:21 +0000 (12:31 +0200)]
sparc: remove unused subdirs variable

For sparc TARGET_SUBARCH is never used. And there is a typo in the
path.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoRevert "sparc: disable cancellable system, as it fails in strange ways right now"
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:20 +0000 (12:31 +0200)]
Revert "sparc: disable cancellable system, as it fails in strange ways right now"

This reverts commit 1db4f8f8389f6a935ecd83aff7fcce5d1cf2c0f3.

It is unclear in which way this is breaking sparc systems.
With this change added you get following linking error:
libpthread/nptl/libpthread_so.a(pt-system.oS): In function `__libc_system':
libc/stdlib/system.c:64: undefined reference to `__wait4_nocancel'

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoRevert "sparc: use HIDDEN_JUMPTARGET for errno"
Waldemar Brodkorb [Thu, 28 Aug 2014 10:31:19 +0000 (12:31 +0200)]
Revert "sparc: use HIDDEN_JUMPTARGET for errno"

This reverts commit f51fb26dbcceee9e48d10facc830bd4a549f6cc2.

This fixes linking error for sparc build.
While building a sparc system you get following linking error:
libc/sysdeps/linux/sparc/pipe.S:54: undefined reference to `__GI___errno_location'

Removing the HIDDEN_JUMPTARGET fixes the issue, while using gcc 4.8.3/binutils 2.24.

The definition of __errno_location was changed recently here:
http://git.uclibc.org/uClibc/commit/?id=8f550715c2b211036fc273add3cb5219397ed312

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotimex: Sync with glibc
Khem Raj [Mon, 25 Aug 2014 23:58:13 +0000 (16:58 -0700)]
timex: Sync with glibc

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoDefine IPTOS_CLASS_* macros according to RFC 2474
Khem Raj [Mon, 25 Aug 2014 23:58:12 +0000 (16:58 -0700)]
Define IPTOS_CLASS_* macros according to RFC 2474

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: remove duplicate UCLIBC_EXTRA_CFLAGS
Bernhard Reutner-Fischer [Tue, 26 Aug 2014 18:07:08 +0000 (20:07 +0200)]
buildsys: remove duplicate UCLIBC_EXTRA_CFLAGS

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agomicroblaze: Remove duplicate F_{S,G}ETPIPE_SZ
Bernhard Reutner-Fischer [Mon, 25 Aug 2014 08:41:08 +0000 (10:41 +0200)]
microblaze: Remove duplicate F_{S,G}ETPIPE_SZ

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agofcntl.h: Define F_SETPIPE_SZ and F_GETPIPE_SZ
Khem Raj [Thu, 20 Feb 2014 09:12:14 +0000 (01:12 -0800)]
fcntl.h: Define F_SETPIPE_SZ and F_GETPIPE_SZ

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agomathinline.h: Use __extern_inline
Bernhard Reutner-Fischer [Mon, 25 Aug 2014 08:07:44 +0000 (10:07 +0200)]
mathinline.h: Use __extern_inline

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoAdd clock_adjtime syscall
Khem Raj [Sat, 15 Mar 2014 16:32:20 +0000 (09:32 -0700)]
Add clock_adjtime syscall

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agofix for pipe() on sparc
Waldemar Brodkorb [Tue, 19 Aug 2014 19:11:16 +0000 (21:11 +0200)]
fix for pipe() on sparc

When using something like this:
 $ echo foo|grep foo|wc -l
with mksh shell, you get an runtime error.

Glibc and klibc does not do these extra check.
After removing this check using double pipes work fine.
Tested with Qemu 2.1.0.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: add issetugid()
Anthony G. Basile [Mon, 18 Aug 2014 11:56:08 +0000 (07:56 -0400)]
libc: add issetugid()

issetugid() returns 1 if the process environment or memory address space
is considered tainted, and returns 0 otherwise.  This happens, for example,
when a process's privileges are elevated by the setuid or setgid flags on
an executable belonging to root.  This function first appeard in OpenBSD 2.0
and is needed for the LibreSSL.

This patch follows the same logic as the equivalent musl commit.  For more
information see the commit message at

http://git.musl-libc.org/cgit/musl/commit/?id=ddddec106fd17c3aca3287005d21e92f742aa9d4

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest/math: fix for MIPS that takes 32/64 suffix into account
Alexey Brodkin [Mon, 18 Aug 2014 07:04:28 +0000 (11:04 +0400)]
test/math: fix for MIPS that takes 32/64 suffix into account

This fixes a breakage for MIPS32/64 introduced in:
http://git.uclibc.org/uClibc/commit/?id=c02bc5763ba9c8f8b464bca89fba28e091ce1ffc

Now ULP_SUFFIX is taken into account when searching for existing
libm-test-ulps-ARCH

Signed-off-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: Waldemar Brodkorb <wbx@openadk.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest/math: fix for disabled long double math
Alexey Brodkin [Wed, 13 Aug 2014 12:04:45 +0000 (16:04 +0400)]
test/math: fix for disabled long double math

Commit "test: cater for config" http://git.uclibc.org/uClibc/commit/test/math/Makefile.in?id=7598eeaa1defa2884adaa890bb115c493d69cc35 inverted check from
ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),y)
to
ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),)
with first branch indeed inverted - instead of adding tests they were excluded.
But "else" branch was not moved up (remember check was inverted).

This causes compile breakage when building basic-test.c:
--->---
TEST_LINK math/ basic-test
basic-test.c: In function 'ldouble_test':
basic-test.c:111:1: warning: implicit declaration of function 'nanl' [-Wimplicit-function-declaration]
 TEST_FUNC (ldouble_test, long double, nanl, LDBL_EPSILON, HUGE_VALL)
 ^
basic-test.o: In function `main':
basic-test.c:(.text.startup+0x834): undefined reference to `nanl'
basic-test.c:(.text.startup+0x858): undefined reference to `nanl'
basic-test.c:(.text.startup+0x880): undefined reference to `nanl'
basic-test.c:(.text.startup+0x8a8): undefined reference to `nanl'
basic-test.c:(.text.startup+0x8d4): undefined reference to `nanl'
basic-test.o:basic-test.c:(.text.startup+0x8e0): more undefined references to `nanl' follow
collect2: error: ld returned 1 exit status
make[3]: *** [basic-test] Error 1
--->---

Fix is simple - merge "old else" branch with the first current one.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: Enable OBSTACK in defconfig for ARC
Anton Kolesov [Fri, 1 Aug 2014 18:16:26 +0000 (22:16 +0400)]
ARC: Enable OBSTACK in defconfig for ARC

OBSTACK is required for native builds of binutils and GDB.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agouclibc: nptl: fix __lll_lock_wait_private multiple definition
Tony Wu [Fri, 25 Jul 2014 05:52:11 +0000 (13:52 +0800)]
uclibc: nptl: fix __lll_lock_wait_private multiple definition

Mark non-pthread __lll_lock_wait_private weak to avoid multiple
definition error in static link mode.

Signed-off-by: Tony Wu <tung7970@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolseek: Correct order of offset arguments
Anton Kolesov [Fri, 1 Aug 2014 18:18:47 +0000 (22:18 +0400)]
lseek: Correct order of offset arguments

There was a runtime error in systems without large file support. Call
fseek(fd, 4096, SEEK_SET) has been failing with EINVAL, though it was
succeeding for offset = 4092. This has been happening because llseek system
call accepts 64-bit value as an offset argument and lseek function has been
ordering 32-bits words that form this offset value, according to the
endianness. However this ordering to match endianness is not required,
because llseek doesn't accept one 64-bit offset argument, it accepts two
32-bit offset argument, then stitches them into one following its
endianness. As a result on little endian system, order of words has been
swapped two time: in libc and in kernel. Thus call to fseek with offset 4096
(0x1000) was doing a system call to llseek with offset 0x1000_0000_0000. I'm
not entirely sure why then offset = 4092 hasn't been failing then.

This patch removes malicious swap of words when calling llseek.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: posix_fadvise: Fix build breakage for !LFS
Vineet Gupta [Thu, 9 Jan 2014 09:35:45 +0000 (15:05 +0530)]
libc: posix_fadvise: Fix build breakage for !LFS

commit 00571b43df2e "libc: posix_fadvise: restore implementation for xtensa"
enabled posix_fadvise() for all arches (it was just not generated
before).

However this also unearthed an issue introduced by ee84b8b400
"linux: posix_fadvise: use new SYSCALL_ALIGN_64BIT" which is to
referencing LFS'ish code (off64_t) w/o proper checks which causes build
to break for !LFS.

Fix this by calling posix_fadvise64() only for LFS case and open-code
it's equivalent for !LFS.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: markos Chandras <markos.chandras@gmail.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agounbreak networking code for sparc
Waldemar Brodkorb [Tue, 29 Jul 2014 07:53:01 +0000 (09:53 +0200)]
unbreak networking code for sparc

This commit 1e2e4ac6193ffe0900bd392fa3c596883771eb34 breaks networking
on sparc systems. In Linux the socket functions are declared, but not
implemented and must be routed through socketcall().

Tested via Qemu 2.0.0.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest_nptl: replace __sigpause with sigpause
Alexey Brodkin [Fri, 25 Jul 2014 14:11:21 +0000 (18:11 +0400)]
test_nptl: replace __sigpause with sigpause

On attempt to build uClibc tests following error message appears:
=========
TEST_LINK nptl/ tst-cancel4
tst-cancel4.c: In function 'tf_sigpause':
tst-cancel4.c:765:3: warning: implicit declaration of function
'__sigpause' [-Wimplicit-function-declaration]
__sigpause (SIGCANCEL, 1);
^
tst-cancel4.o: In function `tf_sigpause':
tst-cancel4.c:(.text+0x1054): undefined reference to `__sigpause'
collect2: error: ld returned 1 exit status
=========

This commit http://git.uclibc.org/uClibc/commit/?id=cef1f9517c319d86b4b426ecc14a10d0fa5494c7
makes __sigpause static limiting its scope to "libc/signal/sigpause.c".

Switching to common implementation "sigpause()" fixes this issue.

Signed-off-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Suggested-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC/NPTL: clone to set TP if CLONE_SETTLS
Vineet Gupta [Fri, 25 Jul 2014 12:09:08 +0000 (17:39 +0530)]
ARC/NPTL: clone to set TP if CLONE_SETTLS

Typically kernel would set the TP register of newly created thread in
clone syscall with CLONE_SETTLS.

However this implies that:
* kernel knows of the exact TP register (which is already different for
  ARCompact and ARCv2) and is a detail which becomes part of the ABI
* kernel also needs to handle the unlikely but possible case of !TLS
  userspace (e.g. Android libc) case where TP reg is not reserved and
  thus need not be mucked with (using ELF personality based detection)

It is better to confine this detail to userspace runtime and set TP reg
right after clone syscall returns.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC/NPTL: Add tests
Vineet Gupta [Fri, 25 Jul 2014 12:09:07 +0000 (17:39 +0530)]
ARC/NPTL: Add tests

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC/NPTL: Fix __libc_sigaction redefinition with static links
Vineet Gupta [Fri, 25 Jul 2014 12:09:06 +0000 (17:39 +0530)]
ARC/NPTL: Fix __libc_sigaction redefinition with static links

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoNPTL: ARC support
Vineet Gupta [Fri, 25 Jul 2014 12:09:05 +0000 (17:39 +0530)]
NPTL: ARC support

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: ldso: Use @pcl syntax.
Joern Rennecke [Fri, 25 Jul 2014 12:09:04 +0000 (17:39 +0530)]
ARC: ldso: Use @pcl syntax.

Signed-off-by: Joern Rennecke <joern.rennecke@embecosm.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobits/time.h: sync with latest glibc
Mike Frysinger [Fri, 1 Aug 2014 08:16:12 +0000 (04:16 -0400)]
bits/time.h: sync with latest glibc

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
9 years agotest/math: add fallback to libm-test-ulps-generic logic
Jian Peng [Wed, 9 Jul 2014 18:27:25 +0000 (22:27 +0400)]
test/math: add fallback to libm-test-ulps-generic logic

Under test/math/, there is libm-test-ulps-generic used as fallback
in case that libm-test-ulps-$(TARGET_ARCH) does not exist.

This is required for arches that don't have ULPS yet.

Original patch from Jian Peng was found here:
http://lists.uclibc.org/pipermail/uclibc/2011-April/045172.html

Signed-off-by: Jian Peng <jipeng2005@gmail.com>
Signed-off-by: Alexey Brodkin <abrodkin@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>
9 years agoChangelog: complete old data and cycle
Bernhard Reutner-Fischer [Thu, 24 Jul 2014 18:44:42 +0000 (20:44 +0200)]
Changelog: complete old data and cycle

We switched to detailed per-release Changelog some time ago, available
on the website.
Move the old Changelog for historical reasons.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: Implement native GDB requirements in procfs.h
Anton Kolesov [Thu, 26 Jun 2014 06:03:35 +0000 (11:33 +0530)]
ARC: Implement native GDB requirements in procfs.h

Native GDB requires elf_fpregset_t to be defined, even if floating point
registers are absent. In this case we use empty structure. Additionally we
redefined prfpregset_t to use this new type.

And there has been an error: it was defined that user_regs_struct has 20
registers, while it has 40.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: clone: Ensure that @fn returns back to clone
Vineet Gupta [Thu, 26 Jun 2014 06:03:34 +0000 (11:33 +0530)]
ARC: clone: Ensure that @fn returns back to clone

This showed up due to longstanding test/unistd/clone failure where post
clone, the callback was not exiting and rather falling thru in into main
program.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: ldso: Dont force frame pointer as it useless for unwinding on ARC
Vineet Gupta [Thu, 26 Jun 2014 06:03:33 +0000 (11:33 +0530)]
ARC: ldso: Dont force frame pointer as it useless for unwinding on ARC

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: make sigaction inline with other arches
Vineet Gupta [Thu, 26 Jun 2014 06:03:32 +0000 (11:33 +0530)]
ARC: make sigaction inline with other arches

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: syscalls.h: code-reuse/fix-arg-annotations
Vineet Gupta [Thu, 26 Jun 2014 06:03:31 +0000 (11:33 +0530)]
ARC: syscalls.h: code-reuse/fix-arg-annotations

- Use syscalls-common.h vers of INTERNAL_SYSCALL / INLINE_SYSCALL_NOERR
- INLINE_SYSCALL takes syscall name (e.g. write)
- {INLINE,INTERNAL}_SYSCALL_NCS macros take syscall num (__NR_write)

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agosyscalls-common.h: Rename some macro args for correct documentation
Vineet Gupta [Thu, 26 Jun 2014 06:03:30 +0000 (11:33 +0530)]
syscalls-common.h: Rename some macro args for correct documentation

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoopen64: ensure that openat check works
Vineet Gupta [Thu, 19 Jun 2014 07:08:38 +0000 (12:38 +0530)]
open64: ensure that openat check works

For ARC builds atleast, __NR_xxx was not trickling into in open64.c
causing open64->openat a needless detour via open

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agofix pthread_cancel lead to segmentation fault for x86_64.
Zhang Pu [Tue, 20 May 2014 16:52:55 +0000 (00:52 +0800)]
fix pthread_cancel lead to segmentation fault for x86_64.

When x86_64 cpu contains 'cpu_has_xsave' flag(in kernel),call the
pthread_cancel will have a segmentation fault. Because gcc could
not find the end of stack in user signal stack.

Signed-off-by: Zhang Pu <glen4linux@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoarm: move check for BX to its own header
Yann E. MORIN [Thu, 11 Apr 2013 21:02:03 +0000 (23:02 +0200)]
arm: move check for BX to its own header

As Will noticed, the header this check is currently done in
is asm-only, and is not meant to be included from C code.
This breaks compilation when compiled for a Thumb2-aware CPU.

Move the BX check to its own header, and revert 7a246fd.

Reported-by: Will Newton <will.newton@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Will Newton <will.newton@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoNPTL: Fix undefined reference to PRIVATE_FUTEX with 2.6.18 kernel
Dan Moulding [Tue, 29 Apr 2014 14:54:57 +0000 (08:54 -0600)]
NPTL: Fix undefined reference to PRIVATE_FUTEX with 2.6.18 kernel

When compiling against the 2.6.18 kernel headers, during linking of
the NPTL library it runs into a "undefined reference to PRIVATE_FUTEX"
error in pthread_cond_timedwait.S. This resolves the problem by
ensuring that the definition for PRIVATE_FUTEX is made available to
pthread_cond_timedwait.S.

Signed-off-by: Dan Moulding <dan.moulding@rackwareinc.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoarm/clone.S: Add missing IT instruction for Thumb2.
Will Newton [Tue, 2 Apr 2013 12:56:00 +0000 (13:56 +0100)]
arm/clone.S: Add missing IT instruction for Thumb2.

The conditional load needs to be made part of an IT block on Thumb2
cores.

Signed-off-by: Will Newton <will.newton@linaro.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: Do not install atomic.h
Bernhard Reutner-Fischer [Thu, 12 Jun 2014 14:28:33 +0000 (16:28 +0200)]
buildsys: Do not install atomic.h

Gregory Fong noted that we'd better not install atomic.h

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoresolv: try next server on SERVFAIL
Michel Stam [Thu, 27 Feb 2014 20:42:38 +0000 (21:42 +0100)]
resolv: try next server on SERVFAIL

Commit e1420eca7374cd8f583e9d774c890645a205aaee fixed a bug where a
response code should mean the next server is tried. However, it tries
only the next search domain, and never skips to the next server. This
fix makes sure we try the next server on SERVFAIL.

Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest/math: Adjust arm tests for older ULPs format
Gregory Fong [Mon, 21 Apr 2014 19:08:03 +0000 (12:08 -0700)]
test/math: Adjust arm tests for older ULPs format

The ULPs format in glibc has changed slightly and now deviates from
that in uClibc, so when using the files directly from glibc, for
certain types of tests the ULPs values were incorrectly defaulting to
0 rather than using the values provided.  This caused some tests to
fail despite the max ULPs being correctly marked.

Regenerated and updated part of the ULPs file to fix this issue.  This
also added values for exp and log.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoldso: Add remaining relocation types to the table
Gregory Fong [Mon, 21 Apr 2014 18:42:01 +0000 (11:42 -0700)]
ldso: Add remaining relocation types to the table

The table format is thrown off a bit because some of these names are
too long to fit the previous format so they were put on their own
lines.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoldso/mips: Remove redundant LD_DEBUG prints
Gregory Fong [Mon, 21 Apr 2014 18:42:00 +0000 (11:42 -0700)]
ldso/mips: Remove redundant LD_DEBUG prints

These should have been protected by

  if (_dl_debug_reloc && _dl_debug_detail)

, but since the previous change "ldso/mips: actually print results of
each relocation" makes this redundant, just eliminate these prints
instead.  I think this is the only item that is still printing
regardless of the value of LD_DEBUG when uClibc is built with
SUPPORT_LD_DEBUG=y.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoldso/mips: actually print results of each relocation
Gregory Fong [Mon, 21 Apr 2014 18:41:59 +0000 (11:41 -0700)]
ldso/mips: actually print results of each relocation

The patched line was outside of the body of the loop over relocations
and so would only print the results of the last relocation, fix that.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoldso: Fix misplaced declaration
Bernhard Reutner-Fischer [Wed, 23 Apr 2014 11:33:23 +0000 (13:33 +0200)]
ldso: Fix misplaced declaration

Apparently i made a typo when applying
278a06d7abcc8774ba9bb9c15779749c7e2d68cd
sorry..

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoweak symbols need to be "defined" weak but "declared" strong
Vineet Gupta [Wed, 16 Apr 2014 10:36:01 +0000 (16:06 +0530)]
weak symbols need to be "defined" weak but "declared" strong

Patch "LT.old: Make __errno_location/__h_errno_location thread safe"
uncovered yet another bug with static linking and errno (hopefully this
is last of them all).

Currently, __errno_location is declared weak but is defined strong.
While this provides with the desired weak semantics in dso, it
is subtly broken in static links.

Quoting Joern Rennecke (ARC gcc expert):

| I think the issue is that you declare the function as weak in the
| header file.  That is a rare instance where you want the reference
| use declaration that differs a bit from the definition.
| If the reference uses a weakly declared function, that creates a
| weakref, i.e. the linker won't bother to look for this symbol at
|  all - if it gets linked in for some other reason, fine,
| otherwise, it stays zero.

So the solution to declare strong, define weak.

Supporting data
-----------------
orig code: ARM mmap wrapper (LT.old build + my prev patch for errno)

_mmap:
    @ args = 8, pretend = 0, frame = 0
    @ frame_needed = 0, uses_anonymous_args = 0
    stmfd    sp!, {r4, r5, r7, lr}
    ldr    r5, [sp, #20]
    movs    ip, r5, asl #20
    beq    .L2
    bl    __errno_location(PLT)
    mov    r3, #22
    str    r3, [r0, #0]
    mvn    r0, #0
...
...
   .weak __errno_location

A statically linked hello world program which uses mmap too.
As we can see__errno_location is completely gone - which is
semantically wrong - we need functional errno.

00008274 <__GI_mmap>:
    8274:    e92d40b0     push    {r4, r5, r7, lr}
    8278:    e59d5014     ldr    r5, [sp, #20]
    827c:    e1b0ca05     lsls    ip, r5, #20
    8280:    0a000004     beq    8298
    8284:    e320f000     nop    {0}
          ^^^^^^^^^^
    8288:    e3a03016     mov    r3, #22
    828c:    e5803000     str    r3, [r0]
    8290:    e3e00000     mvn    r0, #0

This in turn is due to a fixup in ARM ld which transforms branch-to-null
into a nop. It is better than crashing but still wrong since errno
handling is removed.

With the patch, errno_location is restored back in test program.

00008274 <__GI_mmap>:
    8274: e92d40b0  push {r4, r5, r7, lr}
    8278: e59d5014  ldr r5, [sp, #20]
    827c: e1b0ca05  lsls ip, r5, #20
    8280: 0a000004  beq 8298 <__GI_mmap+0x24>
    8284: eb000010  bl 82cc <__errno_location>
    8288: e3a03016  mov r3, #22
    828c: e5803000  str r3, [r0]

Cc: Christian Ruppert <christian.ruppert@abilis.com>
CC: Francois Bedard <Francois.Bedard@synopsys.com>
Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
Cc: Joern Rennecke <joern.rennecke@embecosm.com>
Cc: Jeremy Bennett <jeremy.bennett@embecosm.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoLT.old: Make __errno_location/__h_errno_location thread safe
Vineet Gupta [Wed, 16 Apr 2014 09:57:52 +0000 (15:27 +0530)]
LT.old: Make __errno_location/__h_errno_location thread safe

WHY: errno in uClibc is not thread safe

HOW: __errno_location and it's sibling __h_errno_location need to be called
     via PLT - even from within libc. That way when linked with pthread,
     intra-uClibc callers will also use the thread safe version.

     This is achieved by removing the GI alias for these functions,
     ensuring that they get called normally (via PLT)

Verified with ARC LT.old and ARM cubieboard2 buildroot (LT.old)
NPTL is unaffected by this bug.

------------ History behind this patch ---------------------

This is a long standing bug (https://bugs.busybox.net/show_bug.cgi?id=2089)

Others have tried to fix it in past (alteast Peter Korsgaard's patch in 2010),
but somehow failed to be merged (or were backed out afterwards).
http://lists.uclibc.org/pipermail/uclibc/2010-July/044176.html

One of the causes could be side effect of atleast one more bug related to
pthreads and static link which has now been fixed.
http://lists.uclibc.org/pipermail/uclibc/2013-October/047958.html

I have solved this w/o looking at other pacthes but would like to give
credit to Peter and others for confirming that it makes sense.

Cc: Christian Ruppert <christian.ruppert@abilis.com>
CC: Francois Bedard <Francois.Bedard@synopsys.com>
Cc: Joern Rennecke <joern.rennecke@embecosm.com>
Cc: Jeremy Bennett <jeremy.bennett@embecosm.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: buildroot@busybox.net
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agoctype.h: Tweak comment
Bernhard Reutner-Fischer [Tue, 8 Apr 2014 22:18:07 +0000 (00:18 +0200)]
ctype.h: Tweak comment

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agoldso: fix standalone execution on x86_64 architecture
Cédric VINCENT [Mon, 7 Apr 2014 08:04:40 +0000 (10:04 +0200)]
ldso: fix standalone execution on x86_64 architecture

If the dynamic linker is built with LDSO_STANDALONE_SUPPORT=y, it can
load then run a dynamically linked program when explicitly invoked
from the command line.  This is used for test and prelink purposes,
and also by other tools like PRoot to force the kernel to load the
right ELF interpreter.

This feature is currently broken on x86_64 since the number of command
line arguments (ie. argc) passed from the kernel is an "elf_addr_t"
(64 bit on x86_64), whereas it is read as an "unsigned int" (32 bit on
x86_64).

Ref: https://github.com/cedric-vincent/PRoot/issues/45
Signed-off-by: Cédric VINCENT <cedric.vincent@st.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agotest/math: add libm-test-ulps-{arm,mips32,mips64} files
Gregory Fong [Wed, 2 Apr 2014 01:12:12 +0000 (18:12 -0700)]
test/math: add libm-test-ulps-{arm,mips32,mips64} files

Adds the mips and arm test ULPs from glibc.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agotest/math: don't try to build test dep as test
Gregory Fong [Wed, 2 Apr 2014 01:12:14 +0000 (18:12 -0700)]
test/math: don't try to build test dep as test

libm-test.c is a generated file needed by the other math tests, but
test rules were trying to build it as a test if trying to compile the
tests a second time.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agotest/math: Select correct ULPs for mips32/mips64
Gregory Fong [Wed, 2 Apr 2014 01:12:13 +0000 (18:12 -0700)]
test/math: Select correct ULPs for mips32/mips64

Using TARGET_ARCH isn't sufficient when ISA can differ.

Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agosysinfo.h: Prevent redeclarations
Bernhard Reutner-Fischer [Thu, 3 Apr 2014 11:48:35 +0000 (13:48 +0200)]
sysinfo.h: Prevent redeclarations

Guard against duplicate inclusion.
We should go back to just including the linux/sysinfo.h ..

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agolibc: Fix buglet around __progname
Bernhard Reutner-Fischer [Wed, 2 Apr 2014 19:42:42 +0000 (21:42 +0200)]
libc: Fix buglet around __progname

508b20ead1710e8c295630d096960e51a65b7e5d disentangled
program_invocation_name and __progname but forgot to make __progname
conditional on __UCLIBC_HAS___PROGNAME__, resulting in getconf
attempting to re-define __progname in case __UCLIBC_HAS___PROGNAME__ was
not defined.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agotest: Reuse PTINC in nptl tests
Bernhard Reutner-Fischer [Wed, 2 Apr 2014 13:21:59 +0000 (15:21 +0200)]
test: Reuse PTINC in nptl tests

Use toplevel Rules.mak notion of PTINC as list of includes to use for
the testcases.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agoFix warnings in MIPS build
Steve Ellcey [Tue, 4 Feb 2014 22:20:40 +0000 (14:20 -0800)]
Fix warnings in MIPS build

This patch fixes the rest of the set-but-not-used warnings in the MIPS
code by using attribute_unused and also fixes some conversion warnings
by changing __arch_compare_and_exchange_xxx_[8|16]_int.  Assigning __cmp
(int type) to __prev (pointer type) generates a warning.  Assigning zero
to each separately avoids this warning without having to add a cast.

Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agoxtensa: add missing .literal_position directives
Max Filippov [Sun, 23 Mar 2014 22:07:15 +0000 (02:07 +0400)]
xtensa: add missing .literal_position directives

This addition allows building uClibc with -mtext-section-literals

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agoARC: Make vfork weak in libc
Vineet Gupta [Thu, 13 Mar 2014 12:38:38 +0000 (18:08 +0530)]
ARC: Make vfork weak in libc

Anton reported:

------------------->8---------------------
Package iperf cannot be built in Buildroot due to following error:

/home/akolesov/env/autobuild/tmp/host/usr/bin/arc-buildroot-linux-uclibc-g++
-Wall -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-pipe -Os    --static -o iperf -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64  -pipe -Os   -pthread  -DHAVE_CONFIG_H Client.o
Extractor.o Launch.o List.o Listener.o Locale.o PerfSocket.o ReportCSV.o
ReportDefault.o Reporter.o Server.o Settings.o SocketAddr.o gnu_getopt.o
gnu_getopt_long.o main.o service.o sockets.o stdio.o tcp_window_size.o
../compat/libcompat.a
/home/akolesov/env/autobuild/tmp/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(vfork.os):
In function `vfork':
(.text+0x0): multiple definition of `vfork'
/home/akolesov/env/autobuild/tmp/host/usr/arc-buildroot-linux-uclibc/sysroot/usr/lib/libpthread.a(ptfork.os):ptfork.c:(.text+0xc0):
first defined here
collect2: error: ld returned 1 exit status
------------------->8---------------------

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
Cc: Francois Bedard <Francois.Bedard@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agolibc: fix mips N64 pread/pwrite build
Steve Ellcey [Thu, 13 Feb 2014 22:33:03 +0000 (14:33 -0800)]
libc: fix mips N64 pread/pwrite build

Uclibc is not building for MIPS N64 because pread is trying to use the
pread/pwrite system calls instead of pread64/pwrite64.  This patch fixes
the problem and was tested with LFS enabled and disabled.

Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agotest: Fix math .c dependency
Bernhard Reutner-Fischer [Tue, 18 Feb 2014 22:30:28 +0000 (23:30 +0100)]
test: Fix math .c dependency

When explicitly running the compile target we were missing a dependency
to generate the libm-test.c.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agobuildsys: pass correct linker to compiler driver
Bernhard Reutner-Fischer [Sat, 15 Feb 2014 10:39:27 +0000 (11:39 +0100)]
buildsys: pass correct linker to compiler driver

Testing linker features has to be done against the correct linker.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 years agobuildsys: Add MIPS64R2 support
Steve Ellcey [Thu, 13 Feb 2014 00:44:57 +0000 (16:44 -0800)]
buildsys: Add MIPS64R2 support

There is support for mips64(r1) already in uclibc, this change adds mips64r2
by adding the MIPS64R2 config variable and checking it in Rules.mak.

Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>