OSDN Git Service

uclinux-h8/uClibc.git
13 years agoldso: Fix loadaddr and mappaddr when prelink support is enabled.
Filippo Arcidiacono [Thu, 26 Aug 2010 10:00:03 +0000 (12:00 +0200)]
ldso: Fix loadaddr and mappaddr when prelink support is enabled.

Fixed loadaddr and mappaddr fields to correctly work when prelink
support is enabled.
- loadaddr is an offset relative to the first loadable segment.
- mapaddr is the address where the object has been mapped in memory.

Non PIC library detection fixed too.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoldso: Add runtime prelink support
Filippo Arcidiacono [Mon, 2 Aug 2010 15:23:35 +0000 (17:23 +0200)]
ldso: Add runtime prelink support

Added runtime prelink support to be able to run a prelinked
application; at process startup only the conflicts will be relocated.
This speed up the startup time.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoldso: Do not add the ld.so at the end of the loaded modules list
Filippo Arcidiacono [Fri, 30 Jul 2010 12:18:38 +0000 (14:18 +0200)]
ldso: Do not add the ld.so at the end of the loaded modules list

The dynamic linker was included indifferently at the end of the
loaded modules list. In order to be used with prelink, it is required
to included the ld.so in the local scope of each shared libraries that
depends directly on it.
Also it is included in the global scope at the first occurrence.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoldso: Add support for LD_WARN and LD_TRACE_PRELINKING
Filippo Arcidiacono [Fri, 30 Jul 2010 07:17:58 +0000 (09:17 +0200)]
ldso: Add support for LD_WARN and LD_TRACE_PRELINKING

Added support for the following tracing capabilities:
- LD_WARN to warn about undefined symbols during the lookup stage.
- LD_TRACE_PRELINKING to trace the needed libraries of the object
  that we are prelinking.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoldso: Rework global scope handling and symbol lookup mechanism
Filippo Arcidiacono [Thu, 29 Jul 2010 09:35:05 +0000 (11:35 +0200)]
ldso: Rework global scope handling and symbol lookup mechanism

Global symbol scope is implemented as a linked list of
local scope, that dynamically grows and shrinks when dlopen/
dlclose are called. Each local scope is implemented as an array
of pointer to struct elf_resolve.
This will help to detect conflict when LD_TRACE_PRELINKING option
will be implemented.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoldso: Add implementation of ld.so standalone execution
Filippo Arcidiacono [Fri, 31 Jul 2009 12:56:38 +0000 (14:56 +0200)]
ldso: Add implementation of ld.so standalone execution

The dynamic linker can be run either indirectly through running some
dynamically linked program or library (in which case no command line options
to the dynamic linker can be passed and, in the ELF case, the dynamic linker
which is stored in the .interp section of the program is executed)
or directly by running:
 /lib/ld-uClibc.so.*  [OPTIONS] [PROGRAM [ARGUMENTS]]

Stand-alone execution is a prerequisite for adding prelink capabilities
to uClibc dynamic linker, as well useful for testing an updated version
of the dynamic linker without breaking the whole system.

Currently supported option:
  --library-path PATH   use given PATH instead of content of the environment
                        variable LD_LIBRARY_PATH

(Mandatory for prelinking)

Not supported options:
  --list                list all dependencies and how they are resolved
  --verify              verify that given object really is a dynamically linked
                        object we can handle
  --inhibit-rpath LIST  ignore RUNPATH and RPATH information in object names
                        in LIST

This feature can be enabled by setting LDSO_STANDALONE_SUPPORT=y

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agolibc: Handle cancellation in non multiplexed socket calls
Carmelo Amoroso [Wed, 30 Jun 2010 06:32:15 +0000 (08:32 +0200)]
libc: Handle cancellation in non multiplexed socket calls

For those archs that provide non multiplexed socket calls
it possible to implement the lib C wrappers without calling the
multi-purpose __socketcall. For a subset of these functions that
are cancellation point, it needs to correctly handle cancellation.

Signed-off-by: Francesco Rundo <francesco.rundo@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agonptl: Remove nptl/sysdeps/generic directory from include list
Carmelo Amoroso [Thu, 16 Sep 2010 12:52:11 +0000 (14:52 +0200)]
nptl: Remove nptl/sysdeps/generic directory from include list

