bump to 0.9.33.3-git

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
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>
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>
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>
pread/pwrite: backport fix

pread/pwrite syscalls has been renamed to pread64/pwrite in 2.6 kernel.

There was a fallback function using lseek for kernels who did not have
this syscall (pre 2.1.60). This is broken in many ways.

uclibc have been using the broken fallback due to they forgot to rename
pread syscall.

This got detected with git-1.7.11 which introduced threaded index-pack
which broke in similar ways a windows (msys).

This issue in uclibc have been reported upstream and fixed in git master
so this patch does not need to be upstreamed. It might be an idea to
backport it properly for 0.9.33 branch though.

Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
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>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
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>
(cherry picked from commit 0dcc13bf7a61b1d0708e5dd103d5515e0ffec79a)

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
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>
(cherry picked from commit cb43f2afba0633400387fa7c55dda3396517f58a)

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
libc/sysdeps: add dup3 syscall wrapper

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

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
libc/sysdeps: dup3: check for __NR_dup3 since older kernels/arches lack it

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
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>
(cherry picked from commit 495c425c3b10fd9e277995fa2a379ba4a62f78bf)
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>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
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>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
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>
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>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
sched.h: include stdlib.h for malloc/free

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
include/: ignore more symlinks

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
arm: workaround GCC PR target/53735 with fork()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
pread/pwrite: fix for !threads

This is done properly via cancel.h on master.

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