OSDN Git Service

uclinux-h8/uClibc.git
11 years agobuildsys: use kbuild style, fix omission
Bernhard Reutner-Fischer [Mon, 14 Jan 2013 13:27:58 +0000 (14:27 +0100)]
buildsys: use kbuild style, fix omission

forgot this hunk in d0234b16d61f06b2a3fd6241eff8c81250283a60

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: use kbuild style
Bernhard Reutner-Fischer [Thu, 10 Jan 2013 16:02:39 +0000 (17:02 +0100)]
buildsys: use kbuild style

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: remove superfluous default n
Bernhard Reutner-Fischer [Thu, 10 Jan 2013 09:51:16 +0000 (10:51 +0100)]
buildsys: remove superfluous default n

kconfig's default defaults to n so spelling out default n is redundant

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc: add {get,set,swap,make}context user context manipulation functions
Florian Fainelli [Wed, 9 Jan 2013 15:17:21 +0000 (16:17 +0100)]
libc: add {get,set,swap,make}context user context manipulation functions

Add the obsolescent SUSv3 family of user context manipulating functions
for arm, i386, mips, x86_64.

Signed-off-by: Timon ter Braak <timonterbraak@gmail.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agodl: fix dlsym lookups with RTLD_NEXT
Timo Teräs [Tue, 8 Jan 2013 09:55:26 +0000 (11:55 +0200)]
dl: fix dlsym lookups with RTLD_NEXT

The current code for dlsym() when invoked with RTLD_NEXT lookup
searches for the module where it's being called from, and executes the
_dl_find_hash only for the next module in the chain. However, if the
looked symbol is not there, the rest of the modules are not checked.

Generally this is not a problem as symbols are merged for the parent
modules; so this affects only RTLD_NEXT.

This patch adds a loop iterating through all the following modules.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Reviewed-by: Filippo ARCIDIACONO <filippo.arcidiacono@st.com>
Tested-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: prevent make from searching for .config
Bernhard Reutner-Fischer [Tue, 8 Jan 2013 11:07:14 +0000 (12:07 +0100)]
buildsys: prevent make from searching for .config