All archs have now moved their generic sysdep.h header from
sysdeps/generic to sysdeps/common directory, so it is possible
to remove the sysdeps/generic directory from the include list.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agonptl_sh: Fix compiler warning due to shadowed variable
Carmelo Amoroso [Tue, 20 Jul 2010 05:45:19 +0000 (07:45 +0200)]
nptl_sh: Fix compiler warning due to shadowed variable

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agolibc: Add canonicalize_file_name function
Carmelo Amoroso [Thu, 16 Sep 2010 10:22:34 +0000 (12:22 +0200)]
libc: Add canonicalize_file_name function

Add canonicalize_file_name function and its related tests.
Required by elfutils and coreutils (readlink).

Signed-off-by: Salvatore Cro <salvatore.cro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agotest: Update gitignore to take into account new tests added.
Carmelo Amoroso [Thu, 16 Sep 2010 09:49:20 +0000 (11:49 +0200)]
test: Update gitignore to take into account new tests added.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoldso: Do not adjust dynamic section entries unnecessarily
Filippo Arcidiacono [Tue, 27 Jul 2010 15:45:26 +0000 (17:45 +0200)]
ldso: Do not adjust dynamic section entries unnecessarily

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agotests: Added new nptl tests
Salvatore Cro [Fri, 10 Sep 2010 08:55:43 +0000 (10:55 +0200)]
tests: Added new nptl tests

tests: Added several nptl tests from glibc 2.10.1

Signed-off-by: Salvatore Cro <salvatore.cro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agosh: update the memcpy adding a new loop with aggressive prefetching
Salvatore Cro [Thu, 9 Sep 2010 14:10:21 +0000 (16:10 +0200)]
sh: update the memcpy adding a new loop with aggressive prefetching

After exploring different prefetch distance-degree combinations
in this new update of the memcpy function, a new loop has been added
for moving many cache lines with an aggressive prefetching schema.
Prefetch has been removed when move few cache line aligned blocks.
As final result, this memcpy gives us the same performances for small
sizes (we already had!) and better numbers for big copies.
In case of SH4-300 CPU Series, benchmarks show a gain of ~20% for sizes
from 4KiB to 256KiB.
In case of the SH4-200, there is a gain of ~40% for sizes bigger than
32KiB.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agosh: move data without fetching cache block within the memset
Salvatore Cro [Thu, 9 Sep 2010 14:08:54 +0000 (16:08 +0200)]
sh: move data without fetching cache block within the memset

With this patch the movca.l instruction is used within the memset.
The current memset implementation only uses the FPU and there is
an real gain for all the sizes.
Adding the movca.l instruction numbers always are better than the generic code.
There is a big gain for size greater than 64 KiB but number are worst for 4-32KiB
sizes compared with the implementation without movca.l.

Time Memory Bandwidth (Mbytes)
-------------------------------------------------
    Generic         SH4          SH4
                   (FPU)     (FPU+movca.l)
-------------------------------------------------
512         1143  1998          1596
1 KiB       1273  2567          1915
2 KiB       1350  2993          2128
4-32KiB     1391  3262          2252
64KiB-16MiB 170  186       *830*

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agolibc: Fix cancellation handling in some C functions
Salvatore Cro [Thu, 9 Sep 2010 14:01:04 +0000 (16:01 +0200)]
libc: Fix cancellation handling in some C functions

According to POSIX.1-2008 standard, the following syscalls shall be
cancellation points : waitid, sleep, fdatasync, ppoll.
Further, if generic syscall is not available and stubs are
configured, provide the stub implementation for function.

Signed-off-by: Salvatore Cro <salvatore.cro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agolibubacktrace: Provide uClibc with backtrace functions
Salvatore Cro [Thu, 9 Sep 2010 13:45:44 +0000 (15:45 +0200)]
libubacktrace: Provide uClibc with backtrace functions

A new shared object, libubacktrace.so.0 is added to uClibc
to provide backtrace functions to support application self-debugging.
This set of functions requires to dynamically load libgcc_s.so so they
need to call dlopen/dlsym that are provided by libdl. For this reason
they cannot be included into libc.so.0 but are provided by a new library.

User application that wants to use backtrace needs to be compiled with
-fexceptions option and -rdynamic to get full symbols printed and must be
linked against libubacktrace.so

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agomisc: utmpx based logging support
Salvatore Cro [Thu, 9 Sep 2010 13:38:15 +0000 (15:38 +0200)]
misc: utmpx based logging support

misc: Added support for accessing user accounting database based
on utmpx structure.

Signed-off-by: Salvatore Cro <salvatore.cro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agonptl: fix static linking
Natanael Copa [Thu, 9 Sep 2010 12:03:10 +0000 (14:03 +0200)]
nptl: fix static linking

