OSDN Git Service

uclinux-h8/uClibc.git
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>
12 years agoldso: fdpic: clean up style
Mike Frysinger [Sun, 27 Nov 2011 09:26:09 +0000 (04:26 -0500)]
ldso: fdpic: clean up style

There should (hopefully) be no functional changes here.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: fdpic: unify duplicate bfin/frv logic
Mike Frysinger [Sun, 27 Nov 2011 08:55:38 +0000 (03:55 -0500)]
ldso: fdpic: unify duplicate bfin/frv logic

Much of the logic in the bfin/frv subdirs is FDPIC specific and not arch
specific.  So start a new fdpic/ subdir to keep common things.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agomake ARRAY_SIZE commonly available internally
Mike Frysinger [Sun, 27 Nov 2011 09:10:03 +0000 (04:10 -0500)]
make ARRAY_SIZE commonly available internally

Some places have opencoded the ARRAY_SIZE macro, so move it to a global
internal location so other places can leverage it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: use __func__ rather than __FUNCTION__
Mike Frysinger [Sun, 27 Nov 2011 05:27:43 +0000 (00:27 -0500)]
ldso: use __func__ rather than __FUNCTION__

The former is part of a standard (C99) while the latter is not.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agobuildsys: drop manual TARGET_SUBARCH .config lookup
Mike Frysinger [Sun, 27 Nov 2011 03:31:19 +0000 (22:31 -0500)]
buildsys: drop manual TARGET_SUBARCH .config lookup

We source the .config file, so there should be no need to manually extract
it.  If the sourcing doesn't work, then a lot of things break in this file.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoinclude/: ignore new sys/eventfd.h symlink
Mike Frysinger [Sun, 27 Nov 2011 03:36:30 +0000 (22:36 -0500)]
include/: ignore new sys/eventfd.h symlink

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agobuildsys: s/CROSS/CROSS_COMPILE/g
Carmelo Amoroso [Thu, 27 Oct 2011 13:11:11 +0000 (15:11 +0200)]
buildsys: s/CROSS/CROSS_COMPILE/g

Use CROSS_COMPILE instead of CROSS as other projects are doing
(i.e. kernel, busybox, buildroot).
CROSS is still supported for backward compatibility only

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agonptl: add missing pt-tempname.c
Bernhard Reutner-Fischer [Thu, 24 Nov 2011 18:22:59 +0000 (19:22 +0100)]
nptl: add missing pt-tempname.c

fix bd3c1a2495cbcb51b606f8e4892fcd127f91e645 forgotten file.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibc: do not rely upon ulimit kernel syscall.
Carmelo Amoroso [Tue, 1 Nov 2011 14:08:17 +0000 (15:08 +0100)]
libc: do not rely upon ulimit kernel syscall.

On several architectures __NR_ulimit syscall number is currently
defined but it is remapped onto sys_ni_syscall, while on other
architectures they are not longer defined.
So use {get,set}rlimit only to implement ulimit interface.

It fixes LTP ulimit01 test case.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibdl: fix size parameter when unmap library in dlclose
Filippo Arcidiacono [Wed, 23 Nov 2011 10:50:55 +0000 (11:50 +0100)]
libdl: fix size parameter when unmap library in dlclose

Fix size parameter when unmap a library by means of dlclose, by
taking into account the p_vaddr of first PT_LOAD segment, so it works
also for prelinked shared objects.
Unmapping of dlopen shared libraries is broken since
94cc6edb78a12655c0602a246fa1cbdc8c6d0ad9

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agostdio: add support for "e" flag with fopen()
Mike Frysinger [Tue, 19 Jul 2011 20:05:52 +0000 (16:05 -0400)]
stdio: add support for "e" flag with fopen()

Support this useful glibc extension for optionally setting O_CLOEXEC
on fopen streams.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolibcrypt: do not cast away const of key/salt
Mike Frysinger [Sun, 20 Nov 2011 07:34:49 +0000 (02:34 -0500)]
libcrypt: do not cast away const of key/salt

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agolibubacktrace: use .so.$(ABI_VERSION)
Bernhard Reutner-Fischer [Fri, 18 Nov 2011 07:49:25 +0000 (08:49 +0100)]
libubacktrace: use .so.$(ABI_VERSION)

