OSDN Git Service

uclinux-h8/uClibc.git
11 years agoldso: use .arm mode for resolver unconditionally
Bernhard Reutner-Fischer [Fri, 15 Jun 2012 11:44:35 +0000 (13:44 +0200)]
ldso: use .arm mode for resolver unconditionally

as per comment in the file.
Fixes runtime with __THUMB_INTERWORK__ enabled.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibc: sh: fixed typo in ucontext header
Filippo Arcidiacono [Tue, 12 Jun 2012 09:05:25 +0000 (11:05 +0200)]
libc: sh: fixed typo in ucontext header

Fixed typo in ucontext header, NFPREG wrongly defined twice instead of
NGREG for general registers and NFPREG for floating point register.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
11 years agobuildsys: prune pthread bits from arch headers
Bernhard Reutner-Fischer [Wed, 13 Jun 2012 09:17:14 +0000 (11:17 +0200)]
buildsys: prune pthread bits from arch headers

Pickup the correct version of e.g. local_lim.h as seen on ppc

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: clean up libubacktrace linker script handling
Kevin Cernekee [Thu, 7 Jun 2012 18:32:24 +0000 (11:32 -0700)]
buildsys: clean up libubacktrace linker script handling

Currently, the installed libubacktrace linker script entry always uses
HARDWIRED_ABSPATH semantics, even if HARDWIRED_ABSPATH is disabled:

    $ grep GROUP $PREFIX/mipsel-linux-uclibc/sys-root/usr/lib/libc.so
    GROUP ( libc.so.0 uclibc_nonshared.a AS_NEEDED ( ld-uClibc.so.0 ) )
    GROUP ( AS_NEEDED ( /lib/libubacktrace.so.0 ) )

This causes problems when building a non-sysroot toolchain.

Move the AS_NEEDED insertion into libc/Makefile.in, and add a case to
the HARDWIRED_ABSPATH substitution command so libubacktrace is handled
the same way as the other libraries listed in the script.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoUpdate C6X support
Mark Salter [Wed, 6 Jun 2012 20:44:45 +0000 (16:44 -0400)]
Update C6X support

This patch updates the C6X support to work with latest uClibc code and
uses reworked DSBT support to allow using kernel FDPIC loader.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agolibubacktrace: arm: Fix typo in assert
Bernhard Reutner-Fischer [Mon, 11 Jun 2012 12:28:10 +0000 (14:28 +0200)]
libubacktrace: arm: Fix typo in assert

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agobuildsys: fix typo in help
Bernhard Reutner-Fischer [Mon, 11 Jun 2012 12:27:18 +0000 (14:27 +0200)]
buildsys: fix typo in help

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoeventfd: Implement eventfd2 and fix eventfd
Khem Raj [Sun, 10 Jun 2012 16:36:23 +0000 (09:36 -0700)]
eventfd: Implement eventfd2 and fix eventfd

eventfd: evntfd assumes to take two arguments instead it
should be one evntfd expects two therefore implement both syscalls with
correct parameters

Thanks Eugene Rudoy for reporting it and also providing the patch

Signed-off-by: Khem Raj <raj.khem@gmail.com>
11 years agoMIPS: Use $a0 instead of $v0 for __syscall_error() argument
Kevin Cernekee [Tue, 5 Jun 2012 22:05:20 +0000 (15:05 -0700)]
MIPS: Use $a0 instead of $v0 for __syscall_error() argument

$a0 is saved across _dl_runtime_resolve(); $v0 is not.  Unfortunately,
__syscall_error() uses $v0 for its argument, not $a0 as is the MIPS ABI
standard.  This means that if lazy binding was used for __syscall_error(),
the errno value in $v0 could get corrupted.

The problem can be easily seen in testcases where syscalls in librt fail;
when librt tries to call __syscall_error() in libc, the argument gets
lost and errno gets set to a bogus value:

    # ./tst-mqueue1 ; echo $?
    mq_receive on O_WRONLY mqd_t did not fail with EBADF: Unknown error 2004684208
    1
    # ./tst-mqueue2 ; echo $?
    mq_timedreceive with too small msg_len did not fail with EMSGSIZE: Unknown error 1997360560
    1
    # ./tst-mqueue4 ; echo $?
    mq_timedsend did not fail with ETIMEDOUT: Unknown error 2008747440
    1

When _dl_runtime_resolve() was taken out of the equation, the same test
cases passed:

    # LD_BIND_NOW=y ./tst-mqueue1 ; echo $?
    0
    # LD_BIND_NOW=y ./tst-mqueue2 ; echo $?
    0
    # LD_BIND_NOW=y ./tst-mqueue4 ; echo $?
    0

Changing __syscall_error() to look at $a0 instead of $v0 fixed the
problem.

