bump version to 0.9.34-git

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Declare __err and pass it to INTERNAL_SYSCALL_NCS so subsequent macros can use it

Signed-off-by: Khem Raj <raj.khem@gmail.com>
lstat/stat/fstat: Use 64bit version of syscall if available

This is needed for stat'ing loop devices > 255
since otherwise kernel returns EOVERFLOW becasue
it needs st_rdev/st_dev to be larger than 16bits but
in kernel it uses __old_kernel_stat for stat
syscall which has st_rdev/st_dev as unsigned short

Add a testcase

Signed-off-by: Khem Raj <raj.khem@gmail.com>
inet:rpc: fix authnone_marshal in multithreading context

This is a port of glibc's fix by Zack Weinberg as reported
in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=142312,
and discussed in http://sourceware.org/ml/libc-alpha/2002-04/msg00069.html
and following.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
tests: add OMIT logic to remove compilation flag.

Add OMIT logic to remove compilation flags when compiling libraries,
binaries( both host and target)

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
tests: fix tests build (LDFLAGS_GNUHASH not longer defined)

Since commit a899b909, variable LDFLAGS_GNUHASH has been replaced
by CFLAG_-Wl--hash-style=gnu. This change has not been reported to
the tests buildsys.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
tests:libdl: add a new test for symbol scope issue in dlclose

Test case to trigger an issue raised by the new symbol scope design,
that was erroneously removing local symbol scope from the global one
too early while dl-closing a shared library.
Based on original test-case by Khem Raj

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Reported-by: Khem Raj <raj.khem@gmail.com>
tests:math: fix build of math tests for SH4

Rename libm-test-ulps-sh4 to libm-test-ulps-sh as the ULPS file
is expected to match pattern libm-test-ulps-$(TARGET_ARCH).
Indeed "sh4" is the TARGET_SUBARCH.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
libdl: fix memleak for local scope of dlopened's needed libraries

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
arm: Do not use 'sed -r' to calculate IS_EABI

-r is not available on BSD sed so to keep
compatibility avoid using it.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
librt: refactor source selection

Should make adding more knob control simpler as people only need
to modify one variable now (librt_filter_SRC).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
__stdio_WRITE: make code more readable. No code changes

Pulled assignments out of ifs.
do {...} while (1); is a weird method of writing "loop forever",
thus rewrote it.
No code changes: objdump output is the same.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
buildsys: do not add empty obj to archives

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

In file included from ldso/libdl/libdl.c:129:0:
./ldso/ldso/sh/elfinterp.c: In function '_dl_do_reloc':
./ldso/ldso/sh/elfinterp.c:163:22: warning: variable 'tls_tpnt' set but not used [-Wunused-but-set-variable]

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
ldso: remove duplicated assignment with TLS symbol

The tpnt field is already set, so not needed to assign it again.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
microblaze: add sys/user.h

A microblaze-specific sys/user.h is needed for (e.g.) strace,
so use this version from glibc.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
librt: add posix_spawn support

Signed-off-by: Ismael Luceno <ismael.luceno@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
stdio: prevent retries on fclose/fflush after write errors

Some test results:

The longer patch posted at Sun 14:46:24 +0100 made my target system
unbootable.  I did not attempt to troubleshoot it, as we are focusing
our efforts on the shorter patch now.

The shorter patch posted at Mon 01:50:27 +0100 is a good start, but it
didn't completely fix the problem for me.  I am posting an updated
version with a few changes at the end of this message; the patched
uClibc 0.9.32.1 tree passes both of my test cases.

My changes:

1) Need to break out of the loop on "hard" errors.  Otherwise the
library call never returns:

open("/dev/null", O_RDONLY)             = 4
dup2(4, 1)                              = 1
write(1, "hello world\n", 12)           = -1 EBADF (Bad file descriptor)
write(1, "hello world\n", 12)           = -1 EBADF (Bad file descriptor)
write(1, "hello world\n", 12)           = -1 EBADF (Bad file descriptor)
write(1, "hello world\n", 12)           = -1 EBADF (Bad file descriptor)
...

2) Move all of the error handling logic back into the "else" clause.  In
particular, I believe we do not want to be checking errno unless
__WRITE() had indicated a failure, since the value may be undefined:

        if (errno == EINTR
         || errno == EAGAIN
         /* do we have other "soft" errors? */
        ) {

3) Whitespace/indentation consistency.

-- 8< --

From: Denys Vlasenko <vda.linux@googlemail.com>

Currently, uclibc retains buffered data on stdio write errors,
and subsequent fclose and fflush will try to write it out again
(in most cases, in vain).

Which results in something like this:

On Wednesday 26 January 2011 13:21, Baruch Siach wrote:
> Hi busybox list,
>
> I'm running the following command under strace (thanks Rob):
>
> echo 56 > /sys/class/gpio/export
>
> and I see the following output:
>
> write(1, "56\n", 3)                     = -1 EBUSY (Device or resource busy)
> write(1, "5", 1)                        = 1
>
> The first EBUSY is OK, since GPIO 56 is already requested. But the second
> write() attempt seems strange, and leads to an unwanted outcome. GPIO 5 gets
> exported.

This patch prevents that.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
ldso: use ELF_xxx()/ElfW() helpers

They expand into the same code, but using the ELF_xxx()/ElfW() macros
makes it much easier to spot similarities between code bases.

Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Acked-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
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>