Thanks to William Pitcock for noticing

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agonptl: sem_open: use open64 if LFS
Bernhard Reutner-Fischer [Thu, 17 Nov 2011 17:35:09 +0000 (18:35 +0100)]
nptl: sem_open: use open64 if LFS

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agomisc: hide __gen_tempname
Bernhard Reutner-Fischer [Thu, 17 Nov 2011 13:46:07 +0000 (14:46 +0100)]
misc: hide __gen_tempname

fix signed vs. unsigned comparison warnings while at it

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agostdio: hide _stdio_validate_FILE
Bernhard Reutner-Fischer [Thu, 17 Nov 2011 10:33:35 +0000 (11:33 +0100)]
stdio: hide _stdio_validate_FILE

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoregex_old: make some internal helpers static
Bernhard Reutner-Fischer [Thu, 17 Nov 2011 10:25:52 +0000 (11:25 +0100)]
regex_old: make some internal helpers static

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoinet: hide relocations
Bernhard Reutner-Fischer [Thu, 17 Nov 2011 10:01:04 +0000 (11:01 +0100)]
inet: hide relocations

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agounistd: hide relocations
Bernhard Reutner-Fischer [Thu, 17 Nov 2011 09:55:29 +0000 (10:55 +0100)]
unistd: hide relocations

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoresolv: hide relocations
Bernhard Reutner-Fischer [Thu, 17 Nov 2011 09:46:42 +0000 (10:46 +0100)]
resolv: hide relocations

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoAdd a C6X-specific ipc.h.
Bernd Schmidt [Mon, 14 Nov 2011 13:44:51 +0000 (14:44 +0100)]
Add a C6X-specific ipc.h.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
12 years agobuildsys: do not install ld.so linker script
Carmelo Amoroso [Tue, 8 Nov 2011 13:33:22 +0000 (14:33 +0100)]
buildsys: do not install ld.so linker script

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agolibubacktrace: Conditionally link libgcc_eh
Jason Woodward [Sat, 11 Jun 2011 05:08:48 +0000 (01:08 -0400)]
libubacktrace: Conditionally link libgcc_eh

When libubacktrace is not enabled there is no need to link in libgcc_eh
Fixes bootstrap failures with (gcc-4.5.x) stage1 compilers that --disable-shared

Signed-off-by: Jason Woodward <jason.woodward@timesys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibm: pass CFLAGS to e500 fenv
Bernhard Reutner-Fischer [Sun, 12 Jun 2011 07:44:32 +0000 (08:44 +0100)]
libm: pass CFLAGS to e500 fenv

As noted by Jason Woodward

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agohonor UCLIBC_HAS_FENV for e500
Jason Woodward [Sun, 12 Jun 2011 00:39:33 +0000 (20:39 -0400)]
honor UCLIBC_HAS_FENV for e500

Signed-off-by: Jason Woodward <jason.woodward@timesys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoFix e500 fpu libm build
Jason Woodward [Sat, 11 Jun 2011 23:09:53 +0000 (19:09 -0400)]
Fix e500 fpu libm build

Define libm_ARCH_fpu_OUT in libm/powerpc/e500/Makefile.arch as it is used
in libm/powerpc/e500/fpu/Makefile.arch

 libm_ARCH_OBJ:=$(patsubst $(libm_ARCH_fpu_DIR)/%.c,$(libm_ARCH_fpu_OUT)/%.o,$(libm_ARCH_SRC))

This appears to have been broken since cd3a494e99fa4bcad1c2a621b71361005528bead

Signed-off-by: Jason Woodward <jason.woodward@timesys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibc: flesh out linux scheduler functions
Henning Heinold [Sat, 4 Jun 2011 19:21:41 +0000 (21:21 +0200)]
libc: flesh out linux scheduler functions