Fixes:
make distclean
mkdir /.config
make -C test/API clean
Reading makefile `../../.config' (search path) (don't care) (no ~ expansion)...
make: *** ../../.config: Is a directory.  Stop.

write(1, "Reading makefile `../../.config'"..., 80) = 80
open("../../.config", O_RDONLY)         = -1 ENOENT (No such file or directory)
open("/usr/include/../../.config", O_RDONLY) = 6
fstat(6, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
read(6, 0x7f2fe3bfc000, 4096)           = -1 EISDIR (Is a directory)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoarm: workaround GCC PR target/53735 with fork()
Bernhard Reutner-Fischer [Tue, 8 Jan 2013 08:43:01 +0000 (09:43 +0100)]
arm: workaround GCC PR target/53735 with fork()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc: handle sync_file_range
Bernhard Reutner-Fischer [Mon, 18 Jun 2012 09:18:10 +0000 (11:18 +0200)]
libc: handle sync_file_range

Add cancellation and support arm, ppc64, mips32.
Compile-tested.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoarm: clone: restore stack pointer just after return from syscall
Filippo Arcidiacono [Mon, 10 Dec 2012 08:50:52 +0000 (09:50 +0100)]
arm: clone: restore stack pointer just after return from syscall

If the syscall returns with an error the stack pointer and r4 register
are not restored because the instruction 'ldmnefd sp!, {r4}' is executed
after branching to '__error' label.
This bug has been spotted out by running './utstest clone 5' from LTP
built with -fstack-protector-all compiler flag as log below:

root@cortex-a9:/usr/tests/ltp/testcases/bin# ./utstest clone 5
stack smashing detected: ./utstest terminated()

Regression introduced by commit e58798e107d652644629a1daaa95d76430808d53

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Giuseppe Di Giore <giuseppe.di-giore@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
11 years agoxtensa: fix setjmp that didn't save all registers correctly
Chris Zankel [Wed, 5 Dec 2012 22:00:44 +0000 (14:00 -0800)]
xtensa: fix setjmp that didn't save all registers correctly

Setjmp was only saving the lower order of registers (a0-a3) correctly, but
not the higher ones (a4-a8/a12).
The change also includes additional information, and renames many of the
registers, so that setjmp and longjmp look more like the inverse of
each other.

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agosched.h: include stdlib.h for malloc/free
Bernhard Reutner-Fischer [Sat, 24 Nov 2012 17:26:00 +0000 (18:26 +0100)]
sched.h: include stdlib.h for malloc/free

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoupdate ptrace.h to latest from glibc
James Hogan [Fri, 30 Nov 2012 10:08:13 +0000 (10:08 +0000)]
update ptrace.h to latest from glibc

Update libc/sysdeps/linux/common/sys/ptrace.h to latest from glibc's
sysdeps/unix/sysv/linux/sys/ptrace.h.

This adds definitions for operations:
 - PTRACE_GETREGSET
 - PTRACE_SETREGSET
 - PTRACE_SEIZE
 - PTRACE_INTERRUPT
 - PTRACE_LISTEN

And adds flags:
 - PTRACE_SEIZE_DEVEL

And adds event codes:
 - PTRACE_EVENT_SECCOMP

This is to allow access to the generic interface for accessing
architecture specific regsets using the corresponding NT_* types,
required for new Linux kernel architecture ports.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agolibc/stdlib: localize __unix_grantpt
Mike Frysinger [Fri, 30 Nov 2012 01:32:02 +0000 (20:32 -0500)]
libc/stdlib: localize __unix_grantpt

When ASSUME_DEVPTS is disabled, we end up exporting __unix_grantpt and
get a reloc to it from grantpt.  Mark it static to fix all of that.

Reported-by: Michael Deutschmann <michael@talamasca.ocis.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agodrop support for pre ISO-C compilers
Mike Frysinger [Sun, 18 Nov 2012 11:17:03 +0000 (06:17 -0500)]
drop support for pre ISO-C compilers

This drops __signed, __volatile, and __const.  Only the latter was
used in the code base, and for uClibc, not consistently.  Much of
the code used plain "const" which meant "__const" was useless.

Really, the point of this is to stay in sync with what glibc did.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoReplace FSF snail mail address with URLs
Mike Frysinger [Sun, 18 Nov 2012 11:03:05 +0000 (06:03 -0500)]
Replace FSF snail mail address with URLs

This matches a similar change made to glibc.

No functional changes here.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoAVR32: declare missing result variable
Felix Fietkau [Fri, 21 Sep 2012 15:29:13 +0000 (17:29 +0200)]
AVR32: declare missing result variable

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agonptl: fix gcc noreturn warning
Mike Frysinger [Sun, 18 Nov 2012 09:49:32 +0000 (04:49 -0500)]
nptl: fix gcc noreturn warning

Current builds show the warning:
  CC libpthread/nptl/pthread_create.os
libpthread/nptl/pthread_create.c: In function 'start_thread':
libpthread/nptl/pthread_create.c:418:3: warning: function declared
'noreturn' has a 'return' statement [enabled by default]
libpthread/nptl/pthread_create.c:418:3: warning: 'noreturn' function
does return [enabled by default]

Looking at glibc, it does not mark this function as noreturn.  Testing
code size, gcc is smart enough to detect the code never actually returns
regardless of the attribute.  So drop it to keep in sync with glibc and
to avoid the warnings.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agonptl: fix gcc noreturn warning
Mike Frysinger [Sun, 18 Nov 2012 09:49:32 +0000 (04:49 -0500)]
nptl: fix gcc noreturn warning

Current builds show the warning:
  CC libpthread/nptl/sysdeps/unix/sysv/linux/mq_notify.os
libpthread/nptl/sysdeps/unix/sysv/linux/mq_notify.c: In function 'helper_thread':
libpthread/nptl/sysdeps/unix/sysv/linux/mq_notify.c:142:3: warning:
function declared 'noreturn' has a 'return' statement [enabled by default]

Looking at glibc, it does not mark this function as noreturn.  Testing
code size, gcc is smart enough to detect the while(1){} never actually
returns regardless of the attribute.  So drop it to keep in sync with
glibc and to avoid the warning.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoldso: include dlfcn.h for RTLD_NODELETE
Mike Frysinger [Sun, 18 Nov 2012 09:41:06 +0000 (04:41 -0500)]
ldso: include dlfcn.h for RTLD_NODELETE

Building with NPTL enabled and shared library support disabled we hit:
In file included from libpthread/nptl/sysdeps/generic/dl-tls.c:30:0:
./ldso/include/dl-elf.h: In function '__dl_parse_dynamic_info':
./ldso/include/dl-elf.h:173:20: error: 'RTLD_NODELETE' undeclared (first use in this function)
./ldso/include/dl-elf.h:173:20: note: each undeclared identifier is reported only once for each function it appears in
make: *** [libpthread/nptl/sysdeps/generic/dl-tls.os] Error 1

A previous commit (f26c5f6952ce9bf8edec9c1571c47addb1bcc442) touched
on a similar issue, but added the include to the incorrect location.

Reported-by: Christophe Lyon <christophe.lyon@st.com> [arm nommu]
Reported-by: Daniel Beecham <daniel@lunix.se> [static x86_64]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agostring/microblaze: fix preprocessor style
Mike Frysinger [Sat, 17 Nov 2012 20:45:37 +0000 (15:45 -0500)]
string/microblaze: fix preprocessor style

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agolibc/sysdeps: dup3: check for __NR_dup3 since older kernels/arches lack it
Mike Frysinger [Sat, 17 Nov 2012 20:29:16 +0000 (15:29 -0500)]
libc/sysdeps: dup3: check for __NR_dup3 since older kernels/arches lack it

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoinclude/elf.h: update for ELFOSABI_* changes.
Thomas Schwinge [Wed, 31 Oct 2012 19:41:50 +0000 (20:41 +0100)]
include/elf.h: update for ELFOSABI_* changes.

ELFOSABI_GNU replaces ELFOSABI_LINUX, the latter is kept as a compatibility
alias, and ELFOSABI_HURD is removed.  See the table on
<http://www.sco.com/developers/gabi/latest/ch4.eheader.html#osabi> for
reference.

Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/stdlib: add mkostemp helpers
Mike Frysinger [Wed, 14 Nov 2012 05:30:54 +0000 (00:30 -0500)]
libc/stdlib: add mkostemp helpers

Some projects (like udev) are starting to use this.

Imported from glibc.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agolibc/sysdeps: add dup3 syscall wrapper
Mike Frysinger [Wed, 14 Nov 2012 05:08:18 +0000 (00:08 -0500)]
libc/sysdeps: add dup3 syscall wrapper

Some projects (like udev) are starting to use this.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoinclude/: ignore more symlinks
Mike Frysinger [Wed, 14 Nov 2012 05:07:03 +0000 (00:07 -0500)]
include/: ignore more symlinks

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agotest/math: add libm-test-ulps-xtensa file
Chris Zankel [Wed, 7 Nov 2012 00:40:15 +0000 (16:40 -0800)]
test/math: add libm-test-ulps-xtensa file

Add ulps file for Xtensa for the math test.

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agostring/microblaze: Fix for little-endian
Steve Bennett [Fri, 21 Sep 2012 05:38:41 +0000 (15:38 +1000)]
string/microblaze: Fix for little-endian

Fix the asm-optimised memcpy and memmove so they
work for little-endian as well as big-endian.

Testing has shown no issues, but I am not a microblaze
asm expert so YMMV.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agomicroblaze/bits/setjmp.h: Fix stray #endif
Steve Bennett [Fri, 21 Sep 2012 05:35:05 +0000 (15:35 +1000)]
microblaze/bits/setjmp.h: Fix stray #endif

Introduced in c53099f7

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoxtensa: add missing atomic intrinsics
Chris Zankel [Thu, 18 Oct 2012 00:46:43 +0000 (17:46 -0700)]
xtensa: add missing atomic intrinsics

Add more atomic intrinsics. These are mostly non 32-bit versions, which
are not support by Xtensa. This file needs some more clean-up and
consolidation.

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: sysdep.h needs to include sys/syscall.h
Chris Zankel [Thu, 18 Oct 2012 00:45:03 +0000 (17:45 -0700)]
xtensa: sysdep.h needs to include sys/syscall.h

The Xtensa version of sysdep.h didn't include sys/syscall.h. This header
file is, for example, needed by not-cancel.h, which uses the
INTERNAL_SYSCALL macro.

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: add a stub user.h file
Chris Zankel [Wed, 17 Oct 2012 23:15:07 +0000 (16:15 -0700)]
xtensa: add a stub user.h file

Xtensa only supports the ELF binary format, so the user.h file isn't
needed. However, it's included by other files, so provide a stub user.h.

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoldd: ELFCLASSM was not defined for the Xtensa architecture
Chris Zankel [Wed, 17 Oct 2012 23:13:15 +0000 (16:13 -0700)]
ldd: ELFCLASSM was not defined for the Xtensa architecture

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: fix a misnumbered register in sigsetjmp
Chris Zankel [Wed, 17 Oct 2012 23:11:19 +0000 (16:11 -0700)]
xtensa: fix a misnumbered register in sigsetjmp

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: add a set of atomic intrinsics
Chris Zankel [Wed, 17 Oct 2012 23:08:38 +0000 (16:08 -0700)]
xtensa: add a set of atomic intrinsics

Add a new file that provides various atomic intrinsics, which use the
conditional store instruction.

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: use atomic instructions instead of a syscall
Chris Zankel [Wed, 17 Oct 2012 23:02:01 +0000 (16:02 -0700)]
xtensa: use atomic instructions instead of a syscall

Replace system calls with atomic instructions for 'compare and swap'
in linuxthreads.old.

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years agoxtensa: add sigcontext.h
Chris Zankel [Wed, 17 Oct 2012 23:01:24 +0000 (16:01 -0700)]
xtensa: add sigcontext.h

Signed-off-by: Chris Zankel <chris@zankel.net>
11 years ago_scanf.c: Implement 'm' modifier for 'c' and '[' conversions.
Will Newton [Tue, 16 Oct 2012 10:54:39 +0000 (11:54 +0100)]
_scanf.c: Implement 'm' modifier for 'c' and '[' conversions.

The current code implements the 'm' modifier only for 's'
conversions and would cause a segfault if it was used for 'c'
or '[' conversions. This patch extends the code to cover these
cases too.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoutils: Fix missing semicolon
Bernhard Reutner-Fischer [Wed, 31 Oct 2012 14:18:58 +0000 (15:18 +0100)]
utils: Fix missing semicolon

Thanks to Manuel Rüger for spotting this one.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years ago__uclibc_main: remove stray trailing space
Bernhard Reutner-Fischer [Wed, 31 Oct 2012 09:17:41 +0000 (10:17 +0100)]
__uclibc_main: remove stray trailing space

test post-receive hook

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agotest: Fix some warnings in inet
Bernhard Reutner-Fischer [Mon, 29 Oct 2012 12:16:02 +0000 (13:16 +0100)]
test: Fix some warnings in inet

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agotest: handle !DO_C99_MATH
Bernhard Reutner-Fischer [Mon, 29 Oct 2012 12:08:07 +0000 (13:08 +0100)]
test: handle !DO_C99_MATH

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/sysdeps: add __kernel_long and __kernel_ulong
Chris Packham [Mon, 1 Oct 2012 05:12:54 +0000 (18:12 +1300)]
libc/sysdeps: add __kernel_long and __kernel_ulong

Linux 3.4 added __kernel_long_t and __kernel_ulong_t and various
exported header files were updated to use these new types. Add the
definitions for __kernel_long_t and __kernel_ulong_t to the relevant
kernel_types.h headers.

This change was automated with the following scriptlet

  git grep --name-only 'typedef.*__kernel_old_dev_t' \
    | xargs sed -i '/typedef.*__kernel_old_dev_t/ a\
  typedef long\t\t__kernel_long_t;\
  typedef unsigned long\t__kernel_ulong_t;'

Whitespace in arm, avr32, hppa, sparc was then manually fixed up.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
--
Here's a cleaned up patch which should get the whitespace right. I'm a
bit iffy about the sparc changes they make sense to me but it's not a
platform I have access to.

I can break this up per arch or per maintainer if requested.

 libc/sysdeps/linux/alpha/bits/kernel_types.h      |    2 ++
 libc/sysdeps/linux/arm/bits/kernel_types.h        |    2 ++
 libc/sysdeps/linux/avr32/bits/kernel_types.h      |    2 ++
 libc/sysdeps/linux/bfin/bits/kernel_types.h       |    2 ++
 libc/sysdeps/linux/c6x/bits/kernel_types.h        |    2 ++
 libc/sysdeps/linux/cris/bits/kernel_types.h       |    2 ++
 libc/sysdeps/linux/e1/bits/kernel_types.h         |    2 ++
 libc/sysdeps/linux/h8300/bits/kernel_types.h      |    2 ++
 libc/sysdeps/linux/hppa/bits/kernel_types.h       |    2 ++
 libc/sysdeps/linux/i386/bits/kernel_types.h       |    2 ++
 libc/sysdeps/linux/ia64/bits/kernel_types.h       |    2 ++
 libc/sysdeps/linux/m68k/bits/kernel_types.h       |    2 ++
 libc/sysdeps/linux/microblaze/bits/kernel_types.h |    2 ++
 libc/sysdeps/linux/mips/bits/kernel_types.h       |    4 ++++
 libc/sysdeps/linux/nios2/bits/kernel_types.h      |    2 ++
 libc/sysdeps/linux/powerpc/bits/kernel_types.h    |    4 ++++
 libc/sysdeps/linux/sh/bits/kernel_types.h         |    2 ++
 libc/sysdeps/linux/sh64/bits/kernel_types.h       |    2 ++
 libc/sysdeps/linux/sparc/bits/kernel_types.h      |    4 ++++
 libc/sysdeps/linux/v850/bits/kernel_types.h       |    2 ++
 libc/sysdeps/linux/x86_64/bits/kernel_types.h     |    2 ++
 libc/sysdeps/linux/xtensa/bits/kernel_types.h     |    2 ++
 22 files changed, 50 insertions(+)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibrt: re-add SIGCANCEL to the list of blocked signal in helper thread
Filippo Arcidiacono [Thu, 12 Jul 2012 07:24:39 +0000 (09:24 +0200)]
librt: re-add SIGCANCEL to the list of blocked signal in helper thread

Indeed if the libpthread is before the libc in the library look up
the SIGCANCEL is removed from the list of the blocked signal by
sigfillset func, this can produce the handler not properly called.
This commit revert what Denys modified in commit
162cfaea20d807f0ae329efe39292a9b22593b41.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
11 years agoi386/bits/syscalls.h: allow immediate values as 6th syscall arg
Natanael Copa [Thu, 5 Jul 2012 11:55:19 +0000 (11:55 +0000)]
i386/bits/syscalls.h: allow immediate values as 6th syscall arg

Allow use of immedate values as the 6th syscall argument. Otherwise we must
store the arg on memory. This gives gcc more options to optimize better.

This also works around an issue with posix_fallocate.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobits/time.h: sync with glibc 2.16
Peter Korsgaard [Tue, 3 Jul 2012 13:54:57 +0000 (15:54 +0200)]
bits/time.h: sync with glibc 2.16

CLOCK_MONOTONIC_RAW is available since 2.6.28
(2d42244ae71d: clocksource: introduce CLOCK_MONOTONIC_RAW), and
CLOCK_*_COARSE since 2.6.32 (da15cfdae033: time: Introduce
CLOCK_REALTIME_COARSE).

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/inet/resolv.c: Use IE model for TLS data.
Will Newton [Fri, 29 Jun 2012 13:48:09 +0000 (14:48 +0100)]
libc/inet/resolv.c: Use IE model for TLS data.

All other TLS data in uClibc is explicitly using the IE model,
so use it for __resp too. This generates smaller and faster
code.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc/inet/resolv.c: Remove obsolete comment.
Will Newton [Fri, 29 Jun 2012 13:42:41 +0000 (14:42 +0100)]
libc/inet/resolv.c: Remove obsolete comment.

The definition of __resp has been hidden for some years (commit
22de495d). Remove the comment suggesting that it is not.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoAccept either __NR__lseek or __NR_lseek
Bernd Schmidt [Tue, 24 Jul 2012 13:41:01 +0000 (15:41 +0200)]
Accept either __NR__lseek or __NR_lseek

In llseek.c, we already allow both variants; the same needs to be done here
to avoid duplicate definitions of lseek64_nocancel.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
11 years agoRemove pragma weak for undeclared symbol
Bernd Schmidt [Tue, 24 Jul 2012 13:39:48 +0000 (15:39 +0200)]
Remove pragma weak for undeclared symbol

pthread_initialize is a static function and should not be mentioned in a
header.  The #pragma weak for it appears to confuse gcc-4.7.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com
11 years agoRemove use of attribute_shared_hidden
Bernd Schmidt [Tue, 24 Jul 2012 13:39:07 +0000 (15:39 +0200)]
Remove use of attribute_shared_hidden

This attribute is not defined anywhere. Removed its use to make the file
compile.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
11 years agonptl: sh: fix race condition in lll_wait_tid
Stas Sergeev [Wed, 13 Jun 2012 23:00:02 +0000 (01:00 +0200)]
nptl: sh: fix race condition in lll_wait_tid

Make a local copy of the tid value to avoid a race condition,
as the value could have been changed to 0, thus using a pointer
it would have been passed to the lll_futex_wait modified.

Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
11 years agoRevert: buildsys: clean up libubacktrace linker script handling
Kevin Cernekee [Mon, 18 Jun 2012 18:52:28 +0000 (20:52 +0200)]
Revert: buildsys: clean up libubacktrace linker script handling

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibubacktrace: temporarily workaround link issue
Bernhard Reutner-Fischer [Fri, 15 Jun 2012 14:32:58 +0000 (16:32 +0200)]
libubacktrace: temporarily workaround link issue

temporarily work around circular dependency in linking that was
introduced by 01c125c3bd8f949f8e5711e09152859eecd1b004

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoremove arm specific sysdep.h from linuxthreads new
Peter S. Mazinger [Tue, 24 May 2011 19:20:38 +0000 (21:20 +0200)]
remove arm specific sysdep.h from linuxthreads new

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoremove sysdep.h from arch specific string implementation
Peter S. Mazinger [Sat, 14 May 2011 18:09:42 +0000 (20:09 +0200)]
remove sysdep.h from arch specific string implementation

Remove hardcoded path from xtensa, we have sysdep.h in path

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoremove cris/fork.c, unused
Peter S. Mazinger [Sat, 14 May 2011 01:58:03 +0000 (03:58 +0200)]
remove cris/fork.c, unused

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoupdate arc4random from bug #885
Peter S. Mazinger [Sat, 14 May 2011 01:29:53 +0000 (03:29 +0200)]
update arc4random from bug #885

Add config option to provide arc4random without device access.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoepoll.c: add cancellation to epoll_[p]wait()
Peter S. Mazinger [Mon, 23 Apr 2012 15:51:25 +0000 (17:51 +0200)]
epoll.c: add cancellation to epoll_[p]wait()

While there, fix epoll_pwait syscall, it takes 6 arguments

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoinclude pthreadP.h for SIGCANCEL
Peter S. Mazinger [Thu, 12 May 2011 21:47:00 +0000 (23:47 +0200)]
include pthreadP.h for SIGCANCEL

based on a patch from Kevin Cernekee <cernekee@gmail.com>

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolinuxthreads.old: build all objects twice, once for shared lib and once for static
Peter S. Mazinger [Thu, 12 May 2011 20:57:33 +0000 (22:57 +0200)]
linuxthreads.old: build all objects twice, once for shared lib and once for static

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agointernals.h: mark __pthread_message hidden
Peter S. Mazinger [Thu, 12 May 2011 20:56:56 +0000 (22:56 +0200)]
internals.h: mark __pthread_message hidden

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolinuxthreads.old: move libpthread_hidden_proto to header
Peter S. Mazinger [Thu, 12 May 2011 20:55:02 +0000 (22:55 +0200)]
linuxthreads.old: move libpthread_hidden_proto to header

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolinuxthreads.old/internals.h: make some internal functions hidden
Peter S. Mazinger [Thu, 12 May 2011 20:53:02 +0000 (22:53 +0200)]
linuxthreads.old/internals.h: make some internal functions hidden

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosignal.h: needs size_t
Peter S. Mazinger [Sun, 8 May 2011 17:06:08 +0000 (19:06 +0200)]
signal.h: needs size_t

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosched.h: update header, needs size_t
Peter S. Mazinger [Sun, 8 May 2011 16:41:45 +0000 (18:41 +0200)]
sched.h: update header, needs size_t

While there, guard __clone[2] with _LIBC

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosigset-cvt-mask.h: add a guard to allow including it twice
Peter S. Mazinger [Sun, 8 May 2011 16:24:49 +0000 (18:24 +0200)]
sigset-cvt-mask.h: add a guard to allow including it twice

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosignal: remove sigblock, siggetmask and sigsetmask
Peter S. Mazinger [Sat, 7 May 2011 22:57:57 +0000 (00:57 +0200)]
signal: remove sigblock, siggetmask and sigsetmask

rcmd.c uses sigblock and sigsetmask, make the function static and include them directly until
a rewrite is done.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobits/types.h: remove thread types, users should include pthread.h
Peter S. Mazinger [Sat, 7 May 2011 22:39:06 +0000 (00:39 +0200)]
bits/types.h: remove thread types, users should include pthread.h

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolinuxthreads: guard *tsd* related stuff correctly
Peter S. Mazinger [Sat, 7 May 2011 22:23:14 +0000 (00:23 +0200)]
linuxthreads: guard *tsd* related stuff correctly

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoerror.c: no need for __error and __error_at_line
Peter S. Mazinger [Sat, 7 May 2011 22:01:29 +0000 (00:01 +0200)]
error.c: no need for __error and __error_at_line

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolinuxthreads: style update
Peter S. Mazinger [Tue, 3 May 2011 21:11:53 +0000 (23:11 +0200)]
linuxthreads: style update

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolinuxthreads: use __UCLIBC_HAS_TLS__ consistently
Peter S. Mazinger [Tue, 3 May 2011 21:04:08 +0000 (23:04 +0200)]
linuxthreads: use __UCLIBC_HAS_TLS__ consistently

replace USE_TLS, HAVE___THREAD and USE___THREAD with __UCLIBC_HAS_TLS__

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agomove __libc_pthread_init prototype to pthread-functions.h
Peter S. Mazinger [Tue, 3 May 2011 21:02:31 +0000 (23:02 +0200)]
move __libc_pthread_init prototype to pthread-functions.h

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoforward.c: no need for attribute_hidden, provided by prototype
Peter S. Mazinger [Tue, 3 May 2011 20:57:34 +0000 (22:57 +0200)]
forward.c: no need for attribute_hidden, provided by prototype

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc_pthread_init.c: include only what is necessary
Peter S. Mazinger [Tue, 3 May 2011 20:54:51 +0000 (22:54 +0200)]
libc_pthread_init.c: include only what is necessary

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolinuxthreads.old: cleanup a bit
Peter S. Mazinger [Wed, 27 Apr 2011 15:07:16 +0000 (17:07 +0200)]
linuxthreads.old: cleanup a bit

Use __UCLIBC_HAS_TLS__ instead of USE___THREADS (although this LT implementation
will never support TLS).
Disable unused/unneeded members of the pthread_functions structure.
No redirect/forward for _pthread_cleanup_push/pop, it would have not worked anyway
due to the fact, that the structure member was not initialized. Disable it's possible
internal use in libc-lock.h.
Avoid using internals.h in libc_pthread_init.c (moving a prototype to pthread-functions.h).

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agofts.c: add a comment about wrong usage of _lfs_64.h
Peter S. Mazinger [Wed, 27 Apr 2011 14:10:29 +0000 (16:10 +0200)]
fts.c: add a comment about wrong usage of _lfs_64.h

This file needs anyway some massage (style update), I'll leave the fix
to the committer.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolinuxthreads.old_db: style update
Peter S. Mazinger [Wed, 27 Apr 2011 13:05:46 +0000 (15:05 +0200)]
linuxthreads.old_db: style update

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoNPTL: rename __new_sem_* to sem_*
Peter S. Mazinger [Tue, 26 Apr 2011 21:47:17 +0000 (23:47 +0200)]
NPTL: rename __new_sem_* to sem_*

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolinuxthreads.old: remove __old_sem_* and rename __new_sem_* to sem_*
Peter S. Mazinger [Tue, 26 Apr 2011 21:35:32 +0000 (23:35 +0200)]
linuxthreads.old: remove __old_sem_* and rename __new_sem_* to sem_*

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosigqueue.c: rewrite a bit
Peter S. Mazinger [Tue, 26 Apr 2011 21:21:32 +0000 (23:21 +0200)]
sigqueue.c: rewrite a bit

Use sizeof(info) instead of sizeof(siginfo_t).
stubs.c: add sigqueue stub.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoadd posix_madvise.c
Peter S. Mazinger [Tue, 26 Apr 2011 21:03:44 +0000 (23:03 +0200)]
add posix_madvise.c

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agochange _NSIG / 8 to __SYSCALL_SIGSET_T_SIZE in common code
Peter S. Mazinger [Tue, 26 Apr 2011 20:51:23 +0000 (22:51 +0200)]
change _NSIG / 8 to __SYSCALL_SIGSET_T_SIZE in common code

Since mips has different kernel sigset_t, use the new macro in common
code that is used by mips as well.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agomake arch specific cacheflush, readahead and sysmips LINUX_SPECIFIC dependent
Peter S. Mazinger [Tue, 26 Apr 2011 20:34:59 +0000 (22:34 +0200)]
make arch specific cacheflush, readahead and sysmips LINUX_SPECIFIC dependent

Remove the related headers.
Adapt sh's type to the one used everywhere and add prototype for it.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoshm.c: do not use __libc_X internally
Peter S. Mazinger [Sat, 23 Apr 2011 22:42:21 +0000 (00:42 +0200)]
shm.c: do not use __libc_X internally

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosigqueue.c: do not use __libc_X name internally
Peter S. Mazinger [Sat, 23 Apr 2011 22:38:02 +0000 (00:38 +0200)]
sigqueue.c: do not use __libc_X name internally

__libc_X names are intended to be used in other uClibc provided libs,
but not in libc.
Mark the syscall __always_inline.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosigpause.c: provide the X/Open variant, since the BSD version is deprecated
Peter S. Mazinger [Sat, 23 Apr 2011 22:21:30 +0000 (00:21 +0200)]
sigpause.c: provide the X/Open variant, since the BSD version is deprecated

Do not export __sigpause.
Provide __bsd_sigpause (unprototyped) if anyone may need it.
Adapt cancellation to use cancel.h.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agosocketcalls.c: rewrite to use cancel.h
Peter S. Mazinger [Sat, 23 Apr 2011 21:53:57 +0000 (23:53 +0200)]
socketcalls.c: rewrite to use cancel.h

__socketcall.c: remove guard, we definitely need this syscall
Re-added guard plus added comment (Bernhard)

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoexec.c: remove duplicate attribute_hidden
Peter S. Mazinger [Sat, 23 Apr 2011 20:02:28 +0000 (22:02 +0200)]
exec.c: remove duplicate attribute_hidden

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agovax/statfs.h: common one is good for vax
Peter S. Mazinger [Sat, 23 Apr 2011 19:47:40 +0000 (21:47 +0200)]
vax/statfs.h: common one is good for vax

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agovax/machine-gmon.h: remove, unneeded
Peter S. Mazinger [Sat, 23 Apr 2011 19:27:20 +0000 (21:27 +0200)]
vax/machine-gmon.h: remove, unneeded

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoe1/bits/unistd.h: remove unneeded bits
Peter S. Mazinger [Sat, 23 Apr 2011 19:20:45 +0000 (21:20 +0200)]
e1/bits/unistd.h: remove unneeded bits

If an arch does not support some option, that has to be coded in Config.in

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoxstatconv: cleanup includes
Peter S. Mazinger [Sat, 23 Apr 2011 19:16:34 +0000 (21:16 +0200)]
xstatconv: cleanup includes

xstatconv.h needs features.h to really "see" config options
xstatconv.c does not need sys/syscall.h

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agouse open_not_cancel_2 instead of open_not_cancel
Peter S. Mazinger [Sat, 23 Apr 2011 19:05:09 +0000 (21:05 +0200)]
use open_not_cancel_2 instead of open_not_cancel

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agonot-cancel.h: update common version and make sure we use this one
Peter S. Mazinger [Sat, 23 Apr 2011 18:59:28 +0000 (20:59 +0200)]
not-cancel.h: update common version and make sure we use this one

Update file (same as in NPTL).
Disable unused parts, the remaining inlines will be fixed later.
Copy it to include to be sure that we use this one independently of
chosen threads.

Provide write,close and waitpid_not_cancel for LT new.
Use wait4 syscall instead of waitpid syscall (kernel says so).
Provide open_not_cancel and close_not_cancel for librt's spawn.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agopause.c: add back usage of pause syscall
Peter S. Mazinger [Sat, 23 Apr 2011 18:46:59 +0000 (20:46 +0200)]
pause.c: add back usage of pause syscall

No idea why it was removed when NPTL was added,
but glibc uses it as well.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agonot-cancel.h: use the non-cancellable functions in libc instead of inlining code
Peter S. Mazinger [Sat, 23 Apr 2011 17:42:41 +0000 (19:42 +0200)]
not-cancel.h: use the non-cancellable functions in libc instead of inlining code

   text    data     bss     dec     hex filename
 272224    2298   17576  292098   47502 lib/libuClibc-0.9.32-rc3-git.so.old
 271806    2298   17576  291680   47360 lib/libuClibc-0.9.32-rc3-git.so

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agowrapsyscall.c: add cancellable fcntl64
Peter S. Mazinger [Sat, 23 Apr 2011 17:35:19 +0000 (19:35 +0200)]
wrapsyscall.c: add cancellable fcntl64

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agonptl: remove sigaction, sigprocmask, and sigfillset from libpthread
Austin Foxley [Fri, 22 Apr 2011 22:06:18 +0000 (15:06 -0700)]
nptl: remove sigaction, sigprocmask, and sigfillset from libpthread

Having them defined in both places was causing errors with static linking

Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agopread_write.c: make all archs use common code
Peter S. Mazinger [Fri, 22 Apr 2011 00:22:07 +0000 (02:22 +0200)]
pread_write.c: make all archs use common code

c6x does not need own version at all

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>