(Note that there is also a "__syscall_error.c" file which presumably
uses the standard C calling conventions, but I do not think it is used
on MIPS.)

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoMIPS: Convert __syscall_error() callers to use $a0 for argument
Kevin Cernekee [Tue, 5 Jun 2012 22:05:19 +0000 (15:05 -0700)]
MIPS: Convert __syscall_error() callers to use $a0 for argument

Some callers passed the first argument in $v0, while others used $a0.
Change the callers to use $a0 consistently.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoldso: preload standard path library with setuid bit set
Filippo Arcidiacono [Wed, 30 May 2012 15:11:12 +0000 (17:11 +0200)]
ldso: preload standard path library with setuid bit set

For set-user-ID/set-group-ID ELF binaries, only libraries in the standard
search directories that are also set-user-ID must be loaded.
This patch fixes existing logic according to the above statement.
Furthermore if either library setuid bit isn't set or it cannot be found in
the standard search path, the library won't be preloaded but execution go
ahead with default one.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agoClean up DSBT support
Mark Salter [Tue, 22 May 2012 14:53:29 +0000 (10:53 -0400)]
Clean up DSBT support

The existing DSBT support relies on the kernel to provide DSBT info
as part of the load maps passed to user space. The problem with this
approach is that the DSBT info is in the dynamic section, so the
kernel must access a userspace mapping of the dynamic section (or
separately read a copy for the kernel) in order to retrieve the
information needed by userspace.

This patch reworks the DSBT support to remove the reliance on DSBT
info coming from the kernel. Instead, ldso reads the info itself from
the dynamic section. One other benefit of this is that it allows the
existing kernel FDPIC loader to also load DSBT binaries.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
11 years agopread/pwrite: drop fallback funcs
Mike Frysinger [Wed, 30 May 2012 05:40:33 +0000 (01:40 -0400)]
pread/pwrite: drop fallback funcs

Linux has provided these functions since the 2.1.x era, so no need to
keep these around.  We'd rather find out when things are missing (and
fix that) than fall back to the unsafe hacks.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agopread/pwrite: handle renamed syscalls in common/ppc/xtensa code
Mike Frysinger [Wed, 30 May 2012 05:15:03 +0000 (01:15 -0400)]
pread/pwrite: handle renamed syscalls in common/ppc/xtensa code

Some arches got this fix, but many did not.  So copy the ifdef logic to
the ones that missed it to fix behavior in linux-2.6+.

URL: https://bugs.busybox.net/show_bug.cgi?id=5258
Reported-by: David Laight <david.laight@aculab.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoMakerules: Remove duplicated slashes in interp.c
Sedat Dilek [Thu, 17 May 2012 13:18:30 +0000 (15:18 +0200)]
Makerules: Remove duplicated slashes in interp.c

Peter Mazinger says in [1]:
"I can revert it to the old behaviour in master (the change s://:/: should stay though)."

[1] http://lists.uclibc.org/pipermail/uclibc/2011-March/045049.html

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoRevert "Makerules: respect HARDWIRED_ABSPATH in interp.c"
Sedat Dilek [Thu, 17 May 2012 13:18:29 +0000 (15:18 +0200)]
Revert "Makerules: respect HARDWIRED_ABSPATH in interp.c"

This reverts commit 5dffed7dd1a413f3965af702fa7ecd79809d1988.

This breaks ldd when HARDWIRED_ABSPATH=n.

[1] http://lists.uclibc.org/pipermail/uclibc/2011-March/045048.html

From: Timo Teräs <timo.teras@iki.fi>
Your commit 5dffed7dd1a413f3965af702fa7ecd79809d1988 removed absolute
path from the interpreter binary name embedded in ELF files.

This makes ldd seg.fault as it seems to assume absolute paths.

gdb sayeth:

(gdb) where
 #0  0x00111ae3 in find_elf_interpreter (ehdr=0xb7a74000) at
../utils/ldd.c:556
 #1  0x00111f2a in find_dependencies (filename=0x114910
"/home/fabled/aports/main/libc0.9.32/src/uClibc-0.9.32-rc3/lib/librt.so.0.9.32")
at ../utils/ldd.c:676
 #2  0x0011228e in main (argc=1, argv=0xbffff6e8) at ../utils/ldd.c:777
(gdb) p tmp
tmp = NULL
(gdb) p interp_dir
$1 = 0x116660 "ld-uClibc.so.0.9.32"

[2] http://lists.uclibc.org/pipermail/uclibc/2011-March/045054.html

From: Mike Frysinger <vapier@gentoo.org>
On Wed, Mar 23, 2011 at 7:18 AM, Peter Mazinger wrote:
>> Your commit 5dffed7dd1a413f3965af702fa7ecd79809d1988 removed absolute
>> path from the interpreter binary name embedded in ELF files.
>
> do you consider my patch wrong?