Most stuff was taken from the eglibc.

Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoldso: support RTLD_NOLOAD
Timo Teräs [Mon, 7 Nov 2011 17:08:33 +0000 (18:08 +0100)]
ldso: support RTLD_NOLOAD

So application query if specified module is loaded or not with
dlopen.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agostdlib: add qsort_r
Bernhard Reutner-Fischer [Mon, 7 Nov 2011 08:24:30 +0000 (09:24 +0100)]
stdlib: add qsort_r

GNU extension like qsort but takes a 3 parameter comparision function.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agopowerpc: Fix typo in clone()
Bernhard Reutner-Fischer [Fri, 4 Nov 2011 12:02:09 +0000 (13:02 +0100)]
powerpc: Fix typo in clone()

Thanks to strauman at slac stanford edu for noticing

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoAdd stub for eventfd.
Jean-Christian de Rivaz [Wed, 2 Nov 2011 19:44:00 +0000 (20:44 +0100)]
Add stub for eventfd.

Warn if the enventfd() function is not implemented.

Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibm: implement a generic sincos().
William Pitcock [Wed, 2 Nov 2011 00:18:48 +0000 (19:18 -0500)]
libm: implement a generic sincos().

We already provide sincos() on some archs, so we should ship a generic version.

Signed-off-by: William Pitcock <nenolod@dereferenced.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibm: add cabsf() and cabsl() functions.
William Pitcock [Tue, 1 Nov 2011 23:55:25 +0000 (18:55 -0500)]
libm: add cabsf() and cabsl() functions.

Signed-off-by: William Pitcock <nenolod@dereferenced.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibm: implement generic cexp(), cexpf() and cexpl().
William Pitcock [Tue, 1 Nov 2011 23:41:30 +0000 (18:41 -0500)]
libm: implement generic cexp(), cexpf() and cexpl().

The cexp*() family of functions is defined by the C99 math standard as
implementing exponential functions for complex types.

Signed-off-by: William Pitcock <nenolod@dereferenced.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoconfig: document eventfd
Bernhard Reutner-Fischer [Fri, 4 Nov 2011 09:23:06 +0000 (10:23 +0100)]
config: document eventfd

in LINUX_SPECIFIC

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agosetegid: use setresgid conditionally
Bernhard Reutner-Fischer [Wed, 2 Nov 2011 16:31:51 +0000 (17:31 +0100)]
setegid: use setresgid conditionally

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agostubs: remove leftover undefs
Bernhard Reutner-Fischer [Wed, 2 Nov 2011 16:28:15 +0000 (17:28 +0100)]
stubs: remove leftover undefs

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agobuildsys: eventually remove sys/eventfd.h
Bernhard Reutner-Fischer [Wed, 2 Nov 2011 15:51:55 +0000 (16:51 +0100)]
buildsys: eventually remove sys/eventfd.h

rm sys/eventfd.h unless linux_specific was chosen

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agostubs: handle linux module functions
Bernhard Reutner-Fischer [Mon, 31 Oct 2011 22:13:09 +0000 (23:13 +0100)]
stubs: handle linux module functions

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agostubs: handle linux-specific
Bernhard Reutner-Fischer [Sun, 30 Oct 2011 20:57:39 +0000 (21:57 +0100)]
stubs: handle linux-specific

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agostubs: fix inverted socket logic
Bernhard Reutner-Fischer [Sat, 29 Oct 2011 10:09:57 +0000 (12:09 +0200)]
stubs: fix inverted socket logic

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agostubs: undef linux specific unless they were asked for
Bernhard Reutner-Fischer [Sat, 29 Oct 2011 09:55:43 +0000 (11:55 +0200)]
stubs: undef linux specific unless they were asked for

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoAdd eventfd support.
Jean-Christian de Rivaz [Mon, 24 Oct 2011 17:07:43 +0000 (19:07 +0200)]
Add eventfd support.

Hello,

