OSDN Git Service

uclinux-h8/uClibc.git
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>
12 years agoldso: use ELF_xxx()/ElfW() helpers
Mike Frysinger [Sun, 27 Nov 2011 06:58:40 +0000 (01:58 -0500)]
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>
12 years agostdio: prevent retries on fclose/fflush after write errors
Denys Vlasenko [Mon, 12 Mar 2012 05:27:08 +0000 (22:27 -0700)]
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>
12 years agolibrt: add posix_spawn support
Ismael Luceno [Mon, 5 Mar 2012 08:43:49 +0000 (06:43 -0200)]
librt: add posix_spawn support

Signed-off-by: Ismael Luceno <ismael.luceno@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agomicroblaze: add sys/user.h
Steve Bennett [Fri, 16 Mar 2012 00:45:32 +0000 (10:45 +1000)]
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>
12 years agoldso: remove duplicated assignment with TLS symbol
Carmelo Amoroso [Thu, 15 Mar 2012 10:51:38 +0000 (11:51 +0100)]
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>
12 years agoldso:sh: fix compiler warning due to unused-but-set-variable
Carmelo Amoroso [Wed, 14 Mar 2012 14:39:12 +0000 (15:39 +0100)]
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>
12 years agobuildsys: do not add empty obj to archives
Bernhard Reutner-Fischer [Tue, 13 Mar 2012 18:49:38 +0000 (19:49 +0100)]
buildsys: do not add empty obj to archives

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years ago__stdio_WRITE: make code more readable. No code changes
Denys Vlasenko [Sun, 11 Mar 2012 12:33:49 +0000 (13:33 +0100)]
__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>
12 years agolibrt: refactor source selection
Mike Frysinger [Mon, 5 Mar 2012 06:37:07 +0000 (01:37 -0500)]
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>
12 years agoarm: Do not use 'sed -r' to calculate IS_EABI
Khem Raj [Mon, 13 Feb 2012 19:37:26 +0000 (11:37 -0800)]
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>
12 years agolibdl: fix memleak for local scope of dlopened's needed libraries
Filippo Arcidiacono [Fri, 3 Feb 2012 15:41:44 +0000 (16:41 +0100)]
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>
12 years agotests:math: fix build of math tests for SH4
Carmelo Amoroso [Tue, 7 Feb 2012 16:18:25 +0000 (17:18 +0100)]
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>
12 years agotests:libdl: add a new test for symbol scope issue in dlclose
Filippo ARCIDIACONO [Mon, 23 Jan 2012 16:01:58 +0000 (17:01 +0100)]
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>
12 years agotests: fix tests build (LDFLAGS_GNUHASH not longer defined)
Carmelo Amoroso [Tue, 7 Feb 2012 15:02:48 +0000 (16:02 +0100)]
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>
12 years agotests: add OMIT logic to remove compilation flag.
Filippo ARCIDIACONO [Mon, 23 Jan 2012 14:44:14 +0000 (15:44 +0100)]
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>
12 years agoinet:rpc: fix authnone_marshal in multithreading context
Carmelo Amoroso [Thu, 2 Feb 2012 17:22:36 +0000 (18:22 +0100)]
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>
12 years agolstat/stat/fstat: Use 64bit version of syscall if available
Khem Raj [Sat, 4 Feb 2012 04:06:55 +0000 (20:06 -0800)]
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>
12 years agoDeclare __err and pass it to INTERNAL_SYSCALL_NCS so subsequent macros can use it
Khem Raj [Fri, 3 Feb 2012 18:57:44 +0000 (10:57 -0800)]
Declare __err and pass it to INTERNAL_SYSCALL_NCS so subsequent macros can use it

Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 years agobump version to 0.9.34-git
Bernhard Reutner-Fischer [Wed, 1 Feb 2012 22:52:39 +0000 (23:52 +0100)]
bump version to 0.9.34-git

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoRelease 0.9.33
Bernhard Reutner-Fischer [Wed, 1 Feb 2012 21:21:04 +0000 (22:21 +0100)]
Release 0.9.33

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agotmpnam, tempnam are obsolete in SUSV4
Bernhard Reutner-Fischer [Sun, 29 Jan 2012 16:48:54 +0000 (17:48 +0100)]
tmpnam, tempnam are obsolete in SUSV4

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agohandle signal-OBXSI.SUSv4.syms
Bernhard Reutner-Fischer [Sun, 29 Jan 2012 14:46:50 +0000 (15:46 +0100)]
handle signal-OBXSI.SUSv4.syms