yes.  the absolute path to the ldso must be encoded in binaries.  the
point of HARDWIRED_ABSPATH is purely for sysroot/non-sysroot
toolchain, and the interp path isnt involved with that.

are you sure this even works at runtime ?  i'm pretty sure the kernel
doesnt do any path lookups on the interp string.

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agommap()->sys_mmap2: do unsigned shift of offset
James Hogan [Thu, 17 May 2012 11:42:54 +0000 (12:42 +0100)]
mmap()->sys_mmap2: do unsigned shift of offset

Fix the implementation of mmap based on the mmap2 system call, to
construct pgoffset from offset with an unsigned shift rather than a
signed (off_t) shift. The mmap2 test in the testsuite catches this case
by mmap'ing with a large offset (with the sign bit set). The signed
shift repeats the sign bit making the page shift way out of range. This
is already fixed similarly in mmap64().

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agostdio: implement assignment-allocation "m" character
Mike Frysinger [Sun, 6 May 2012 07:50:44 +0000 (03:50 -0400)]
stdio: implement assignment-allocation "m" character

The latest POSIX spec introduces a "m" character to allocate buffers for
the user when using scanf type functions.  This is like the old glibc "a"
flag, but now standardized.  With packages starting to use these, we need
to implement it.

for example:
char *s;
sscanf("foo", "%ms", &s);
printf("%s\n", s);
free(s);
This will automatically allocate storage for "s", read in "foo" to it,
and then display it.

I'm not terribly familiar with the stdio layer, so this could be wrong.
But it seems to work for me.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agoldso: sh: handle _dl_skip_args in linker startup instead of __uClibc_main
Filippo Arcidiacono [Tue, 8 May 2012 13:42:48 +0000 (15:42 +0200)]
ldso: sh: handle _dl_skip_args in linker startup instead of __uClibc_main

Handle _dl_skip_args in the asm part of the dynamic linker startup,
to skip the ldso arguments, so we can keep this symbol hidden as other archs do.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
11 years agoldd: tweak whitespace
Bernhard Reutner-Fischer [Tue, 15 May 2012 07:11:01 +0000 (09:11 +0200)]
ldd: tweak whitespace

Tweak whitespace in preprocessor conditionals. No obj-code changes.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoRevert "help: Document CROSS="
Bernhard Reutner-Fischer [Wed, 9 May 2012 06:25:48 +0000 (08:25 +0200)]
Revert "help: Document CROSS="

This reverts commit 5e0dbdb9e5acdcf7dea29335a5db065f48c58766.

CROSS is only a compat thing and should not be advertised

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoldd.host: Fix compilation for STANDALONE support
Bernhard Reutner-Fischer [Tue, 8 May 2012 19:22:51 +0000 (21:22 +0200)]
ldd.host: Fix compilation for STANDALONE support

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agohelp: Document CROSS=
Bernhard Reutner-Fischer [Tue, 8 May 2012 17:53:55 +0000 (19:53 +0200)]
help: Document CROSS=

should maybe better read "override CROSS_COMPILE from above"

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agohelp: Document BUILD_CFLAGS and BUILD_LDFLAGS
Bernhard Reutner-Fischer [Tue, 8 May 2012 17:49:55 +0000 (19:49 +0200)]
help: Document BUILD_CFLAGS and BUILD_LDFLAGS

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoutils: pass in config flags for ldd
Bernhard Reutner-Fischer [Tue, 8 May 2012 17:37:08 +0000 (19:37 +0200)]
utils: pass in config flags for ldd

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoldd: silence warning if !LDSO_LDD_SUPPORT
Bernhard Reutner-Fischer [Tue, 8 May 2012 17:20:09 +0000 (19:20 +0200)]
ldd: silence warning if !LDSO_LDD_SUPPORT

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolinuxthreads.old: fix build warnings with epoll enabled
Mike Frysinger [Sat, 5 May 2012 19:04:53 +0000 (15:04 -0400)]
linuxthreads.old: fix build warnings with epoll enabled

Pull in the epoll header for the epoll structs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agodrop support for old systems lacking vfork
Mark Salter [Fri, 4 May 2012 12:18:46 +0000 (08:18 -0400)]
drop support for old systems lacking vfork

Only really old systems (<=linux-2.0) lack a dedicated vfork system call.
The code that is in place to support them is causing issues with newer
arches that also don't provide a vfork system call -- instead, they do
vfork by calling clone in userspace.