I whould like to share this simple patch that add the eventfd call to
uClibc. Please review so it can be accepted to be merged.

Jean-Christian

Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agosparc: fix build for linuxthreads.old
Rob Landley [Thu, 27 Oct 2011 14:31:06 +0000 (07:31 -0700)]
sparc: fix build for linuxthreads.old

sparc target has assembly implementations of clone.S that doesn't
get used, and thus the build breaks.  Also, sparc is missing a header file in
pthreads.old that exists in pthreads.new.

Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
12 years agoresolver: add a dependencies for DNS resolver feature
Carmelo Amoroso [Thu, 27 Oct 2011 10:48:31 +0000 (12:48 +0200)]
resolver: add a dependencies for DNS resolver feature

DNS resolver needs at least IPV4 or IPV6 support enabled
to be correctly built. Add such dependency.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agopthreads: fix build when DNS resolver is not enabled.
Bernhard Reutner-Fischer [Thu, 27 Oct 2011 10:38:43 +0000 (12:38 +0200)]
pthreads: fix build when DNS resolver is not enabled.

Resolver state is only available if DNS resolver is enabled.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agosh: fix build for SH in !NPTL case
Rob Landley [Thu, 27 Oct 2011 10:32:34 +0000 (12:32 +0200)]
sh: fix build for SH in !NPTL case

Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agolinuxthreads: fix typo in __UCLIBC_HAS_IPv4__ macro
Carmelo Amoroso [Thu, 27 Oct 2011 08:00:58 +0000 (10:00 +0200)]
linuxthreads: fix typo in __UCLIBC_HAS_IPv4__ macro

IPv4 should has 'V' capital letter.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoldso: let people disable to lookup into LD_LIBRARY_PATH
Carmelo Amoroso [Tue, 25 Oct 2011 10:28:51 +0000 (12:28 +0200)]
ldso: let people disable to lookup into LD_LIBRARY_PATH

On hardened system it could be useful to disable the use
of LD_LIBRARY_PATH.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoldso: minor fixes to implicit search path
Carmelo Amoroso [Tue, 25 Oct 2011 09:26:50 +0000 (11:26 +0200)]
ldso: minor fixes to implicit search path

Do not defined _dl_ldsopatch if implicit search path if not enabled,
and avoid to call search_for_named_library (even if it is able to handle
NULL search path).

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoldso: disable the implicit path search in stand-alone mode as well
Carmelo Amoroso [Tue, 25 Oct 2011 08:24:06 +0000 (10:24 +0200)]
ldso: disable the implicit path search in stand-alone mode as well

Honour LDSO_SEARCH_INTERP_PATH knob option also when running in
stand-alone mode.

Signed-off-by: Rune <u-uclibc-y2lt@aetey.se>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoconfig: add support for <custom>_defconfig
Carmelo Amoroso [Tue, 25 Oct 2011 04:54:34 +0000 (06:54 +0200)]
config: add support for <custom>_defconfig

Add support for platform specific and/or custom defconfig
per arch. They have to be suffixed by '_defconfig' and are
automatically detected and displayed by issuing 'make ARCH=<arch> help'.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoconfig: revise defconfigs strategy
Carmelo Amoroso [Tue, 25 Oct 2011 04:44:11 +0000 (06:44 +0200)]
config: revise defconfigs strategy

Revise the way defconfigs are defined, by renaming them
from defconfigs/<arch> to defconfigs/<arch>/defconfig.
It allows to have multiple defconfigs per arch.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoconfig: tidy-up of config targets
Carmelo Amoroso [Tue, 25 Oct 2011 04:35:10 +0000 (06:35 +0200)]
config: tidy-up of config targets

Introduce two local variables for 'conf' and 'mconf' binaries.
Use $^ automatic variable to invoke [m]conf tool.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoresolv: fix memory leak
Bernhard Reutner-Fischer [Fri, 14 Oct 2011 15:47:42 +0000 (17:47 +0200)]
resolv: fix memory leak