We need dl-tls.c for static libc or we will get missing symbols when
linking thinkgs like openssl static.

Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agotests: nptl tests dependencies cleanup
Salvatore Cro [Thu, 9 Sep 2010 06:20:44 +0000 (08:20 +0200)]
tests: nptl tests dependencies cleanup

tests: some cleanings on nptl tests' dependencies.

Signed-off-by: Salvatore Cro <salvatore.cro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoldso: Fix compilation for x86_64 without TLS support.
Will Newton [Mon, 6 Sep 2010 14:59:21 +0000 (15:59 +0100)]
ldso: Fix compilation for x86_64 without TLS support.

Add an #ifdef to avoid using TLS structures when TLS is not enabled.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agomisc: Fix build error about missing PAGE_SIZE
Abdoulaye Walsimou Gaye [Sun, 5 Sep 2010 22:45:10 +0000 (00:45 +0200)]
misc: Fix build error about missing PAGE_SIZE

This patch fixes the following build error:

  CC libc/misc/internals/__h_errno_location.os
  CC libc/misc/internals/parse_config.os
libc/misc/internals/parse_config.c: In function
'bb_get_chunk_with_continuation':
libc/misc/internals/parse_config.c:77: error: 'PAGE_SIZE' undeclared (first use in this function)
libc/misc/internals/parse_config.c:77: error: (Each undeclared identifier is reported only once
libc/misc/internals/parse_config.c:77: error: for each function it appears in.)
make[2]: *** [libc/misc/internals/parse_config.os] Error 1

Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agolibc: Provide both getpgid and __getpgid symbols
Carmelo Amoroso [Mon, 23 Aug 2010 22:14:00 +0000 (00:14 +0200)]
libc: Provide both getpgid and __getpgid symbols

Indeed unistd.h header does export '__getpgid' by default, while
uClibc provide only 'getpgid' implementation. The 'getpgid' symbol
is exported by standard header if __USE_XOPEN_EXTENDED is defined.
This patch alignes uClibc implementation with standard header (matching
with glibc behaviour).

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoFix resolver broken in NPTL build
Timo Teräs [Wed, 12 May 2010 07:32:48 +0000 (10:32 +0300)]
Fix resolver broken in NPTL build

The combination of

commit aab4df0fb51660300559f5f29290709db2f7bfee
  resolv.c: add support for per thread res_state

commit cca45baf8353d1e338d232f5bdb2d1d6b357f1da
  /etc/resolv.conf: support "timeout:n" and "attempts:n" options

.. and NPTL results in broken resolver in very annoying ways.

Now, it seems that most of the uclibc code does not work well
if res_state is TLS variable. Technically, this is the correct thing
to do since this gives proper per-thread resolving behavior, and
it also makes the config options overridable per thread. This
probably what apps expect as glibc does it too.

But alas, most places use _res to sync up static global variables
which results in breakage. It gets more or less randomly selected
which threads options get applied. Also in case of multiple servers
it looks like the retry logic is shared between all threads, e.g.
two concurrent resolutions can make other resolvers skip nameservers
due to shared "last_ns_num".

And finally the timeout/attempts commit breaks the accumulated stuff
horribly. What happens is:
 1. multithreaded application startups, initializes resolver,
    resolves things just fine
 2. resolv.conf gets changed, application calls res_init
    after res_init uclibc will call res_sync on all resolver functions
    to refresh globals from the TLS variable _res
 3. res_init was called only in one thread, so other thread's
    _res contains all zeroes (yes, this is correct app usage:
    res_init should be called only from one thread)
 4. threads not calling res_init get broken resolver due to timeout
    being set to zero

Now, one proper solution would be to:
 1. make __open_nameservers return the configuration options
 2. pass the config options struct to res_sync_func so it can do
    the proper overrides from per-thread _res
 3. remove the related globals and use locally config options from
    __open_nameservers

But technically, the correct thing (as in glibc does this) is:
 - res_init increases global "res_init timestamp"
 - use _res (or pointer within there) for resolver retries etc.
   get proper per-thread behavior
 - resolvers functions call "maybe_init" which reinitialize the
   TLS'ed resolver state (e.g. reload resolv.conf) if their res_init
   timestamp is out dated

As an immediate emergency kludge fix, the following might do:

resolv: fix options handling for TLS _res