A couple of sig functions are obsolete in SUSv4.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agonptl_db: handle SUSv4-OB
Bernhard Reutner-Fischer [Sun, 29 Jan 2012 14:21:38 +0000 (15:21 +0100)]
nptl_db: handle SUSv4-OB

pthread_getconcurrency / pthread_setconcurrency is OBSOLETE in SUSv4
so disable pthread debug support too

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agotest: ignore undefined symbols for API
Bernhard Reutner-Fischer [Sun, 29 Jan 2012 14:10:01 +0000 (15:10 +0100)]
test: ignore undefined symbols for API

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoconfig: ftw is SUSv4-obsolete
Bernhard Reutner-Fischer [Sun, 29 Jan 2012 14:09:34 +0000 (15:09 +0100)]
config: ftw is SUSv4-obsolete

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years ago*: if !HAS_THREADS strong alias sigaction
Bernhard Reutner-Fischer [Sat, 28 Jan 2012 20:57:49 +0000 (21:57 +0100)]
*: if !HAS_THREADS strong alias sigaction

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agobuildsys: fixup sigaction handling
Bernhard Reutner-Fischer [Sat, 28 Jan 2012 19:53:19 +0000 (20:53 +0100)]
buildsys: fixup sigaction handling

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibubacktrace:arm: libgcc_eh.a not needed
Carmelo Amoroso [Fri, 27 Jan 2012 12:35:57 +0000 (13:35 +0100)]
libubacktrace:arm: libgcc_eh.a not needed

Dummy symbol is __aeabi_unwind_cpp_pr is part of uclibc_shared.a

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoldso: fix typo in debug message
Bernhard Reutner-Fischer [Fri, 27 Jan 2012 12:19:05 +0000 (13:19 +0100)]
ldso: fix typo in debug message

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agobuildsys: add cppcheck wrapper script (correct one)
Bernhard Reutner-Fischer [Fri, 27 Jan 2012 11:46:14 +0000 (12:46 +0100)]
buildsys: add cppcheck wrapper script (correct one)

Also incooperate vapier's suggestion on how to set REAL_CC once

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibc_arm: avoid multiple version of __aeabi_unwind_cpp_pr dummy code
Carmelo Amoroso [Mon, 19 Sep 2011 13:58:53 +0000 (15:58 +0200)]
libc_arm: avoid multiple version of __aeabi_unwind_cpp_pr dummy code

Do not pollute libraries with its own implementation of __aeabi_unwind_cpp_pr1 code.
Just add it to uclibc_nonshared.a archive and share it.
This fixes build issue with static linking of application due to multiple symbol
definition in libgcc_eh-a and libpthread.a or librt.a

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agobuildsys: use single slash version of -print-whatever
Bernhard Reutner-Fischer [Thu, 26 Jan 2012 16:00:05 +0000 (17:00 +0100)]
buildsys: use single slash version of -print-whatever

The double slash variants are not documented (doc bug?) so better use
the single slash variants like we usually do.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agobuildsys: turn off forced EXTRA_WARNINGS on i386
Bernhard Reutner-Fischer [Thu, 26 Jan 2012 14:26:47 +0000 (15:26 +0100)]
buildsys: turn off forced EXTRA_WARNINGS on i386

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years ago*: silence some warnings
Bernhard Reutner-Fischer [Thu, 26 Jan 2012 14:15:23 +0000 (15:15 +0100)]
*: silence some warnings

warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agosyscall: flag ia64 syscall error path as unlikely
Bernhard Reutner-Fischer [Thu, 19 Jan 2012 14:05:43 +0000 (15:05 +0100)]
syscall: flag ia64 syscall error path as unlikely

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoarm: tweak comment
Bernhard Reutner-Fischer [Thu, 19 Jan 2012 14:04:40 +0000 (15:04 +0100)]
arm: tweak comment

harmless copy'n paste error

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibc: fix signal handling in system()
Richard Braun [Tue, 17 Jan 2012 09:33:10 +0000 (10:33 +0100)]
libc: fix signal handling in system()

When built without NPTL support (or for a sparc target), the system()
function doesn't conform to its specification. Namely, it uses signal()
to install/save/restore signal handlers, which may break applications
using custom handlers installed with sigaction(). In addition, it resets
the SIGCHLD handler to SIG_DFL instead of blocking the signal, which may
result in "lost" signals if a custom handler was installed.

Fix system() by replacing uses of signal() with appropriate calls to
sigaction() and sigprocmask().

Signed-off-by: Richard Braun <rbraun@sceen.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso/mips: fix symbol lookup for JUMP_SLOT and COPY relocations
Carmelo Amoroso [Thu, 19 Jan 2012 14:28:15 +0000 (15:28 +0100)]
ldso/mips: fix symbol lookup for JUMP_SLOT and COPY relocations

Fill properly the sym_ref fields when invoking _dl_find_hash to lookup
symbols

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 years agolibdl: fix dlclose handling of symbol scope
Carmelo Amoroso [Tue, 17 Jan 2012 17:23:43 +0000 (18:23 +0100)]
libdl: fix dlclose handling of symbol scope

Defer removal of the local scope of a dl-opened library after
all the destructors (of itself and related dependencies) are actually
get unloaded, otherwise any function registered via atexit()
won't be resolved.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
12 years agoRules: Check for CROSS_COMPILE to be empty
Khem Raj [Sat, 21 Jan 2012 14:02:00 +0000 (06:02 -0800)]
Rules: Check for CROSS_COMPILE to be empty

In some case where CROSS is defined to be empty
we define CROSS_COMPILE ?= CROSS so at this point
it will be defined but will be empty so check
for the same

Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 years agolibubacktrace: Add arm implementation
Khem Raj [Sat, 21 Jan 2012 13:59:49 +0000 (05:59 -0800)]
libubacktrace: Add arm implementation

Arm has a different mechanism of getting
_Unwind_GetIP. Therefore we provide arch
specific backtrace file.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 years agomips/libdl: Apply relocations after appending the new scope
Khem Raj [Sat, 21 Jan 2012 08:21:41 +0000 (00:21 -0800)]
mips/libdl: Apply relocations after appending the new scope

Without this the relocations for the current shared object
are not resolved since the scope is not added to map yet

Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 years agoi386/sigaction.c: slightly more readable form of [rt_]sigreturn definitions
Denys Vlasenko [Wed, 18 Jan 2012 13:49:11 +0000 (14:49 +0100)]
i386/sigaction.c: slightly more readable form of [rt_]sigreturn definitions

No code changes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
12 years agostubs: mark stubs as used
Bernhard Reutner-Fischer [Wed, 18 Jan 2012 08:12:47 +0000 (09:12 +0100)]
stubs: mark stubs as used

Avoids warning from -Wunused-function about the alias target that is
only used at link-time.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agostdlib: use shorhand wur for realloc prototype
Bernhard Reutner-Fischer [Wed, 18 Jan 2012 08:09:01 +0000 (09:09 +0100)]
stdlib: use shorhand wur for realloc prototype

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agobuildsys: add cppcheck wrapper script
Bernhard Reutner-Fischer [Wed, 18 Jan 2012 07:44:39 +0000 (08:44 +0100)]
buildsys: add cppcheck wrapper script

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibcrypt: shrink crypt() again - unmodularise
Bernhard Reutner-Fischer [Wed, 18 Jan 2012 07:41:18 +0000 (08:41 +0100)]
libcrypt: shrink crypt() again - unmodularise