Timothy Holdener writes:
small memory leak in __dns_lookup() when the A record
in the DNS answer is preceded by one or more CNAME records.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoresolv: commentary typo fix
Bernhard Reutner-Fischer [Thu, 20 Oct 2011 16:53:37 +0000 (18:53 +0200)]
resolv: commentary typo fix

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agogethostbyname_r: set correct h_errno upon failure
Bernhard Reutner-Fischer [Thu, 20 Oct 2011 16:49:48 +0000 (18:49 +0200)]
gethostbyname_r: set correct h_errno upon failure

previously gethostbyname_r(ipv6.google.com);herror("ERROR:") gave
Answer name = |ipv6.google.com|
Answer type = |5|
herrno=1
h_errno=0
ERROR:: Error 0

herrno=1
h_errno=1
ERROR:: Unknown host

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoresolv: fix compilation
Bernhard Reutner-Fischer [Tue, 18 Oct 2011 17:05:07 +0000 (19:05 +0200)]
resolv: fix compilation

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibdl: remove _dl_ldsopath from libdl.a
Carmelo Amoroso [Wed, 19 Oct 2011 14:30:32 +0000 (16:30 +0200)]
libdl: remove _dl_ldsopath from libdl.a

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoldd: take LD_LIBRARY_PATH into account
Carmelo Amoroso [Fri, 14 Oct 2011 10:04:58 +0000 (12:04 +0200)]
ldd: take LD_LIBRARY_PATH into account

Extend the environment variables adding the LD_LIBRARY_PATH
if actually passed when doing shared library tracings through
the ld.so trace capability.
This is possible only using the system dynamic linker in stand-alone
mode to avoid any vulnerability.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoConfig.in: fix erroneously deleted line
Bernhard Reutner-Fischer [Fri, 14 Oct 2011 12:11:01 +0000 (14:11 +0200)]
Config.in: fix erroneously deleted line

blame e9d74358093b61e2e597fa9e066ba0468df14cba

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoldso: silence harmless warning for !LDSO_PRELINK_SUPPORT
Bernhard Reutner-Fischer [Fri, 26 Aug 2011 09:29:48 +0000 (11:29 +0200)]
ldso: silence harmless warning for !LDSO_PRELINK_SUPPORT

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agolibc: fix daylight saving time handling
Guillaume Bourcier [Tue, 11 Oct 2011 11:45:33 +0000 (13:45 +0200)]
libc: fix daylight saving time handling

The algorithm computing daylight saving time incorrectly adds a day for
each month after January for leap years. The clock shift from/to DST can
be delayed if the last Sunday of a transition month is exactly seven
days before the first of the following month.

This change adds a day for the February month only.

Signed-off-by: Guillaume Bourcier <guillaumebourcier@free.fr>
Signed-off-by: Richard Braun <rbraun@sceen.net>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoldso: unify pread syscall definition
Mike Frysinger [Wed, 5 Oct 2011 03:26:10 +0000 (23:26 -0400)]
ldso: unify pread syscall definition

A few arches want pread() defined, so move it to common code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoldso: bfin/frv: drop dead simulator code
Mike Frysinger [Wed, 5 Oct 2011 03:26:09 +0000 (23:26 -0400)]
ldso: bfin/frv: drop dead simulator code

Nowhere do we define DYNAMIC_LOADER_IN_SIMULATOR, so drop the little bit
of code that depends on it.  At least in the Blackfin case, we can run an
FDPIC ldso just fine under the simulator without hacks.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoldso: merge duplicate dl-syscalls.h code to common header
Mike Frysinger [Wed, 5 Oct 2011 03:26:08 +0000 (23:26 -0400)]
ldso: merge duplicate dl-syscalls.h code to common header

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agomicroblaze mmu/elf/shared lib support
Ryan Flux [Tue, 4 Oct 2011 00:50:49 +0000 (10:50 +1000)]
microblaze mmu/elf/shared lib support

microblaze can either be with mmu or without
If with, use elf rather than flat, and support shared libs

