OSDN Git Service

uclinux-h8/uclibc-ng.git
9 years agoARC: don't hard-code ELF_NGREG
Alexey Brodkin [Thu, 26 Mar 2015 08:55:37 +0000 (14:25 +0530)]
ARC: don't hard-code ELF_NGREG

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[updated changelog]

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC/signal: shield sa_restorer from compiler toggle side-effects
Vineet Gupta [Thu, 26 Mar 2015 12:37:04 +0000 (18:07 +0530)]
ARC/signal: shield sa_restorer from compiler toggle side-effects

when building uClibc with -O0 (DODEBUG build) the default sigrestorer
had some extra glue code generated for stack manipulation which was
messing up resume from signal path.

So annotate the function with -Os so that gcc would only generate the
bare min 2 instruction TRAP sequence

Reported-and-Debugged-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: switch to NPTL
Vineet Gupta [Thu, 26 Mar 2015 08:55:35 +0000 (14:25 +0530)]
ARC: switch to NPTL

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoAdd support for R_ARC_NONE relocations.
Andrew Burgess [Thu, 26 Mar 2015 08:55:34 +0000 (14:25 +0530)]
Add support for R_ARC_NONE relocations.

The R_ARC_NONE relocation is generated when --gc-sections, used by the
compile time linker, removes some sections.  This is completely normal,
and we can see that all other targets (based on random sampling) have
support for R_*_NONE relocations (named for each target).

Handling R_ARC_NONE involves doing nothing with it, which is nice and
easy.

Signed-off-by: Andrew Burgess <andrew.burgess@embecosm.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoinclude: update atomic.h from glibc
Bernhard Reutner-Fischer [Thu, 26 Mar 2015 22:12:38 +0000 (23:12 +0100)]
include: update atomic.h from glibc

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: Add SIMULATOR_uclibc and SIMULATOR_glibc
Bernhard Reutner-Fischer [Thu, 26 Mar 2015 21:51:16 +0000 (22:51 +0100)]
test: Add SIMULATOR_uclibc and SIMULATOR_glibc

where SIMULATOR_glibc is an optional simulator to run host binaries and
SIMULATOR_uclibc is an optional simulator to run target (uClibc)
binaries.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoutmp: always have at least utmpx
Bernhard Reutner-Fischer [Wed, 25 Mar 2015 23:50:17 +0000 (00:50 +0100)]
utmp: always have at least utmpx

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoNPTL: SH: silence warning
Bernhard Reutner-Fischer [Wed, 25 Mar 2015 23:03:09 +0000 (00:03 +0100)]
NPTL: SH: silence warning

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoSH: add 't' to syscall clobber list
Bernhard Reutner-Fischer [Wed, 25 Mar 2015 23:03:05 +0000 (00:03 +0100)]
SH: add 't' to syscall clobber list

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoldso: mark _dl_exit as noreturn
Bernhard Reutner-Fischer [Wed, 25 Mar 2015 23:02:58 +0000 (00:02 +0100)]
ldso: mark _dl_exit as noreturn

Otherwise gcc might not understand that oom() ended control-flow and
might emit an (untaken) reference to abort() in _dl_update_slotinfo()
on e.g. SH4 which breaks linking ld-uClibc.so.
Arguably -ffreestanding should prevent GCC from emitting this
'.global abort' but alas, it does not, which is another bug..

Also mark the function cold to further lower the incoming frequency and
branch probability.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: tweaks
Bernhard Reutner-Fischer [Wed, 25 Mar 2015 22:59:52 +0000 (23:59 +0100)]
test: tweaks

Fix arc4random exclusion for real.
Silence warning about missing prototype for external helper-function in
tst-scandir

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoinclude: Expand malloc-family comments
Bernhard Reutner-Fischer [Wed, 25 Mar 2015 22:59:49 +0000 (23:59 +0100)]
include: Expand malloc-family comments

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoutmp: favour POSIX utmpx over SVID utmp
Bernhard Reutner-Fischer [Wed, 25 Mar 2015 22:59:45 +0000 (23:59 +0100)]
utmp: favour POSIX utmpx over SVID utmp