If anyone cares about these really old systems, they can submit a patch
to make the system work with them while not breaking newer systems.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agodocs: restore crt from old svn tree
Mike Frysinger [Sat, 5 May 2012 05:46:30 +0000 (01:46 -0400)]
docs: restore crt from old svn tree

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoconfig: tweak STRICT_HEADERS description
Bernhard Reutner-Fischer [Thu, 3 May 2012 11:27:17 +0000 (13:27 +0200)]
config: tweak STRICT_HEADERS description

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agorpmatch: provide out-of-line implementation
Bernhard Reutner-Fischer [Thu, 3 May 2012 11:04:14 +0000 (13:04 +0200)]
rpmatch: provide out-of-line implementation

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agorpmatch: make decl parsable
Bernhard Reutner-Fischer [Thu, 3 May 2012 08:58:24 +0000 (10:58 +0200)]
rpmatch: make decl parsable

Mike, it would have been much simpler to just leave the header impl-free

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agorpmatch: fix previous commit w/C++ compilers
Mike Frysinger [Wed, 2 May 2012 05:14:17 +0000 (01:14 -0400)]
rpmatch: fix previous commit w/C++ compilers

The throw markings on the inline func trigger errors when building with
C++.  Since this inline version doesn't throw any exceptions, just drop
the markings completely and be done with it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agorpmatch: simple inline version
Mike Frysinger [Mon, 30 Apr 2012 04:40:49 +0000 (00:40 -0400)]
rpmatch: simple inline version

Since rpmatch will match ^[Yy] and ^[Nn] regardless of locale, this
lets us create a simple inline version.  Newer procps versions use
this function.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoepoll.h: sync with glibc
Mike Frysinger [Sun, 29 Apr 2012 03:51:56 +0000 (23:51 -0400)]
epoll.h: sync with glibc

Since glibc has split out arch-specific stuff to bits/epoll.h, we can
pull that sanity back into our tree and drop the arch ifdefs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agollseek: support __NR_llseek syscall
Mark Salter [Thu, 26 Apr 2012 14:14:49 +0000 (10:14 -0400)]
llseek: support __NR_llseek syscall

Older kernels use __NR__llseek for a 64-bit lseek syscall. Newer
kernels use __NR_llseek. This patch fixes the implementation of
lseek64 to use the __NR_llseek syscall if it exists.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agogetpgrp: fix fallback handling
Mark Salter [Thu, 26 Apr 2012 14:14:01 +0000 (10:14 -0400)]
getpgrp: fix fallback handling

The test for generating a stub for getpgrp was wrong and would
result in duplicate symbols when building without __NR_getpgrp,
but with __NR_getpgid and __NR_getpid.

A closer look at the getpgrp implementation using getpgid showed
that getpid was being called to pass the current pid to getpgid.
This is unnecessary because passing 0 to getpgid returns the
pgid of the current process.

This patch cleans up the getpgrp implementation and the stub test.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoarm: use PATH_MEM in ioperm()
Bernhard Reutner-Fischer [Thu, 26 Apr 2012 14:30:42 +0000 (16:30 +0200)]
arm: use PATH_MEM in ioperm()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agommap64: Use correct type for offset parameter
Mike Frysinger [Thu, 26 Apr 2012 07:24:38 +0000 (09:24 +0200)]
mmap64: Use correct type for offset parameter

Some arches check the size in INLINE_SYSCALL() and barf if it's
too big (i.e. a 64bit value getting truncated to 32bit).
Satisfy error-check on ppc32.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoatomic.h: handle new mips R10K errata
Bernhard Reutner-Fischer [Wed, 25 Apr 2012 12:13:49 +0000 (14:13 +0200)]
atomic.h: handle new mips R10K errata

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolinuxthreads.old: refactor nommu logic a little to avoid mmu warning
Mike Frysinger [Tue, 24 Apr 2012 05:38:45 +0000 (01:38 -0400)]
linuxthreads.old: refactor nommu logic a little to avoid mmu warning

Should be no functional changes; just fixing:

libpthread/linuxthreads.old/manager.c: In function 'pthread_free':
libpthread/linuxthreads.old/manager.c:707:9: warning:
variable 'h_bottom_save' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolinuxthreads.old: pass back up saved_errno value in manager init
Mike Frysinger [Tue, 24 Apr 2012 05:33:41 +0000 (01:33 -0400)]
linuxthreads.old: pass back up saved_errno value in manager init

This matches the newer linuxthreads code, and fixes the build warning:

libpthread/linuxthreads.old/manager.c: In function 'pthread_handle_create':
libpthread/linuxthreads.old/manager.c:487:7: warning:
variable 'saved_errno' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolinuxthreads.old: fix set-but-unused warning
Mike Frysinger [Tue, 24 Apr 2012 05:30:31 +0000 (01:30 -0400)]
linuxthreads.old: fix set-but-unused warning

Move spin_count down to the code block where it's used to fix the warning:

libpthread/linuxthreads.old/spinlock.c: In function '__pthread_lock':
libpthread/linuxthreads.old/spinlock.c:70:7: warning:
variable 'spin_count' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolinuxthreads.old: fix typo in pthread_mutex_unlock hidden prototype
Mike Frysinger [Tue, 24 Apr 2012 05:25:48 +0000 (01:25 -0400)]
linuxthreads.old: fix typo in pthread_mutex_unlock hidden prototype

Reported-by: Tony Wu <tung7970@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agogetconf: include a newline in error messages
Mike Frysinger [Mon, 23 Apr 2012 03:34:31 +0000 (23:34 -0400)]
getconf: include a newline in error messages

The normal error() func implicitly appends a newline, so make sure we do
the same.  Otherwise getconf outputs an error message like so:
prompt$ getconf -h
Unrecognized variable `-h'prompt$

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolinuxthreads.old: only declare __pthread_xxx funcs hidden inside of libpthread
Mike Frysinger [Sun, 22 Apr 2012 21:35:03 +0000 (17:35 -0400)]
linuxthreads.old: only declare __pthread_xxx funcs hidden inside of libpthread

These stubs get used in libc as forwarding funcs, so we don't want them
labeled as hidden.  Otherwise, attempting to use them in other libraries
(like libdl) will result in references to symbols that only libpthread
provides.  Such as:
/usr/bin/python2.6: can't resolve symbol '__pthread_mutex_lock' in lib '/lib/libdl.so.0'.

This also brings the old code in line with the newer linuxthreads.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agosysconf: use getrlimit to determine ARG_MAX
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 22:31:03 +0000 (00:31 +0200)]
sysconf: use getrlimit to determine ARG_MAX

getrlimit previously was only called for NPTL (why?), fix that to be
used everywhere.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoconfig: Fix alphabetical sort order of targets
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 22:09:02 +0000 (00:09 +0200)]
config: Fix alphabetical sort order of targets

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoldd: silence warnings
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 22:06:52 +0000 (00:06 +0200)]
ldd: silence warnings

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolocale: avoid segfault freelocale()
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 21:19:16 +0000 (23:19 +0200)]
locale: avoid segfault freelocale()

PR 4964

Eric Nadler writes:
It looks to me like the base structure is not fully initialized
with 0 (only a subset of the structure is initialized).
This later results in a free of base->collate.index2weight in
_locale_set_l.
This free tries to free uninitialized memory and segfaults.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agotest: Ignore various test objects in locale
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 21:15:40 +0000 (23:15 +0200)]
test: Ignore various test objects in locale

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agowchar: Fix BOM emitting in iconv_open()
Ed W [Tue, 17 Apr 2012 11:13:32 +0000 (12:13 +0100)]
wchar: Fix BOM emitting in iconv_open()

Fix incorrect output of BOM when converting charactersets by name. Only
affective when iconv/locale enabled.

Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoipc: eventually use stat64 in ftok()
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 20:05:07 +0000 (22:05 +0200)]
ipc: eventually use stat64 in ftok()

PR 4201
ftok() always used 32bit stat

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoresolv: tiny shrinkage in /etc/hosts handling
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 16:35:05 +0000 (18:35 +0200)]
resolv: tiny shrinkage in /etc/hosts handling

-4b

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoresolv: remove unused variables
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 15:57:54 +0000 (17:57 +0200)]
resolv: remove unused variables

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoresolv: Fix /etc/hosts for more than MAXALIASES aliases
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 15:54:09 +0000 (17:54 +0200)]
resolv: Fix /etc/hosts for more than MAXALIASES aliases

PR networking/4916

Reserve space for the terminating 0 alias and zero out the
scratch-buffer so the last entry of the alias list is empty.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoparse_config: tweak indentation
Bernhard Reutner-Fischer [Tue, 17 Apr 2012 15:47:08 +0000 (17:47 +0200)]
parse_config: tweak indentation

and shuffle tokens memsetting around.
No obj-code changes.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agogetaddrinfo(): avoid call to __check_pf() when not needed
Alexander Komyagin [Wed, 4 Apr 2012 08:58:37 +0000 (12:58 +0400)]
getaddrinfo(): avoid call to __check_pf() when not needed

__check_pf() function is called from getaddrinfo() and it calls
getifaddrs(), which is too much overhead especially if RSBAC-Net
is enabled. So with this patch __check_pf() is being called only
when AI_ADDRCONFIG hint flag is specified - just when we really
need that check.

Signed-off-by: Alexander Komyagin <komyagin@altell.ru>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoinet: adjust handling of cacnonname in getaddrinfo
Ed W [Mon, 16 Apr 2012 22:27:55 +0000 (23:27 +0100)]
inet: adjust handling of cacnonname in getaddrinfo

Posix says that canonname should use the text representation of an IP address
when a numerical nodename given
See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html

Signed-off-by: Ed Wildgoose <lists@wildgooses.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agommap64: use INLINE_SYSCALL() helper
Mike Frysinger [Wed, 11 Apr 2012 20:05:08 +0000 (16:05 -0400)]
mmap64: use INLINE_SYSCALL() helper

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agommap64: include stdint.h for uint64_t
Mike Frysinger [Wed, 11 Apr 2012 20:01:29 +0000 (16:01 -0400)]
mmap64: include stdint.h for uint64_t

Some targets include this implicitly, but pull it in explicitly for those
which don't to fix building for them.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agommap64: always use unsigned 64bit offsets
Mike Frysinger [Tue, 10 Apr 2012 04:27:04 +0000 (00:27 -0400)]
mmap64: always use unsigned 64bit offsets

The current code will sometimes cast the offset to an unsigned long.
On 32bit systems, that doesn't make much sense since we always know
that the off64_t type is 64bits.  So drop the ifdef logic, cast it
to an unsigned 64bit value, and then do the shift.

If the system is 32bits, and the address is still too large, then
there's really nothing we could do about it anyways, so the extra
ifdef logic wasn't helping.

URL: https://bugs.busybox.net/show_bug.cgi?id=3853
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotest/misc: Add tst-inotify
Kevin Cernekee [Sat, 7 Apr 2012 20:31:31 +0000 (13:31 -0700)]
test/misc: Add tst-inotify

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotest/inet: Add tst-sock-nonblock
Kevin Cernekee [Sat, 7 Apr 2012 20:31:30 +0000 (13:31 -0700)]
test/inet: Add tst-sock-nonblock

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotest/time: Add tst-timerfd
Kevin Cernekee [Sat, 7 Apr 2012 20:31:29 +0000 (13:31 -0700)]
test/time: Add tst-timerfd

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotest/signal: Add tst-signalfd
Kevin Cernekee [Sat, 7 Apr 2012 20:31:28 +0000 (13:31 -0700)]
test/signal: Add tst-signalfd

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoMAKEALL: add more arch aliases
Mike Frysinger [Sun, 8 Apr 2012 20:03:13 +0000 (16:03 -0400)]
MAKEALL: add more arch aliases

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoMAKEALL: fix cross-compiler lookup breakage after CROSS cleanup
Mike Frysinger [Sun, 8 Apr 2012 19:54:17 +0000 (15:54 -0400)]
MAKEALL: fix cross-compiler lookup breakage after CROSS cleanup

Commit ae14cd49a8da6e62e35636 broke testing of multiple arches in one go.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoMAKEALL: also check for gnu suffixed toolchains too
Mike Frysinger [Sun, 8 Apr 2012 18:54:23 +0000 (14:54 -0400)]
MAKEALL: also check for gnu suffixed toolchains too

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoalpha: trim crt code to fix build errors
Mike Frysinger [Sun, 8 Apr 2012 19:36:28 +0000 (15:36 -0400)]
alpha: trim crt code to fix build errors

Otherwise we get:
/tmp/cc14nHjG.s: Assembler messages:
/tmp/cc14nHjG.s: Error: .size expression for _init does not evaluate to a constant
/tmp/cc14nHjG.s: Error: .size expression for _fini does not evaluate to a constant

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agosignalfd.h: Use new "bits/" scheme for arch-specific flags
Kevin Cernekee [Sun, 8 Apr 2012 18:43:02 +0000 (11:43 -0700)]
signalfd.h: Use new "bits/" scheme for arch-specific flags

glibc has split off the arch-specific flag definitions (like
SFD_NONBLOCK) into <arch>/bits/signalfd.h, so that there are no longer
multiple redundant copies of the entire header file.  We will adopt the
same scheme in uClibc.

Special cases are included for: alpha mips sparc

hppa was omitted because it has not been updated in glibc.

All others use the common definition.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotimerfd.h: Use new "bits/" scheme for arch-specific flags
Kevin Cernekee [Sun, 8 Apr 2012 18:43:01 +0000 (11:43 -0700)]
timerfd.h: Use new "bits/" scheme for arch-specific flags

glibc has split off the arch-specific flag definitions (like
TFD_NONBLOCK) into <arch>/bits/timerfd.h, so that there are no longer
multiple redundant copies of the entire header file.  We will adopt the
same scheme in uClibc.

Special cases are included for: alpha mips sparc

hppa was omitted because it has not been updated in glibc.

All others use the common definition.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoinotify.h: Use new "bits/" scheme for arch-specific flags
Kevin Cernekee [Sun, 8 Apr 2012 18:43:00 +0000 (11:43 -0700)]
inotify.h: Use new "bits/" scheme for arch-specific flags

glibc has split off the arch-specific flag definitions (like
IN_NONBLOCK) into <arch>/bits/inotify.h, so that there are no longer
multiple redundant copies of the entire header file.  We will adopt the
same scheme in uClibc.

Special cases are included for: alpha mips sparc

hppa was omitted because it has not been updated in glibc.

All others use the common definition.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoinotify_rm_watch: Change second argument to int
Kevin Cernekee [Sun, 8 Apr 2012 18:42:59 +0000 (11:42 -0700)]
inotify_rm_watch: Change second argument to int

2009-01-30  Ulrich Drepper  <drepper@redhat.com>

        [BZ #7040]
        * sysdeps/unix/sysv/linux/sys/inotify.h: Second parameter of
        inotify_rm_watch should have type int.

This change allows us to copy inotify.h verbatim from glibc into uClibc.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotest: Ignore various test objects
Kevin Cernekee [Sat, 7 Apr 2012 20:31:25 +0000 (13:31 -0700)]
test: Ignore various test objects

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoregex: silence set-but-unused warnings
Mike Frysinger [Sun, 8 Apr 2012 04:52:50 +0000 (00:52 -0400)]
regex: silence set-but-unused warnings

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: fix fdpic support broken from prelink patch
Filippo Arcidiacono [Fri, 6 Apr 2012 09:18:35 +0000 (11:18 +0200)]
ldso: fix fdpic support broken from prelink patch

The fdpic support has been broken since the prelink support was added,
because it didn't take into account DL_LOADADDR_TYPE could be a different
type of ElfW(Addr).

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agobfin: set an invalid insn for abort
Mike Frysinger [Sun, 8 Apr 2012 04:32:56 +0000 (00:32 -0400)]
bfin: set an invalid insn for abort

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agobuildsys: fix building with make-3.82+
Mike Frysinger [Sun, 8 Apr 2012 04:18:28 +0000 (00:18 -0400)]
buildsys: fix building with make-3.82+

We can't merge pattern and normal rules as newer make barfs:
*** mixed implicit and normal rules.  Stop.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolibrt: convince spawn to compile for !LFS
Bernhard Reutner-Fischer [Wed, 4 Apr 2012 16:08:09 +0000 (18:08 +0200)]
librt: convince spawn to compile for !LFS

Great to have this valuable family of high kwalitee functions in here.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agostubs: Disregard LFS
Bernhard Reutner-Fischer [Wed, 4 Apr 2012 15:58:48 +0000 (17:58 +0200)]
stubs: Disregard LFS

Fixes handling of e.g. splice

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years ago.gitignore: Ignore dump files
Bernhard Reutner-Fischer [Wed, 4 Apr 2012 05:53:47 +0000 (07:53 +0200)]
.gitignore: Ignore dump files

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agobuildsys: remove duplicate rule around defconfigs
Bernhard Reutner-Fischer [Fri, 30 Mar 2012 16:32:15 +0000 (18:32 +0200)]
buildsys: remove duplicate rule around defconfigs

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agofchmodat: fix handling of flags
Mike Frysinger [Mon, 2 Apr 2012 04:37:10 +0000 (00:37 -0400)]
fchmodat: fix handling of flags

The Linux syscall takes 3 args, not 4.  We have to process flags in
userspace ourselves.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: mark _start hidden
Mike Frysinger [Tue, 27 Mar 2012 03:50:12 +0000 (23:50 -0400)]
ldso: mark _start hidden

There's no need to export this symbol, so mark them all hidden.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agostdio: Fix char signedness in _load_inttype()
Bernhard Reutner-Fischer [Wed, 28 Mar 2012 07:44:53 +0000 (09:44 +0200)]
stdio: Fix char signedness in _load_inttype()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agobuildsys: Fix typo in check-as-var handling
Bernhard Reutner-Fischer [Tue, 27 Mar 2012 11:38:58 +0000 (13:38 +0200)]
buildsys: Fix typo in check-as-var handling

Missing second expansion with _v.
This led to wrong args passed down to assembler.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoldso: bfin: add alias from __start to _start
Mike Frysinger [Tue, 27 Mar 2012 03:54:32 +0000 (23:54 -0400)]
ldso: bfin: add alias from __start to _start

On Blackfin systems, we have underscore prefixes in our ABI.  So instead
of _start, we use __start.  However, the makefile explicitly sets _start
as the entry point to support toolchains that implicitly use other symbols
as the default entry.  It's easy enough to add a hidden alias in the
Blackfin code for free to support this.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agospawn: fix building on no-mmu systems
Mike Frysinger [Tue, 27 Mar 2012 03:41:25 +0000 (23:41 -0400)]
spawn: fix building on no-mmu systems

We don't have fork() on no-mmu, so if we're going to end up calling it,
return ENOSYS instead.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agospawn: do not require C99 style
Mike Frysinger [Tue, 27 Mar 2012 03:37:21 +0000 (23:37 -0400)]
spawn: do not require C99 style

Simple style tweak to build with older standards.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agospawn: use glibc style to keep differences down
Mike Frysinger [Tue, 27 Mar 2012 03:34:37 +0000 (23:34 -0400)]
spawn: use glibc style to keep differences down

There's no point in reformatting the code style when we're sourcing
most of it from glibc.  Further, the changed style breaks with older
compilers, and pollutes the namespace with non-double leading under-
scores.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: bfin: tweak style
Mike Frysinger [Tue, 27 Mar 2012 02:58:37 +0000 (22:58 -0400)]
ldso: bfin: tweak style

No functional changes here.  We don't need line continuations as gcc
is smart enough to merge the multiple strings for us.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoarm: disable ioperm/iopl stubs
Mike Frysinger [Tue, 27 Mar 2012 02:13:11 +0000 (22:13 -0400)]
arm: disable ioperm/iopl stubs

ARM always provides its own userspace funcs for ioperm/iopl.
They've never had syscalls.  So disable the stubs on ARM to
avoid multiple definition errors.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoRevert "Fix redefinition of ioperm and iopl in stubs.c and arm/{ioperm.c,iopl.c}"
Mike Frysinger [Tue, 27 Mar 2012 01:44:40 +0000 (21:44 -0400)]
Revert "Fix redefinition of ioperm and iopl in stubs.c and arm/{ioperm.c,iopl.c}"

This reverts commit 3bcd031f97d61a8f732d865a0f4248aed2d191ab.

The arm code is supposed to provide its own userspace ioperm/iopl
functions.  They've never had system calls for these funcs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotime.c: Readability improvements - no code changes
Denys Vlasenko [Mon, 26 Mar 2012 14:01:51 +0000 (16:01 +0200)]
time.c: Readability improvements - no code changes

Pulled assignments out of ifs, added whitespace around operation symbols.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agostubs: unified from future
Bernhard Reutner-Fischer [Mon, 26 Mar 2012 09:25:33 +0000 (11:25 +0200)]
stubs: unified from future

Future branch extends stubs with ret_enosys_stub.
Resolve conflicts, and use superset of future and current master.
Adjust posix_fadvise* accordingly.

Upon future merge, pick this master version as the final state.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoFix redefinition of ioperm and iopl in stubs.c and arm/{ioperm.c,iopl.c}
Jason Woodward [Wed, 8 Feb 2012 00:07:57 +0000 (19:07 -0500)]
Fix redefinition of ioperm and iopl in stubs.c and arm/{ioperm.c,iopl.c}

This fixes the following link failure:

  LD libuClibc-0.9.33.so
libc/libc_so.a(stubs.os): In function `sync_file_range':
stubs.c:(.text+0x0): multiple definition of `ioperm'
libc/libc_so.a(ioperm.os):ioperm.c:(.text+0x260): first defined here
libc/libc_so.a(stubs.os): In function `sync_file_range':
stubs.c:(.text+0x0): multiple definition of `iopl'
libc/libc_so.a(iopl.os):iopl.c:(.text+0x0): first defined here
collect2: ld returned 1 exit status
make[1]: *** [lib/libc.so] Error 1

Signed-off-by: Jason Woodward <jason.woodward@timesys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agonptl: fix compiler warning due to missing prototype
Carmelo Amoroso [Wed, 14 Mar 2012 15:26:13 +0000 (16:26 +0100)]
nptl: fix compiler warning due to missing prototype

libpthread/nptl/sysdeps/pthread/pt-longjmp.c: In function 'longjmp':
libpthread/nptl/sysdeps/pthread/pt-longjmp.c:27:3: warning: implicit declaration of function '__libc_longjmp' [-Wimplicit-function-declaration]
libpthread/nptl/sysdeps/pthread/pt-longjmp.c:28:1: warning: 'noreturn' function does return [enabled by default]

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agonptl: fix compiler warning due to unused-but-set-variable
Carmelo Amoroso [Wed, 14 Mar 2012 15:22:19 +0000 (16:22 +0100)]
nptl: fix compiler warning due to unused-but-set-variable

gcc 4.6.x raises useful warnings due to unused-but-set-variable,
This patch fixes the following one by using properly preprocessor
guard

libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c: In function '__pthread_cond_timedwait':
libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c:103:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoinet:rpc: fix build in !NPTL case
Carmelo Amoroso [Wed, 14 Mar 2012 14:21:36 +0000 (15:21 +0100)]
inet:rpc: fix build in !NPTL case

__libc_once is not available / needed when multithreading support
is not enabled, so authnone_create() calls authnone_create_once()
directly.
When LT.{old,new} is used instead of NPTL, it needs to explicitly
include <bits/libc-lock.h> to get __libc_once to be visible.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>