Signed-off-by: Ryan Flux <ryan.flux@emsolutions.com.au>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agomicroblaze linux has no SDA support
Steve Bennett [Tue, 4 Oct 2011 00:50:48 +0000 (10:50 +1000)]
microblaze linux has no SDA support

The linker does not set up the Small Data Area symbols,
_SDA_BASE_ and _SDA2_BASE_ so don't try to resolve them

Signed-off-by: Ryan Flux <ryan.flux@emsolutions.com.au>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agomicroblaze can be either big or little endian
Steve Bennett [Tue, 4 Oct 2011 00:50:47 +0000 (10:50 +1000)]
microblaze can be either big or little endian

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agomicroblaze has long double support too
Ryan Flux [Tue, 4 Oct 2011 00:50:46 +0000 (10:50 +1000)]
microblaze has long double support too

Signed-off-by: Ryan Flux <ryan.flux@emsolutions.com.au>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoUse the generic bits/select.h for microblaze
Steve Bennett [Tue, 4 Oct 2011 00:50:45 +0000 (10:50 +1000)]
Use the generic bits/select.h for microblaze

This avoids warnings about type-punned pointers

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agotests: ignore new inet test
Mike Frysinger [Sat, 1 Oct 2011 19:41:06 +0000 (15:41 -0400)]
tests: ignore new inet test

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agotests: add fallback for mktemp()
Mike Frysinger [Sat, 1 Oct 2011 19:39:46 +0000 (15:39 -0400)]
tests: add fallback for mktemp()

If SuSv3 legacy support is disabled, then mktemp() isn't available, and
we end up getting a lot of build errors.  So add a fallback built on top
of tempnam() since that currently cannot be disabled.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: x86_64: delete unused variable
Mike Frysinger [Sat, 1 Oct 2011 19:12:14 +0000 (15:12 -0400)]
ldso: x86_64: delete unused variable

gcc informed me:
In file included from ldso/ldso/ldso.c:46:0:
ldso/ldso/x86_64/elfinterp.c: In function '_dl_do_lazy_reloc':
ldso/ldso/x86_64/elfinterp.c:294:6: warning:
variable 'symtab_index' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoldso: constify reloc array itself
Mike Frysinger [Sat, 1 Oct 2011 19:10:39 +0000 (15:10 -0400)]
ldso: constify reloc array itself

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoDefeat compiler optimization which assumes function addresses are never NULL
Denys Vlasenko [Thu, 15 Sep 2011 14:59:21 +0000 (16:59 +0200)]
Defeat compiler optimization which assumes function addresses are never NULL

From email:
A warning for people who can be hit by the same or similar issue:
gcc 4.1.2 with -march=i486 here with -Os and even with -O2 or -O
is "optimizing away" the check
       if (_stdio_term)
in libc/stdlib/_atexit.c
which results in a "call 0" and a segfault at exit
if you do not happen to link in stdio.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
12 years agoconfig: tweak help text
Bernhard Reutner-Fischer [Mon, 12 Sep 2011 15:29:21 +0000 (17:29 +0200)]
config: tweak help text

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
12 years agoresolv: simple optimizations and style/readability fixes
Denys Vlasenko [Sat, 10 Sep 2011 01:01:33 +0000 (03:01 +0200)]
resolv: simple optimizations and style/readability fixes

    text           data     bss     dec     hex filename
-   2915              0       0    2915     b63 libc/inet/ns_name_old.o
+   2656              0       0    2656     a60 libc/inet/ns_name.o
-    958              0       0     958     3be libc/inet/ns_parse_old.o
+    898              0       0     898     382 libc/inet/ns_parse.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoldso: fix build with PRELINK enabled and !TLS
Carmelo Amoroso [Fri, 26 Aug 2011 08:26:17 +0000 (10:26 +0200)]
ldso: fix build with PRELINK enabled and !TLS

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
12 years agoldso: add missing include
Bernhard Reutner-Fischer [Fri, 26 Aug 2011 07:40:30 +0000 (09:40 +0200)]
ldso: add missing include

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>