Note: _PATH_UTMPX == _PATH_UTMP and the utmp struct is identical to the
utmpx struct so this only changes the external API entrypoints and NOT
the underlying data source.

This saves about 500b (~1300b from previously ~1950) while at it.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoutmp: Remove unneeded alias
Bernhard Reutner-Fischer [Wed, 25 Mar 2015 22:59:37 +0000 (23:59 +0100)]
utmp: Remove unneeded alias

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agomips: switch float_t to float
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:11:49 +0000 (00:11 +0100)]
mips: switch float_t to float

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibm: honor NO_LONG_DOUBLE in ldouble_wrappers
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:11:47 +0000 (00:11 +0100)]
libm: honor NO_LONG_DOUBLE in ldouble_wrappers

Fixes SH build breakage due to attempts to define hidden defs for
unavailable long double functions.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibcrypt: Rename some internal macros
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:11:44 +0000 (00:11 +0100)]
libcrypt: Rename some internal macros

to avoid clashes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: fix IS_IN_lib* for .s
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:11:41 +0000 (00:11 +0100)]
buildsys: fix IS_IN_lib* for .s

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoutmp: indent
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:11:38 +0000 (00:11 +0100)]
utmp: indent

indent only, no code changes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoutmp: Remove unneeded aliases
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:11:28 +0000 (00:11 +0100)]
utmp: Remove unneeded aliases

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoutmp: add _unlocked suffix to internal helpers
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:11:24 +0000 (00:11 +0100)]
utmp: add _unlocked suffix to internal helpers

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: HAS_UTMP (XPG2, SVr4 compat) knob
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:11:21 +0000 (00:11 +0100)]
buildsys: HAS_UTMP (XPG2, SVr4 compat) knob

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: TIME64_COMPAT32 for sparc, mips
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:11:15 +0000 (00:11 +0100)]
libc: TIME64_COMPAT32 for sparc, mips

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoRevert "utent.c, wtent.c: move functions from utxent.c"
Bernhard Reutner-Fischer [Mon, 23 Mar 2015 23:09:45 +0000 (00:09 +0100)]
Revert "utent.c, wtent.c: move functions from utxent.c"

This reverts commit 84135275cfeebc0b233c1c96eeada4d4178a0b18.

This change is said to make systemd deadlock (cannot reproduce this)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Conflicts:
include/utmp.h

9 years agotest: add utmpx test
Bernhard Reutner-Fischer [Sun, 22 Mar 2015 13:47:29 +0000 (14:47 +0100)]
test: add utmpx test

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: add getrandom(2)
Bernhard Reutner-Fischer [Sun, 22 Mar 2015 13:47:29 +0000 (14:47 +0100)]
libc: add getrandom(2)

Introduce a <sys/random.h> for it.

/* FIXME: aren't there a couple of __restrict and const missing ?
 */
extern int getrandom(void *__buf, size_t count, unsigned int flags)
    __nonnull ((1)) __wur;

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibrt: Use -nodefaultlibs instead of -nostdlib
Khem Raj [Sat, 23 Jun 2012 23:51:52 +0000 (16:51 -0700)]
librt: Use -nodefaultlibs instead of -nostdlib

nostdlib disables linking in startup files too which is not
what we want here since it needs to resolve __dso_handle
which comes from crtbeginS.o, otherwise librt has this
undefined reference to a weak undefined __dso_handle that
shows up as error (with gold linker)
when shared libraries are being built which are
linking in librt

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agonptl/atfork: Hide pthread_atfork in shared versions
Khem Raj [Sat, 23 Jun 2012 22:59:01 +0000 (15:59 -0700)]
nptl/atfork: Hide pthread_atfork in shared versions

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: Fix vfprintf compilation without HAS_FLOATS
Bernhard Reutner-Fischer [Sun, 22 Mar 2015 13:47:29 +0000 (14:47 +0100)]
libc: Fix vfprintf compilation without HAS_FLOATS

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agonptl/arm: Move aeabi_read_tp to uclibc_nonshared.a
Khem Raj [Sat, 23 Jun 2012 21:21:17 +0000 (14:21 -0700)]
nptl/arm: Move aeabi_read_tp to uclibc_nonshared.a