modularisation added too much bloat for no benefit, undo.

$ ../busybox/scripts/bloat-o-meter .lib.05/libcrypt-0.9.33-rc1-git.so lib/libcrypt-0.9.33-rc1-git.so
function                                             old     new   delta
crypt                                                130      46     -84
.rodata                                             2704       -   -2704
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-2788)         Total: -2788 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agonptl: .gitignore generated pt-crt{i,n}.S
Bernhard Reutner-Fischer [Wed, 18 Jan 2012 07:18:13 +0000 (08:18 +0100)]
nptl: .gitignore generated pt-crt{i,n}.S

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agotests: only test crypt if we have an impl
Bernhard Reutner-Fischer [Tue, 17 Jan 2012 09:35:52 +0000 (10:35 +0100)]
tests: only test crypt if we have an impl

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agotests: add sha356/512 tests
Bernhard Reutner-Fischer [Tue, 17 Jan 2012 09:35:15 +0000 (10:35 +0100)]
tests: add sha356/512 tests

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agotests: silence warnings in crypt
Bernhard Reutner-Fischer [Tue, 17 Jan 2012 09:34:20 +0000 (10:34 +0100)]
tests: silence warnings in crypt

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agobuildsys: use = for --sort-section linker flag
Mike Frysinger [Tue, 17 Jan 2012 03:00:18 +0000 (22:00 -0500)]
buildsys: use = for --sort-section linker flag

The spaces aren't handled correctly (currently) when outputting the
CFLAGS version of the linker flag.

Reported-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotests: mark all helper scripts +x
Mike Frysinger [Mon, 16 Jan 2012 22:41:50 +0000 (17:41 -0500)]
tests: mark all helper scripts +x

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agobuildsys: handle more clean targets
Mike Frysinger [Mon, 16 Jan 2012 22:24:23 +0000 (17:24 -0500)]
buildsys: handle more clean targets

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agobuildsys: fix handling of CFLAG_-W{a,l} vars
Mike Frysinger [Mon, 16 Jan 2012 22:13:28 +0000 (17:13 -0500)]
buildsys: fix handling of CFLAG_-W{a,l} vars

Need a little indirection/delayed evaluation to handle variables with
equal signs and commas in them.

Reported-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotests: tst-futimens1: add missing mode args to open()
Mike Frysinger [Mon, 16 Jan 2012 09:50:57 +0000 (04:50 -0500)]
tests: tst-futimens1: add missing mode args to open()

Since we use O_CREAT with open(), need to make sure to pass in mode too.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotests: test-canon: include sys/stat.h for mkdir()
Mike Frysinger [Mon, 16 Jan 2012 09:41:29 +0000 (04:41 -0500)]
tests: test-canon: include sys/stat.h for mkdir()

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotests: fdopen: add missing mode args to open()
Mike Frysinger [Mon, 16 Jan 2012 09:33:44 +0000 (04:33 -0500)]
tests: fdopen: add missing mode args to open()

We call open() with O_CREAT, so make sure we pass in the mode else
we might get build errors with fortify source.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotests: opendir-tst1: add header for mknod()
Mike Frysinger [Mon, 16 Jan 2012 09:33:08 +0000 (04:33 -0500)]
tests: opendir-tst1: add header for mknod()

Include sys/stat.h for mknod() prototype.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotests: mmap2: ignore permission denied errors on /dev/mem
Mike Frysinger [Mon, 16 Jan 2012 08:50:04 +0000 (03:50 -0500)]
tests: mmap2: ignore permission denied errors on /dev/mem