If _res is in TLS (NPTL), it might not get initialized. Assume
zeroes mean default values.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 years ago_uintmaxtostr: fix indentation (spaces->tabs), no code changes
Denys Vlasenko [Thu, 26 Aug 2010 10:40:28 +0000 (12:40 +0200)]
_uintmaxtostr: fix indentation (spaces->tabs), no code changes

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
13 years agoresolv: simplify MAXALIAS handling
Bernhard Reutner-Fischer [Thu, 19 Aug 2010 17:07:43 +0000 (19:07 +0200)]
resolv: simplify MAXALIAS handling

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agogetserv: fix reading services lines w > 80 chars
Bernhard Reutner-Fischer [Thu, 19 Aug 2010 17:06:26 +0000 (19:06 +0200)]
getserv: fix reading services lines w > 80 chars

e.g. getservbyname()

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoadd header guard
Bernhard Reutner-Fischer [Wed, 18 Aug 2010 14:03:23 +0000 (16:03 +0200)]
add header guard

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agobuildsys: Do not error on GNUHASH for clean targets
Bernhard Reutner-Fischer [Wed, 18 Aug 2010 13:52:29 +0000 (15:52 +0200)]
buildsys: Do not error on GNUHASH for clean targets

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agotestsuite: nptl/tst-basic5 depends on SUSV4_LEGACY
Bernhard Reutner-Fischer [Tue, 17 Aug 2010 15:47:09 +0000 (17:47 +0200)]
testsuite: nptl/tst-basic5 depends on SUSV4_LEGACY

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: fix calling convention for __pthread_mutex_cond_lock
Timo Teräs [Fri, 6 Aug 2010 10:31:35 +0000 (13:31 +0300)]
nptl: fix calling convention for __pthread_mutex_cond_lock

The assembly versions of pthread_cond_wait calls
__pthread_mutex_cond_lock and __pthread_mutex_cond_lock_adjust
using internal calling convention (which differs from default
calling convention at least on x86). Thus these two functions
must be defined with internal_function or the call sequence goes
wrong.

__pthread_mutex_cond_lock resides in
sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c, but it does
evil macro definitions and includes pthread_mutex_lock.c, so
we need to add some extra kludge to pthread_mutex_lock.c to get
the prototypes correctly.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoconfig parser: fix memory corruption
Timo Teräs [Fri, 6 Aug 2010 08:34:11 +0000 (11:34 +0300)]
config parser: fix memory corruption

fgets will happily write over allocated area limits. Adjusted the
buffer size according to how much is already read.

Also increase the maximum default line length, as 80 is slightly
small. It might be better if bb_get_chunk_with_continuation would
reallocate the line buffer if it was not user given.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl i686: avoid cpp problems with thunk section
Bernhard Reutner-Fischer [Thu, 5 Aug 2010 22:00:16 +0000 (00:00 +0200)]
nptl i686: avoid cpp problems with thunk section

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoRevert "nptl i686: fix pthread_cond_wait.S compilation"
Bernhard Reutner-Fischer [Thu, 5 Aug 2010 21:52:14 +0000 (23:52 +0200)]
Revert "nptl i686: fix pthread_cond_wait.S compilation"

This reverts commit f71c0d8af11252f119fad04938ddd5501a7df21a.

13 years agoresolver: switch to config parser
Bernhard Reutner-Fischer [Mon, 1 Mar 2010 13:40:45 +0000 (14:40 +0100)]
resolver: switch to config parser

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agogetnet: switch to config parser
Bernhard Reutner-Fischer [Sun, 28 Feb 2010 13:16:56 +0000 (14:16 +0100)]
getnet: switch to config parser

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agogetproto: switch to config parser
Bernhard Reutner-Fischer [Fri, 5 Feb 2010 10:45:25 +0000 (11:45 +0100)]
getproto: switch to config parser

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agousershell: switch to config parser
Bernhard Reutner-Fischer [Sun, 31 Jan 2010 23:07:07 +0000 (00:07 +0100)]
usershell: switch to config parser

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoswitch getservice to config parser
Bernhard Reutner-Fischer [Sat, 30 Jan 2010 11:10:13 +0000 (12:10 +0100)]
switch getservice to config parser

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agosysconf: implement _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN
Bernhard Reutner-Fischer [Sat, 23 Jan 2010 13:15:33 +0000 (14:15 +0100)]
sysconf: implement _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN

perusing the config parser

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoadd config parser
Bernhard Reutner-Fischer [Sun, 17 Jan 2010 16:07:22 +0000 (17:07 +0100)]
add config parser

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agomath: isnan is a C99 feature
Henning Heinold [Thu, 5 Aug 2010 16:22:12 +0000 (18:22 +0200)]
math: isnan is a C99 feature

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
13 years agonptl: fix x86 assembly PIC relocations
Timo Teräs [Thu, 5 Aug 2010 10:21:33 +0000 (13:21 +0300)]
nptl: fix x86 assembly PIC relocations

Unwind_Resume needs to be called via PLT. Most calls are already proper,
this fix the remaining two problems.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agobuildsys: check_gcc warning flags
Bernhard Reutner-Fischer [Thu, 5 Aug 2010 13:50:23 +0000 (15:50 +0200)]
buildsys: check_gcc warning flags

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoutils: add pregen requisite
Bernhard Reutner-Fischer [Wed, 4 Aug 2010 07:14:15 +0000 (09:14 +0200)]
utils: add pregen requisite

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: _POSIX_IPV6 depends on UCLIBC_HAS_IPV6
Bernhard Reutner-Fischer [Mon, 2 Aug 2010 17:51:27 +0000 (19:51 +0200)]
nptl: _POSIX_IPV6 depends on UCLIBC_HAS_IPV6

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: fix LFS handling
Bernhard Reutner-Fischer [Fri, 30 Jul 2010 10:51:01 +0000 (12:51 +0200)]
nptl: fix LFS handling

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: do not define _POSIX_SPAWN since its not implemented
Natanael Copa [Fri, 30 Jul 2010 08:05:04 +0000 (08:05 +0000)]
nptl: do not define _POSIX_SPAWN since its not implemented

Building things like vlc checks if _POSIX_SPAWN is defined. Since
posix_spawn is not implemented we dont define it.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
13 years agoImmediately try next nameserver on recv() failure
Ingo van Lil [Wed, 28 Jul 2010 12:52:08 +0000 (14:52 +0200)]
Immediately try next nameserver on recv() failure

If there is a problem communicating with a nameserver the __dns_lookup()
function will not immediately advance to the next nameserver but instead
continue waiting until the timeout expires. This will cause a 30 second
delay even if no nameserver is configured in resolv.conf and no DNS is
running on localhost.

Signed-off-by: Ingo van Lil <inguin@gmx.de>
Acked-by: Roman I Khimov <khimov@altell.ru>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agomalloc: simplify MAP_UNINITIALIZE ifdef logic
Mike Frysinger [Tue, 27 Jul 2010 06:13:40 +0000 (02:13 -0400)]
malloc: simplify MAP_UNINITIALIZE ifdef logic

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agonew helper funcs for alloca/malloc with mmu/nommu
Mike Frysinger [Tue, 27 Jul 2010 05:48:22 +0000 (01:48 -0400)]
new helper funcs for alloca/malloc with mmu/nommu

The rpc rcmd code has some ugly ifdef mazes to handle mmu/nommu differences
just to select alloca or malloc.  Unify those with some helper macros in a
new header, and then convert the rcmd code over to it.

This is all geared towards fixing the getdents helper functions which only
use alloca() atm.  Now that we have helper functions, convert the getdents
functions over too.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Steven J. Magnani <steve@digidescorp.com>
13 years agoremove trailing comma in enum
Bernhard Reutner-Fischer [Tue, 27 Jul 2010 15:05:59 +0000 (17:05 +0200)]
remove trailing comma in enum

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agosilence warning about incompatible types with _dl_init_static_tls
Bernhard Reutner-Fischer [Tue, 27 Jul 2010 11:46:00 +0000 (13:46 +0200)]
silence warning about incompatible types with _dl_init_static_tls

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agobuildsys: tweak quoting of V=
Bernhard Reutner-Fischer [Tue, 27 Jul 2010 11:45:17 +0000 (13:45 +0200)]
buildsys: tweak quoting of V=

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agomalloc-simple: Make calloc() return zeroed memory
Steven J. Magnani [Wed, 9 Jun 2010 14:02:21 +0000 (09:02 -0500)]
malloc-simple: Make calloc() return zeroed memory

The 0.9.31 release included a change to malloc-simple to request
uninitialized memory from noMMU kernels. Unfortunately, the corresponding
calloc() code assumed that memory returned by malloc() was already zeroed,
which leads to all kinds of nastiness.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agolutimes: add lutimes support
Vladimir Zapolskiy [Wed, 2 Jun 2010 06:27:16 +0000 (10:27 +0400)]
lutimes: add lutimes support