Otherwise it creates wrong references from shared libs

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoatexit_old: Do not add it to shared libc
Khem Raj [Sat, 23 Jun 2012 20:26:30 +0000 (13:26 -0700)]
atexit_old: Do not add it to shared libc

atexit should only be in either uclibc_nonshared.a
shared libc case or libc.a in static build case

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: enable libm test log2
Bernhard Reutner-Fischer [Sun, 22 Mar 2015 13:47:29 +0000 (14:47 +0100)]
test: enable libm test log2

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoextra: add clang flags for gen_bits_syscall_h
Bernhard Reutner-Fischer [Sun, 22 Mar 2015 13:47:29 +0000 (14:47 +0100)]
extra: add clang flags for gen_bits_syscall_h

Closes bugzilla #6008

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agomalloc.h: Add missing feature guard
Bernhard Reutner-Fischer [Wed, 18 Mar 2015 22:12:58 +0000 (23:12 +0100)]
malloc.h: Add missing feature guard

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agomalloc-standard: Add locking to malloc_trim
Bernhard Reutner-Fischer [Wed, 18 Mar 2015 22:11:39 +0000 (23:11 +0100)]
malloc-standard: Add locking to malloc_trim

Closes bugzilla #4586

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agomalloc: checked_request2size failure deadlocks
Zhiqiang Zhang [Wed, 18 Mar 2015 10:44:50 +0000 (18:44 +0800)]
malloc: checked_request2size failure deadlocks

For some rarely cases(almost App bugs), calling malloc with
a very largre size, checked_request2size check will fail,set
ENOMEM, and return 0 to caller.

But this will let __malloc_lock futex locked and owned by the
caller. In multithread circumstance, other thread calling
malloc/calloc will NOT succeed and get locked.

Signed-off-by: Zhiqiang Zhang <zhangzhiqiang.zhang@huawei.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibm: Add missing C99 float/ld wrappers
Bernhard Reutner-Fischer [Wed, 18 Mar 2015 21:32:22 +0000 (22:32 +0100)]
libm: Add missing C99 float/ld wrappers

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: skip arc4random on glibc
Bernhard Reutner-Fischer [Wed, 18 Mar 2015 21:32:13 +0000 (22:32 +0100)]
test: skip arc4random on glibc

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: fix IS_IN_lib* for .i
Bernhard Reutner-Fischer [Wed, 18 Mar 2015 21:31:53 +0000 (22:31 +0100)]
buildsys: fix IS_IN_lib* for .i

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: update strverscmp
Bernhard Reutner-Fischer [Tue, 17 Mar 2015 20:19:10 +0000 (21:19 +0100)]
libc: update strverscmp

Closes bugzilla #7936

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agonptl: fix exclusion of pthread_setconcurrency.c
Bernhard Reutner-Fischer [Tue, 17 Mar 2015 19:56:17 +0000 (20:56 +0100)]
nptl: fix exclusion of pthread_setconcurrency.c

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoinclude: silence __leaf warning
Bernhard Reutner-Fischer [Tue, 17 Mar 2015 19:54:58 +0000 (20:54 +0100)]
include: silence __leaf warning

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: Tweak arc4random exclusion
Bernhard Reutner-Fischer [Tue, 17 Mar 2015 19:54:38 +0000 (20:54 +0100)]
test: Tweak arc4random exclusion

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoresolv: fix unaligned tmp buffer corner-case
Alexey Brodkin [Wed, 11 Mar 2015 23:21:12 +0000 (02:21 +0300)]
resolv: fix unaligned tmp buffer corner-case