Non-root users can't open /dev/mem, so it makes it hard to pass.
Ignore that case.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agobuildsys: skip compiler flag checking for clean targets
Mike Frysinger [Sun, 15 Jan 2012 18:08:12 +0000 (13:08 -0500)]
buildsys: skip compiler flag checking for clean targets

As suggested by Bernhard, there is no point in evaluating the compiler's
flag availability when cleaning, so skip things in that case.  If there
are variables that change targets based on the flags, then things are
already broken and need fixing independently.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agomips/dlfcn.h: Disable RTLD_DEEPBIND
Khem Raj [Mon, 16 Jan 2012 16:48:27 +0000 (08:48 -0800)]
mips/dlfcn.h: Disable RTLD_DEEPBIND

RTLD_DEEPBIND is not supported in uclibc

Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 years agobuildsys: simplify include_clean greatly
Mike Frysinger [Sun, 15 Jan 2012 18:33:11 +0000 (13:33 -0500)]
buildsys: simplify include_clean greatly

Since we want to clean out all the headers we symlinked into include/,
just use `find` to locate all the symlinks for us.  This simplifies it
greatly, and actually fixes bugs where we build for one arch, switch
to another, and then do a clean but the previous arch headers are left
behind.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agobuildsys: fix detection of silent make
Mike Frysinger [Sun, 15 Jan 2012 18:31:31 +0000 (13:31 -0500)]
buildsys: fix detection of silent make

The MAKEFLAGS variable contains all the flags without the leading dash.
From the GNU make manual:
This variable is set up automatically by make to contain the flag
letters that make received. Thus, if you do ‘make -ks’ then MAKEFLAGS
gets the value ‘ks’.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotests: skip redundant -Wstrict-prototypes setup
Mike Frysinger [Sun, 15 Jan 2012 18:06:58 +0000 (13:06 -0500)]
tests: skip redundant -Wstrict-prototypes setup

We inherit the top-level Rules.mak which sets up this flag for us,
so just rely on that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolibc: build abort with unwind-info for backtrace
Bernhard Reutner-Fischer [Sun, 15 Jan 2012 11:27:41 +0000 (12:27 +0100)]
libc: build abort with unwind-info for backtrace

If backtrace support is turned on, build raise() and abort() with
unwind info (fixup 4c9b7f3c21ff21c199e54bfad2fdf3445fa4573d).

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolinuxthreads/signals: do not restore handler for invalid signal
Markos Chandras [Wed, 23 Nov 2011 13:45:47 +0000 (13:45 +0000)]
linuxthreads/signals: do not restore handler for invalid signal

Invalid signals have no handlers so when trying to restore the old
handler to a bad signal a SIGSEGV occurs. This is because the library
tries to store the old handler to an invalid memory area where it things
the bad signal lives.

URL: https://bugs.busybox.net/show_bug.cgi?id=4640
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agobuildsys: cache build flags in vars
Mike Frysinger [Sun, 27 Nov 2011 05:15:07 +0000 (00:15 -0500)]
buildsys: cache build flags in vars

Running `make clean` atm takes like 20 seconds because every subdir
re-evaluates all the toolchain flags.  Add some helpers to automate
the process of setting up variables to cache the result of tests,
as well as the checking of an already set flag.

Now `make clean` takes like 2 seconds on my system.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolibubacktrace: use -asynchronous-funwind-tables rather than -funwind-tables
Carmelo Amoroso [Fri, 13 Jan 2012 11:27:29 +0000 (12:27 +0100)]
libubacktrace: use -asynchronous-funwind-tables rather than -funwind-tables

From gcc documentation, we can read:
" ...
-fasynchronous-unwind-tables
    Generate unwind table in dwarf2 format, if supported by target
    machine. The table is exact at each instruction boundary, so it can be
    used for stack unwinding from asynchronous events (such as debugger or
    garbage collector)
..."