This patch adds lutimes library call support.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoendian.h: add BSD convertions between big/little-endian byte order
Vladimir Zapolskiy [Tue, 1 Jun 2010 19:22:57 +0000 (23:22 +0400)]
endian.h: add BSD convertions between big/little-endian byte order

This patch adds support for convertion of values between host and
big-/little-endian byte order.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoFix ctime() standard compliance bug
David A Ramos [Tue, 27 Jul 2010 11:10:15 +0000 (13:10 +0200)]
Fix ctime() standard compliance bug

fixes issue2209:
ctime() was updated in 0.9.31 to call localtime_r() instead of
localtime() to
avoid using a static buffer. Unfortunately, this change replaces the
static
buffer (which is zeroed out on initialization) with an uninitialized
local
buffer.

In the common case, this has no effect. However, with a sufficiently
large
time_t value, the value returned differs from that returned by
asctime(localtime(t)), and thus violates the ANSI/ISO standard.

An example input is (on a 64-bit machine):
time_t t = 0x7ffffffffff6c600;

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoenable fcntl nocancel prototype for all threads
Mike Frysinger [Tue, 27 Jul 2010 01:39:07 +0000 (21:39 -0400)]
enable fcntl nocancel prototype for all threads

The cancel logic always uses this function even when !NPTL, so always
enable the prototype to avoid warnings.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agodaemon: drop cruft incorrectly re-introduced by nptl merge
Mike Frysinger [Tue, 27 Jul 2010 01:32:51 +0000 (21:32 -0400)]
daemon: drop cruft incorrectly re-introduced by nptl merge

This likes to break nommu systems.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agobfin: pull in common/sysdep.h
Mike Frysinger [Tue, 27 Jul 2010 01:26:21 +0000 (21:26 -0400)]
bfin: pull in common/sysdep.h

Fixes random build errors in linux/common/.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agomsync: skip if syscall is missing
Mike Frysinger [Tue, 27 Jul 2010 01:15:55 +0000 (21:15 -0400)]
msync: skip if syscall is missing

Some arches skip the msync syscall as it is useless (like nommu).  So
don't require it to build.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agonommu: fix building of fork.c when stubs are disabled
Mike Frysinger [Tue, 27 Jul 2010 01:13:20 +0000 (21:13 -0400)]
nommu: fix building of fork.c when stubs are disabled

We scrub the fork() prototype for nommu/no stubs, so attempting to get
its type isn't going to work.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agobfin: add exec stack markings to assembly files
Mike Frysinger [Tue, 27 Jul 2010 00:05:22 +0000 (20:05 -0400)]
bfin: add exec stack markings to assembly files

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoldso: Fix DL_BOOT_COMPUTE_DYN macro
Filippo Arcidiacono [Mon, 26 Jul 2010 13:45:47 +0000 (15:45 +0200)]
ldso: Fix DL_BOOT_COMPUTE_DYN macro

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
13 years agoRules.mak: ARM926T is really an armv5t and arm9e core.
Khem Raj [Fri, 23 Jul 2010 02:53:19 +0000 (19:53 -0700)]
Rules.mak: ARM926T is really an armv5t and arm9e core.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agoarm/crt1.S: Avoid dependency on PC+4 or PC+8
Khem Raj [Thu, 22 Jul 2010 06:54:15 +0000 (23:54 -0700)]
arm/crt1.S: Avoid dependency on PC+4 or PC+8

* fix a problem with Thumb PIE binaries,
  where the GOT was located incorrectly because of an offset 8

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agoldso/arm: Correct protected symbol resolution
Khem Raj [Thu, 22 Jul 2010 06:51:40 +0000 (23:51 -0700)]
ldso/arm: Correct protected symbol resolution

* Protected symbols should not be overridden with
  symbols from other modules.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agoldso/mips: pltgot should array not address of array to dynamic info.
Khem Raj [Mon, 19 Jul 2010 07:44:45 +0000 (00:44 -0700)]
ldso/mips: pltgot should array not address of array to dynamic info.

* This change was introduced in commit 9381d622e2411a35a5fd73a5a573eb269e2dd9c9
  which rendered uclibc not booting on mips targets. Restoring it makes
  it work again.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agoarm: Macros in sysdeps/linux/arm also needed to be changed to accept _a1 to __a1...