On execution of "inet/gethost_r-align" test I noticed failure due
to unaligned access (instaed of 4-byte aligned 1-byte aligned
address was attempted to be accessed).

Further investigation confirmed this nice and helpful test failure.
Following commit removed usage of ALIGN_BUFFER_OFFSET on entry to
__read_etc_hosts_r():
http://git.uclibc.org/uClibc/commit/?id=f65e66078b9f4d2d7f0fc336dee36e78fc467c0f

So indeed if target architecture doesn't allow unaligned access
and provided tmp buffer is not word aligned (and we will deal with pointers
which means word-sized data units), then CPU will fail during execution.

In case of ARC we'll see "Unaligned access" exception like this:
 --->8---
 # potentially unexpected fatal signal 7.
 Path: /root/uClibc/test/inet/gethost_r-align
 CPU: 0 PID: 5514 Comm: gethost_r-align Not tainted 3.13.11 #2
 task: 8f42a580 ti: 8f40e000 task.ti: 8f40e000

 [ECR   ]: 0x00230400 => Misaligned r/w from 0x5fdab341
 [EFA   ]: 0x5fdab341
 [BLINK ]: 0x20032a18
 [ERET  ]: 0x20032a3c
     @off 0x12a3c in [/lib/libuClibc-0.9.34-git.so]
     VMA: 0x20020000 to 0x20062000
 [STAT32]: 0x00000086 : U         E2 E1
 BTA: 0x20046014  SP: 0x5fdab260  FP: 0x00000000
 LPS: 0x20046064 LPE: 0x20046068 LPC: 0x00000000
 r00: 0x5fdab341 r01: 0x00000005 r02: 0x00000015
 r03: 0x00000000 r04: 0x5fdab358 r05: 0x00000000
 r06: 0x0a0a0a00 r07: 0x00000000 r08: 0x0000003f
 r09: 0x20067050 r10: 0x00000000 r11: 0x00000014
 r12: 0x00000001 r13: 0x00000000 r14: 0x20060660
 r15: 0x20060661 r16: 0x00000006 r17: 0x5fdab371
 r18: 0x00000018 r19: 0x5fdab2b4 r20: 0x00020000
 r21: 0x00000000 r22: 0x00029068 r23: 0x5fdab371
 r24: 0x00010000 r25: 0x00000000
 --->8---

To fix this problem we'll re-introduce tmp buffer force alignment
before config parser invocation.

Signed-off-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agounistd.h: put getppid under XOPEN2K8
Bernhard Reutner-Fischer [Fri, 13 Mar 2015 20:03:10 +0000 (21:03 +0100)]
unistd.h: put getppid under XOPEN2K8

Add __LEAF to all __THROW, introduce non-leaf __THROWNL
Adjust affected spots accordingly.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: create linker script with proper flags
Bernhard Reutner-Fischer [Wed, 11 Mar 2015 21:59:51 +0000 (22:59 +0100)]
buildsys: create linker script with proper flags

We were not passing the correct use-ld and -m{32,64,...} when creating
the linker script. Revisit for gold later on anyway.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agospawn.h: Fix !_GNU_SOURCE compilation
Bernhard Reutner-Fischer [Wed, 11 Mar 2015 21:58:32 +0000 (22:58 +0100)]
spawn.h: Fix !_GNU_SOURCE compilation

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agosparc/clone.S: guard tcb-offsets.h include with RESET_PID
Gustavo Zacarias [Tue, 3 Mar 2015 18:04:45 +0000 (15:04 -0300)]
sparc/clone.S: guard tcb-offsets.h include with RESET_PID

Otherwise we have a broken scenario with non-threading builds.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: silence warning
Bernhard Reutner-Fischer [Fri, 27 Feb 2015 18:50:09 +0000 (19:50 +0100)]
libc: silence warning

