OSDN Git Service

uclinux-h8/uclibc-ng.git
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>
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>