Khem Raj [Thu, 15 Jul 2010 17:18:59 +0000 (10:18 -0700)]
arm: Macros in sysdeps/linux/arm also needed to be changed to accept _a1 to __a1 renaming.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agonptl: (librt) powerpc32's PSEUDO_RET needs __syscall_error
Bernhard Reutner-Fischer [Thu, 15 Jul 2010 12:22:56 +0000 (14:22 +0200)]
nptl: (librt) powerpc32's PSEUDO_RET needs __syscall_error

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agosilence shadow warnings
Bernhard Reutner-Fischer [Wed, 14 Jul 2010 19:57:53 +0000 (21:57 +0200)]
silence shadow warnings

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: remove superfluous =1 from defines
Bernhard Reutner-Fischer [Wed, 14 Jul 2010 18:00:52 +0000 (20:00 +0200)]
nptl: remove superfluous =1 from defines

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: x86_64: fix compilation of unwinder
Bernhard Reutner-Fischer [Wed, 14 Jul 2010 17:44:03 +0000 (19:44 +0200)]
nptl: x86_64: fix compilation of unwinder

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl i686: fix pthread_cond_wait.S compilation
Roman I Khimov [Wed, 14 Jul 2010 13:19:29 +0000 (17:19 +0400)]
nptl i686: fix pthread_cond_wait.S compilation

__i686 is a gcc-defined macro, so i686 build failed with:
libpthread/nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S: Assembler messages:
libpthread/nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:572: Error: junk at end of line, first unrecognized character is `1'
libpthread/nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:573: Error: junk at end of line, first unrecognized character is `1'
libpthread/nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:574: Error: junk at end of line, first unrecognized character is `1'
libpthread/nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:575: Error: junk at end of line, first unrecognized character is `.'
libpthread/nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:576: Error: junk at end of line, first unrecognized character is `1'
libpthread/nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:579: Error: expected comma after name `' in .size directive

Signed-off-by: Roman I Khimov <khimov@altell.ru>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoinclude/param.h: Dont use ARG_MAX from kernel headers
Khem Raj [Fri, 9 Jul 2010 18:23:36 +0000 (11:23 -0700)]
include/param.h: Dont use ARG_MAX from kernel headers

* Use getrlimit for ARG_MAX in sysconf on nptl.
* Define NCARGS directly instead of ARG_MAX

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agoarm: Silence warning about shadow declarations
Khem Raj [Wed, 7 Jul 2010 19:19:56 +0000 (12:19 -0700)]
arm: Silence warning about shadow declarations

libc/inet/socketcalls.c: In function ‘__libc_recvfrom’:
libc/inet/socketcalls.c:229:1: warning: declaration of ‘_sys_result’
shadows a previous local
libc/inet/socketcalls.c:229:1: warning: shadowed declaration is here

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agonptl: disregard generated tcb-offsets.c
Bernhard Reutner-Fischer [Tue, 6 Jul 2010 17:56:10 +0000 (19:56 +0200)]
nptl: disregard generated tcb-offsets.c

thanks to khem for noticing

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: Filter out gen_tcb-offsets.c from CSRC for libpthread.
Khem Raj [Tue, 6 Jul 2010 17:50:39 +0000 (10:50 -0700)]
nptl: Filter out gen_tcb-offsets.c from CSRC for libpthread.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agonptl: fix buildsys
Bernhard Reutner-Fischer [Thu, 1 Jul 2010 08:28:46 +0000 (10:28 +0200)]
nptl: fix buildsys

Now automatically picks the correct (arch and subarch specific) impls in
favour of generic impls.
make O=/tmp/objs PREFIX=/my/sysroot -j
works now as expected (both out-of-tree as well as parallel-safe).

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: fix subdirs handling
Bernhard Reutner-Fischer [Sun, 13 Jun 2010 07:52:45 +0000 (09:52 +0200)]
nptl: fix subdirs handling

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: simplify buildsys
Bernhard Reutner-Fischer [Sat, 12 Jun 2010 11:29:14 +0000 (13:29 +0200)]
nptl: simplify buildsys

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoRevert "don't make __errno_location / __h_errno_location hidden"
Austin Foxley [Tue, 6 Jul 2010 15:30:00 +0000 (08:30 -0700)]
Revert "don't make __errno_location / __h_errno_location hidden"

This reverts commit 0d6ee549bc86fd330672a79d9a87d2c3825eea67.

We need to find a solution that will work in shared and static libraries

Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
13 years agodon't make __errno_location / __h_errno_location hidden
Peter Korsgaard [Mon, 5 Jul 2010 12:12:22 +0000 (14:12 +0200)]
don't make __errno_location / __h_errno_location hidden

Closes #2089 (https://bugs.busybox.net/show_bug.cgi?id=2089)