include/bits/sigset.h:219:62: warning: right-hand operand of comma expression has no effect [-Wunused-value]
include/bits/sigset.h:210:63: warning: right-hand operand of comma expression has no effect [-Wunused-value]

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoldso: silence warning
Bernhard Reutner-Fischer [Fri, 27 Feb 2015 09:41:30 +0000 (10:41 +0100)]
ldso: silence warning

In file included from ldso/ldso/ldso.c:87:0:
ldso/ldso/dl-startup.c: In function '_dl_start':
ldso/ldso/dl-startup.c:184:32: warning: cast from pointer to integer of differennt size [-Wpointer-to-int-cast]
   auxvt[AT_BASE].a_un.a_val =  (Elf32_Addr) &_begin;

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoldso: silence warning
Bernhard Reutner-Fischer [Fri, 20 Feb 2015 17:52:45 +0000 (18:52 +0100)]
ldso: silence warning

symbol_addr was set but not used

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoAllow use of executable RUNPATH/RPATH when finding libraries.
Steve Ellcey [Fri, 20 Feb 2015 00:03:26 +0000 (16:03 -0800)]
Allow use of executable RUNPATH/RPATH when finding libraries.

This option will modify ldso so that it will use the executables
RUNPATH/RPATH to find to find libraries even though this behavour
is not standard.  Setting this option causes the uclibc dynamic linker
behavour to match the glibc dynamic linker.

Signed-off-by: Steve Ellcey <sellcey@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: Remove unused EM_ARC_A5
Vineet Gupta [Fri, 20 Feb 2015 11:43:26 +0000 (17:13 +0530)]
ARC: Remove unused EM_ARC_A5

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoinclude/elf.h: bump EM_NUM
Bernhard Reutner-Fischer [Fri, 20 Feb 2015 11:35:36 +0000 (12:35 +0100)]
include/elf.h: bump EM_NUM

and remove a few ancient entries

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoelf: Add STT_GNU_IFUNC from glibc
Vineet Gupta [Fri, 20 Feb 2015 09:57:08 +0000 (15:27 +0530)]
elf: Add STT_GNU_IFUNC from glibc

perf in upstream Linux kernel 3.17 onwards expects STT_GNU_IFUNC
replicate it from glibc

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agosync_file_range: fix standard UCLIBC_SYSCALL_ALIGN_64BIT handling
Vineet Gupta [Thu, 19 Feb 2015 13:44:02 +0000 (19:14 +0530)]
sync_file_range: fix standard UCLIBC_SYSCALL_ALIGN_64BIT handling

Currently UCLIBC_SYSCALL_ALIGN_64BIT is not explicitly handled. Fix that
and make sure the special handling is done for powerpc/xtensa which use
UCLIBC_SYSCALL_ALIGN_64BIT but don't use hole punched syscall handler in
kernel.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoposix_fadvise: handle 2 variants for SYSCALL_ALIGN_64BIT
Vineet Gupta [Thu, 19 Feb 2015 13:44:01 +0000 (19:14 +0530)]
posix_fadvise: handle 2 variants for SYSCALL_ALIGN_64BIT

arm/powerpc/xtensa pass @advice as 2nd arg to syscall (vs. canonical 4th)

Current code however does this for UCLIBC_SYSCALL_ALIGN_64BIT which
powerpc/xtensa also happen to define.

This is not true for ARCv2 ISA and possibly other arch of future with
64-bit even register requirement, which uses the standard syscall
handler in kernel.

Fix that by providing 2 variants of SYSCALL_ALIGN_64BIT

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARCv2: optimised string routines
Vineet Gupta [Thu, 19 Feb 2015 13:44:00 +0000 (19:14 +0530)]
ARCv2: optimised string routines

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARCv2 ISA support
Vineet Gupta [Thu, 19 Feb 2015 13:43:59 +0000 (19:13 +0530)]
ARCv2 ISA support