So it seems better rather than using -funwind-tables (glibc seems to prefer
-fasynchronous-unwind-tables).

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agolibc: allow to backtrace out of abort call
Carmelo Amoroso [Tue, 3 Jan 2012 18:09:56 +0000 (19:09 +0100)]
libc: allow to backtrace out of abort call

Build raise and abort function with dwarf2 info by using
-fasynchronous-unwind-tables to make backtrace() working across a
call to abort.

A scenario where it could be useful is within a signal handler that
wants to dump a backtrace when catching some signal (i.e SIGABRT).
Without having abort & raise built with DWARF2 information, it is not
possible for the libgcc stack unwinder to walk through the call stack
out of the abort/raise function.

Impacts in terms of size are really limited

Current
   text    data     bss     dec     hex filename
    164       0       0     164      a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os
    164       0       0     164      a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS
    220      24       4     248      f8 ./libc/stdlib/abort.os

With (-fasynchronous-unwind-tables)

   text    data     bss     dec     hex filename
    216       0       0     216      d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os
    216       0       0     216      d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS
    280      24       4     308     134 ./libc/stdlib/abort.os

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoconfig: remove some redundant words in the menus
Mike Frysinger [Mon, 2 Jan 2012 07:34:44 +0000 (02:34 -0500)]
config: remove some redundant words in the menus

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: setup search path even when there are no "/"
Mike Frysinger [Mon, 2 Jan 2012 07:43:37 +0000 (02:43 -0500)]
ldso: setup search path even when there are no "/"

If people use an interp path such as "ld.so", then there is no "/" found,
and we end up dereferencing a NULL pointer.  Simplify the logic by having
a relative interp path like that be the same as "" (which the code later
on interprets as $PWD).

While we're here, document some of the nuances of this code.

Reported-by: Ignacy Gawędzki <uclibc@qult.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: simplify interp path search logic
Mike Frysinger [Mon, 2 Jan 2012 07:24:49 +0000 (02:24 -0500)]
ldso: simplify interp path search logic

The setup logic is duplicated, so unify it in a local func.

Mark the variable const while we're doing this, and add missing
ifdef protection to the header that declares it availability.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agogetpass: s/sizeof(buf)-1/sizeof(buf)/ in fgets
Denys Vlasenko [Sun, 1 Jan 2012 16:31:40 +0000 (17:31 +0100)]
getpass: s/sizeof(buf)-1/sizeof(buf)/ in fgets

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agobump version to 0.9.33-rc1-git
Bernhard Reutner-Fischer [Fri, 30 Dec 2011 11:40:53 +0000 (12:40 +0100)]
bump version to 0.9.33-rc1-git

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agorelease 0.9.33-rc1
Bernhard Reutner-Fischer [Fri, 30 Dec 2011 11:38:44 +0000 (12:38 +0100)]
release 0.9.33-rc1

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agogetpass: several fixes
Denys Vlasenko [Fri, 23 Dec 2011 13:24:12 +0000 (14:24 +0100)]
getpass: several fixes

fixes bogus fgets error check
fixes bogus strlen() < 0 check
switches off buffering regardless of tcgetattr() success
prints newline even on error or if there was no '\n' on input
uses sizeof(buf) instead of PWD_BUFFER_SIZE

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
12 years agolibubacktrace: use -funwind-tables rather than -fexecptions
Carmelo Amoroso [Thu, 22 Dec 2011 14:25:42 +0000 (15:25 +0100)]
libubacktrace: use -funwind-tables rather than -fexecptions

For backtrace to work is enough to use -funwind-tables instead
of -fexceptions.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agolibcrypt: add support for SHA256-CRYPT password hashing
William Pitcock [Mon, 19 Dec 2011 07:25:09 +0000 (01:25 -0600)]
libcrypt: add support for SHA256-CRYPT password hashing

This is based on Ulrich Drepper's implementation in GLIBC, but hacked up to work
in uClibc.  The differences from the GLIBC version are as follows:

- b64_from_24bit() has been converted into a macro
- Usage of GLIBC-isms (such as libc_freeres_ptr) have been removed

It is enabled by the UCLIBC_HAS_SHA256_CRYPT_IMPL configuration symbol.  You must
have UCLIBC_HAS_CRYPT_IMPL enabled as well.

Signed-off-by: William Pitcock <nenolod@dereferenced.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibcrypt: add support for SHA512-CRYPT password hashing
William Pitcock [Mon, 19 Dec 2011 07:24:16 +0000 (01:24 -0600)]
libcrypt: add support for SHA512-CRYPT password hashing

This is based on Ulrich Drepper's implementation in GLIBC, but hacked up to work
in uClibc.  The differences from the GLIBC version are as follows:

- b64_from_24bit() has been converted into a macro
- Usage of GLIBC-isms (such as libc_freeres_ptr) have been removed

It is enabled by the UCLIBC_HAS_SHA512_CRYPT_IMPL configuration symbol.  You must
have UCLIBC_HAS_CRYPT_IMPL enabled as well.

Signed-off-by: William Pitcock <nenolod@dereferenced.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibcrypt: make crypt() itself more modular
William Pitcock [Mon, 19 Dec 2011 07:21:33 +0000 (01:21 -0600)]
libcrypt: make crypt() itself more modular

By using a function table, we can more cleanly support new crypt
implementations, such as SHA256 ($5$) and SHA512 ($6$).

Signed-off-by: William Pitcock <nenolod@dereferenced.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibdl: rudimentary locking for dlopen/dlsym/dlclose
Timo Teräs [Thu, 24 Mar 2011 11:27:36 +0000 (13:27 +0200)]
libdl: rudimentary locking for dlopen/dlsym/dlclose

This implements big-dlfcn lock to allow multithreaded usage of
dlopen/dlsym/dlclose. We should really clean up the dl code so
we can use more fine grained locking or even RCU where appropriate.
But at least we won't crash now.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agosys/queue.h: update to eglibc version
Natanael Copa [Fri, 16 Dec 2011 10:06:54 +0000 (11:06 +0100)]
sys/queue.h: update to eglibc version

Xen needs SIMPLEQ_* queue types which was not provided from the old
uclibc queue.h.

Use same implementation as eglibc.
Grabbed from: http://www.eglibc.org/svn/trunk/libc/misc/sys/queue.h

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agox86_64: add PLT bypass for __sigsetjmp
Mike Frysinger [Sat, 3 Dec 2011 17:48:24 +0000 (12:48 -0500)]
x86_64: add PLT bypass for __sigsetjmp

The current x86_64 setjmp helpers incur a reloc, so fix that up.

$ readelf -r lib/libc.so.0
...
Relocation section '.rela.plt' at offset 0xb058 contains 10 entries:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000236010  02a400000007 R_X86_64_JUMP_SLO 000000000000b3c4 __sigsetjmp + 0
...

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agogetutid: add a hidden def
Mike Frysinger [Sat, 3 Dec 2011 17:16:56 +0000 (12:16 -0500)]
getutid: add a hidden def

The pututline func calls getutid, so add a hidden def for
it to avoid plt relocs:

$ readelf -r lib/libc.so.0
...
Relocation section '.rela.plt' at offset 0xb058 contains 11 entries:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000236000  01cf00000007 R_X86_64_JUMP_SLO 00000000000190ab getutid + 0
...

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: bfin: fix sram_flags init
Mike Frysinger [Sun, 27 Nov 2011 18:03:09 +0000 (13:03 -0500)]
ldso: bfin: fix sram_flags init

An earlier version had this, but was lost as code was shuffled around.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: bfin: shrink sram mapping func
Mike Frysinger [Sun, 27 Nov 2011 10:00:48 +0000 (05:00 -0500)]
ldso: bfin: shrink sram mapping func

The L1 data and L2 code paths duplicate a lot, so unify them.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>