__errno_location / __h_errno_location access has to go through the PLT
like malloc/free, so the linuxthread variants gets used instead when
compiling with -pthread.

Based on http://github.com/mat-c/uClibc/commit/328d392c54aa5dc2b8e7f398a419087de497de2b

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
13 years agoremove extra comma in lock macro
Austin Foxley [Sat, 3 Jul 2010 16:26:16 +0000 (09:26 -0700)]
remove extra comma in lock macro

Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
13 years agomore workarounds for GCC PR32219
Timo Teräs [Wed, 30 Jun 2010 11:46:37 +0000 (14:46 +0300)]
more workarounds for GCC PR32219

Commit 2e53dd645d5348f207cec7f8595969dc566c5a55 workarounds GCC
bug when accessing _locale_init and _stdio_init. We need the same
fix for __errno_location and __h_errno_location otherwise we crash
calling null with static and non-threaded builds.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agomips/syscall-error: Choose the correct version for setting up errno.
Khem Raj [Wed, 30 Jun 2010 11:10:37 +0000 (04:10 -0700)]
mips/syscall-error: Choose the correct version for setting up errno.

* Current function is a C protype and PSEUDO macro does not
  transfer syscall return parameters to correct argument registers
  for a C function. This causes problem with syscalls setting wrong
  value for errno when they encounter an error.

* Fixes PR/2089 for mips/nptl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agonptl/errno: Use a separate __errno_location for libpthread.
Khem Raj [Wed, 30 Jun 2010 11:09:20 +0000 (04:09 -0700)]
nptl/errno: Use a separate __errno_location for libpthread.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agonptl/generic: Build generic libc-tls.c for non-mips architectures.
Khem Raj [Wed, 30 Jun 2010 11:06:26 +0000 (04:06 -0700)]
nptl/generic: Build generic libc-tls.c for non-mips architectures.

* mips has it own variant.
* we dont need to build dl-tls.c here its already
  built as part of ldso.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agoarm/nptl: Use the old C version of _Unwind_Resume in thumb mode.
Khem Raj [Tue, 29 Jun 2010 14:57:23 +0000 (07:57 -0700)]
arm/nptl: Use the old C version of _Unwind_Resume in thumb mode.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 years agoremove redundant args to do_ln
Bernhard Reutner-Fischer [Mon, 28 Jun 2010 22:00:59 +0000 (00:00 +0200)]
remove redundant args to do_ln

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agotest/nptl: move eintr.c to where it belongs
Bernhard Reutner-Fischer [Fri, 25 Jun 2010 08:12:58 +0000 (10:12 +0200)]
test/nptl: move eintr.c to where it belongs

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agotest: silence shadow warning
Bernhard Reutner-Fischer [Fri, 25 Jun 2010 08:10:16 +0000 (10:10 +0200)]
test: silence shadow warning

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agonptl: arm: make it compile again
Bernhard Reutner-Fischer [Thu, 24 Jun 2010 13:50:02 +0000 (15:50 +0200)]
nptl: arm: make it compile again

blame 6cbeaa5dd11a1b506a8a97b4dfb4e632240f9953

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agouse uniform form of C99 keywords
Bernhard Reutner-Fischer [Thu, 24 Jun 2010 13:10:48 +0000 (15:10 +0200)]
use uniform form of C99 keywords

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agointl, nptl_db: fix prerequisites
Bernhard Reutner-Fischer [Mon, 21 Jun 2010 09:05:53 +0000 (11:05 +0200)]
intl, nptl_db: fix prerequisites

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agobuildsys: add brief mode; show defines and ld-flags
Bernhard Reutner-Fischer [Sun, 20 Jun 2010 10:16:49 +0000 (12:16 +0200)]
buildsys: add brief mode; show defines and ld-flags

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agolibc: silence warnings about undefined cpp tokens
Bernhard Reutner-Fischer [Sun, 20 Jun 2010 09:20:11 +0000 (11:20 +0200)]
libc: silence warnings about undefined cpp tokens

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agofix race condition when generating linker scripts
Bernhard Reutner-Fischer [Mon, 21 Jun 2010 09:25:11 +0000 (11:25 +0200)]
fix race condition when generating linker scripts

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
13 years agoarm/nptl: Sync unwinding with glibc.
Khem Raj [Wed, 23 Jun 2010 23:30:54 +0000 (16:30 -0700)]
arm/nptl: Sync unwinding with glibc.

Signed-off-by: Khem Raj <raj.khem@gmail.com>