This is next gen Instruction Set Architecture from Synopsys and basis
for the ARC HS family of processors.

http://www.synopsys.com/dw/ipdir.php?ds=arc-hs38-processor&elq_mid=5732&elq_cid=458802
http://www.synopsys.com/IP/ProcessorIP/ARCProcessors/arc-hs/Pages/default.aspx

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: Add GNU glob to ARC defconfigs
Anton Kolesov [Wed, 4 Feb 2015 12:34:51 +0000 (15:34 +0300)]
ARC: Add GNU glob to ARC defconfigs

GNU glob is required by make.

Signed-off-by: Anton Kolesov <anton.kolesov@synopsys.com>
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: add setns()
Bernhard Reutner-Fischer [Tue, 17 Feb 2015 22:41:47 +0000 (23:41 +0100)]
libc: add setns()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoAdd eventfd_read() and eventfd_write()
Khem Raj [Thu, 20 Feb 2014 08:30:18 +0000 (00:30 -0800)]
Add eventfd_read() and eventfd_write()

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agosignal.h: elide memset from sigemptyset
Vineet Gupta [Sat, 14 Feb 2015 09:55:44 +0000 (15:25 +0530)]
signal.h: elide memset from sigemptyset

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: sigaction: inline syscall trap
Vineet Gupta [Sat, 14 Feb 2015 09:55:42 +0000 (15:25 +0530)]
ARC: sigaction: inline syscall trap

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: sigaction: fold default sigrestorer into "C"
Vineet Gupta [Sat, 14 Feb 2015 09:55:43 +0000 (15:25 +0530)]
ARC: sigaction: fold default sigrestorer into "C"

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: siagction: opencode memcpy
Vineet Gupta [Sat, 14 Feb 2015 09:55:41 +0000 (15:25 +0530)]
ARC: siagction: opencode memcpy

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: remove stale TRUNCATE64_HAS_4_ARGS
Vineet Gupta [Sat, 14 Feb 2015 09:55:40 +0000 (15:25 +0530)]
ARC: remove stale TRUNCATE64_HAS_4_ARGS

Not relevant anymore since commit e8cc14e59ed3f66b84e,
"libc: rename TRUNCATE64_HAS_4_ARGS to SYSCALL_ALIGN_64BIT"

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC defconfigs: enable some items
Alexey Brodkin [Sat, 14 Feb 2015 09:55:39 +0000 (15:25 +0530)]
ARC defconfigs: enable some items

perf: UCLIBC_HAS_GLIBC_CUSTOM_STREAMS
elfutils: UCLIBC_HAS_PROGRAM_INVOCATION_NAME

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: add configuration option for MMU page size
Alexey Brodkin [Sat, 14 Feb 2015 09:55:38 +0000 (15:25 +0530)]
ARC: add configuration option for MMU page size

ARC CPU may have MMU page size of 4/8(default)/16k.
uClibc needs to have page size configured accodring to HW it will be run on.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoARC: Conditionalise certain relocations as provided by TLS tools only
Vineet Gupta [Sat, 14 Feb 2015 09:55:37 +0000 (15:25 +0530)]
ARC: Conditionalise certain relocations as provided by TLS tools only

uClibc mainline supports NPTL which in turns depends on TLS support in
the tools (gcc/binutils), which is yet to be merged in dev branches.

However there is some non NPTL code in uClibc, added as part of NPTL
effort, which relies on certain relocations only provided by NPTL
binutils. As a result building the current upstream even for LT.old
breaks.

So conditionalize that code on tools, bu tin lack of specific versions,
we use NPTL enabling as a sign the tools are equipped to handle those
relos.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoUpdate MIPS configuration rules.
Steve Ellcey [Wed, 28 Jan 2015 22:56:07 +0000 (14:56 -0800)]
Update MIPS configuration rules.

Add a configuration choice for the NaN format on MIPS (either the
standard (legacy) format or the newer IEEE 2008 format.

Change how CPU_LDFLAGS are set for MIPS.  Use the same value as
CPU_CFLAGS since CC is used to do linking.  This ensures consistency
between compiles and links and adds support for N32 ABI to linking.

Signed-off-by: Steve Ellcey <sellcey@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agobuildsys: fix IS_IN_lib* for out-of-tree builds
Bernhard Reutner-Fischer [Wed, 28 Jan 2015 09:50:34 +0000 (10:50 +0100)]
buildsys: fix IS_IN_lib* for out-of-tree builds

41537a770b46f2376e74af58ba4885749339e81e erroneously stripped the
top_builddir off the per-directory flag setting which works fine for
in-tree builds but is not correct for O=
Just use the full path of the target files to apply the flags to fix
that thinko.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: sync_file_range missing comma
Bernhard Reutner-Fischer [Mon, 26 Jan 2015 15:50:29 +0000 (16:50 +0100)]
libc: sync_file_range missing comma

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: ppc64 etc: Fix sync_file_range
Bernhard Reutner-Fischer [Sat, 24 Jan 2015 19:50:02 +0000 (20:50 +0100)]
libc: ppc64 etc: Fix sync_file_range

Fix copy'n paste error for ppc64 and other sync_file_range2 arches

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoxtensa: ldso: drop unused address calculation from _dl_linux_resolve
Max Filippov [Sat, 10 Jan 2015 03:48:37 +0000 (06:48 +0300)]
xtensa: ldso: drop unused address calculation from _dl_linux_resolve

The result of the calculation in register a12 is never used as the
function _dl_linux_resolver only accepts 2 arguments. Drop it.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoxtensa: ldso: coalesce dl_mprotect address ranges
Max Filippov [Sat, 10 Jan 2015 01:42:42 +0000 (04:42 +0300)]
xtensa: ldso: coalesce dl_mprotect address ranges

This noticeably lowers the number of mprotect calls at program startup,
e.g. for busybox: 7 calls vs 1835 calls.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoadd argument check in mknod
Wang Yufen [Tue, 11 Nov 2014 07:59:11 +0000 (15:59 +0800)]
add argument check in mknod

mknod() in glibc/eglibc will check the argument, like this,
  ...
  if (k_dev != dev) {
      __set_errno (EINVAL);
      return -1;
   }
  ...
So add argument check in uclibc's mknod() too.

Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agoadd argument check in setenv()
Xishi Qiu [Tue, 4 Nov 2014 11:26:28 +0000 (19:26 +0800)]
add argument check in setenv()

setenv() in glibc/eglibc will check the argument, like this,
  ...
  if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
    {
      __set_errno (EINVAL);
      return -1;
    }
  ...
So add argument check in uclibc's setenv() too.

Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agonptl: compile pt-vfork in ARM-mode
Bernhard Reutner-Fischer [Fri, 23 Jan 2015 14:47:02 +0000 (15:47 +0100)]
nptl: compile pt-vfork in ARM-mode

amending commit 49a67cf67d5a7194214566bc730ee7e28d55bbe1
could need a thumb implementation..

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibc: Avoid redundant setting of ENOMEM
Bernhard Reutner-Fischer [Mon, 19 Jan 2015 21:49:10 +0000 (22:49 +0100)]
libc: Avoid redundant setting of ENOMEM

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agolibcrypt: return NULL on unsupported salt
Bernhard Reutner-Fischer [Mon, 19 Jan 2015 16:24:19 +0000 (17:24 +0100)]
libcrypt: return NULL on unsupported salt

BZ #7808 asks us not to fallback to DES if the optional SHA are disabled
but requested by the user.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agotest: Adjust passed options
Bernhard Reutner-Fischer [Wed, 7 Jan 2015 12:26:42 +0000 (13:26 +0100)]
test: Adjust passed options

to follow suit 067637375658047d70c296606ae17ef0bc86499d

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9 years agomkostemp: fix implementation
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>