OSDN Git Service

uclinux-h8/uClibc.git
14 years agodocs/defines.txt: add a note about possibly obsolete __LDBL_COMPAT
Denys Vlasenko [Sun, 6 Sep 2009 19:58:17 +0000 (21:58 +0200)]
docs/defines.txt: add a note about possibly obsolete __LDBL_COMPAT

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agowordexp.c: cleanup - remove old hidden_proto's; remove unused parameter
Denys Vlasenko [Sun, 6 Sep 2009 19:51:10 +0000 (21:51 +0200)]
wordexp.c: cleanup - remove old hidden_proto's; remove unused parameter

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agowordexp.c: fix a bug where we might close stdout
Denys Vlasenko [Sun, 6 Sep 2009 19:48:16 +0000 (21:48 +0200)]
wordexp.c: fix a bug where we might close stdout

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agofstatat: fix up behavior on 32/64 bit hosts
Mike Frysinger [Sun, 6 Sep 2009 16:12:12 +0000 (12:12 -0400)]
fstatat: fix up behavior on 32/64 bit hosts

The fstatat() syscall is a little funky in that it sometimes changes name
between 32 and 64 bit hosts, but it should always operate on a 64bit stat
structure.  So for the fstatat() function, make sure we convert it from a
64bit kstat to a 32bit stat.

Along these lines, we need to restore the __xstat32_conv() function.

Reported-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoxstatconv: drop useless hidden code
Mike Frysinger [Sun, 6 Sep 2009 15:15:29 +0000 (11:15 -0400)]
xstatconv: drop useless hidden code

The xstatconv.h header already sets up hidden prototypes for us, so no
need to duplicate the code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoRevert "syscall.c: Use common syscall.c for ARM"
Khem Raj [Sun, 6 Sep 2009 08:02:02 +0000 (01:02 -0700)]
Revert "syscall.c: Use common syscall.c for ARM"

This reverts commit b1913a876059949e6c309bafade55e9425ef33fb.
OABI is still a requirement. So we override the common syscall
implementation specifically for arm port.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agomd5 passwords: reduce static usage
Denys Vlasenko [Sun, 6 Sep 2009 02:34:07 +0000 (04:34 +0200)]
md5 passwords: reduce static usage

    text           data     bss     dec     hex filename
-   1875              0     120    1995     7cb libcrypt/md5.o
+   1855              0      35    1890     762 libcrypt/md5.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agorexec.c: style fixes, no code chages (verified with objdump)
Denys Vlasenko [Sat, 5 Sep 2009 23:03:10 +0000 (01:03 +0200)]
rexec.c: style fixes, no code chages (verified with objdump)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agorexec.c: small code shrink
Denys Vlasenko [Sat, 5 Sep 2009 22:54:06 +0000 (00:54 +0200)]
rexec.c: small code shrink

    text           data     bss     dec     hex filename
-   1223              0       0    1223     4c7 libc/inet/rpc/rexec.o
+   1214              0       0    2239     8bf libc/inet/rpc/rexec.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agocomment out "int rexecoptions"; make "char ahostbuf[]" static (was hidden)
Denys Vlasenko [Sat, 5 Sep 2009 22:52:35 +0000 (00:52 +0200)]
comment out "int rexecoptions"; make "char ahostbuf[]" static (was hidden)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agodo not save/restore errno around free() calls
Denys Vlasenko [Sat, 5 Sep 2009 21:37:40 +0000 (23:37 +0200)]
do not save/restore errno around free() calls

In any non-buggy program free() does not fail.
And when it fails in a buggy program, the failure
is usually fatal (heap corruption and segfault).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agodo not pass 3rd param to open() which do not create files
Denys Vlasenko [Sat, 5 Sep 2009 21:35:09 +0000 (23:35 +0200)]
do not pass 3rd param to open() which do not create files

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agowtmp code: style fixes, no code changes
Denys Vlasenko [Sat, 5 Sep 2009 21:30:57 +0000 (23:30 +0200)]
wtmp code: style fixes, no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoremove(): slight readabability tweak, no code changes
Denys Vlasenko [Sat, 5 Sep 2009 21:25:38 +0000 (23:25 +0200)]
remove(): slight readabability tweak, no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoopensock: work correctly on IPv6-only config
Denys Vlasenko [Sat, 5 Sep 2009 21:24:20 +0000 (23:24 +0200)]
opensock: work correctly on IPv6-only config

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolckpwdf: remove a wrong comment and one write-only variable
Denys Vlasenko [Sat, 5 Sep 2009 20:15:24 +0000 (22:15 +0200)]
lckpwdf: remove a wrong comment and one write-only variable

no code changes (verified with objdump)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoCLOEXEC: use open(CLOEXEC) if exist; do not check fcntl(FD_CLOEXEC) failure
Denys Vlasenko [Sat, 5 Sep 2009 20:04:36 +0000 (22:04 +0200)]
CLOEXEC: use open(CLOEXEC) if exist; do not check fcntl(FD_CLOEXEC) failure

    text           data     bss     dec     hex filename
-    370              0       0     370     172 libc/misc/dirent/opendir.o
+    366              0       0     366     16e libc/misc/dirent/opendir.o
-    375              4       0     379     17b libc/pwd_grp/lckpwdf.o
+    356              4       0     360     168 libc/pwd_grp/lckpwdf.o
-    248              0       0     248      f8 librt/shm.o
+    209              0       0     209      d1 librt/shm.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoutent.c: fix a few bugs, and shrink a bit
Denys Vlasenko [Sat, 5 Sep 2009 19:29:48 +0000 (21:29 +0200)]
utent.c: fix a few bugs, and shrink a bit

bug #1:
    static_fd = -1;
    close(static_fd);
DOH!

bug #2:
    if (utmp_fd == -1) {
        __setutent();
    }
    if (utmp_fd == -1) {
        return NULL;
    }
if utmp_fd == -1, we call _setutent().
if __setutent() opens a fd, utmp_fd (a parameter)
wouldn't change, the second check is bogus.
We need to use static_fd instead in second check.
Which makes clear that having utmp_fd parameter
is wrong. See the patch for a complete fix.

Shrink comes from simplifying fcntl(static_fd, F_SETFD, FD_CLOEXEC):

    text           data     bss     dec     hex filename
-    661              8     384    1053     41d libc/misc/utmp/utent.o
+    604              8     384     996     3e4 libc/misc/utmp/utent.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agomath.h: fix trivial typo (missing !): !defined __NO_LONG_DOUBLE_MATH
Denys Vlasenko [Sat, 5 Sep 2009 19:28:31 +0000 (21:28 +0200)]
math.h: fix trivial typo (missing !): !defined __NO_LONG_DOUBLE_MATH

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agodrop last _syscall6 checks
Mike Frysinger [Mon, 31 Aug 2009 08:48:04 +0000 (04:48 -0400)]
drop last _syscall6 checks

If your arch does not support _syscall6(), it is broken anyways.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agohonour NO_LONG_DOUBLE_MATH
Bernhard Reutner-Fischer [Thu, 12 Mar 2009 16:51:53 +0000 (16:51 +0000)]
honour NO_LONG_DOUBLE_MATH

  This fixes compilation errors on hosts that turn off long double support
  for C99 like powerpc32.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agoBuild posix_fadvice{64} only when UCLIBC_HAS_ADVANCED_REALTIME is set.
Khem Raj [Sun, 30 Aug 2009 18:42:28 +0000 (11:42 -0700)]
Build posix_fadvice{64} only when UCLIBC_HAS_ADVANCED_REALTIME is set.

Right now for ARM, MIPS, Xtensa and powerpc posix_fadvise
routines are included conditionally. They should only be
enabled when UCLIBC_HAS_ADVANCED_REALTIME is set. Also fix
code style in powerpc/posix_fadvise64.c

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agoAdd posix_fadvise{64}.c routines to Makefile.arch
Khem Raj [Sun, 30 Aug 2009 08:07:37 +0000 (01:07 -0700)]
Add posix_fadvise{64}.c routines to Makefile.arch

Fix the argument types to operate on long
and correct a typo.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agoAdd posix_fadvise and posix_fadvise64 for powerpc
Khem Raj [Sun, 30 Aug 2009 07:30:02 +0000 (00:30 -0700)]
Add posix_fadvise and posix_fadvise64 for powerpc

The syscall is having different number of params
and in one case the parameters are passed in differently.
This patch add powerpc specific versions of these
functions.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agodefault ?conf to native arch
Bernhard Reutner-Fischer [Tue, 25 Aug 2009 12:52:08 +0000 (14:52 +0200)]
default ?conf to native arch

  Default is now the native arch, you can start a fresh .config via
  'make ARCH=ia64 menuconfig'.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agouse CURDIR
Bernhard Reutner-Fischer [Tue, 25 Aug 2009 08:34:09 +0000 (10:34 +0200)]
use CURDIR

  use CURDIR instead of spawning a separate shell as suggested by
  Mike.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agouse pwd, not PWD
Bernhard Reutner-Fischer [Wed, 19 Aug 2009 11:29:41 +0000 (13:29 +0200)]
use pwd, not PWD

  PWD may point to somewhere else if we're run from another make

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agoalways define CONFIG_SHELL
Bernhard Reutner-Fischer [Mon, 17 Aug 2009 17:33:41 +0000 (19:33 +0200)]
always define CONFIG_SHELL

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agosupport building out-of-tree
Bernhard Reutner-Fischer [Mon, 17 Aug 2009 17:17:00 +0000 (19:17 +0200)]
support building out-of-tree

  Handle O=

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agoadd hidden aliases for newer regex search functions
Bernhard Reutner-Fischer [Mon, 17 Aug 2009 11:44:25 +0000 (13:44 +0200)]
add hidden aliases for newer regex search functions

  Fixes 3575b741754b391a27e33bb1866bdb29131b7fea
  which only changed the old impl but not the new one.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agom68k syscall: switch to common code
Maxim Kuvyrkov [Tue, 4 Aug 2009 18:51:54 +0000 (11:51 -0700)]
m68k syscall: switch to common code

Signed-off-by: Maxim Kuvyrkov <maxim@codesourcery.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agodefine attribute_noreturn
Bernhard Reutner-Fischer [Mon, 10 Aug 2009 09:49:06 +0000 (11:49 +0200)]
define attribute_noreturn

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agohandle _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN
Bernhard Reutner-Fischer [Wed, 5 Aug 2009 20:56:03 +0000 (22:56 +0200)]
handle _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agofix compilation
Bernhard Reutner-Fischer [Wed, 5 Aug 2009 20:54:46 +0000 (22:54 +0200)]
fix compilation

  wrong placed attribute_noreturn

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agoFix daemon build for no-MMU no-threads.
Joseph Myers [Tue, 4 Aug 2009 15:45:53 +0000 (15:45 +0000)]
Fix daemon build for no-MMU no-threads.

CLONE_VM (used in no-MMU daemon) is defined in <bits/sched.h>.  A
build with threads ends up including <sched.h> via <pthread.h> via
<bits/uClibc_mutex.h>; this indirect include does not happen for a
build without threads, so this patch adds a direct <sched.h> include.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
14 years agoioperm is not used internally, remove hidden_proto
Bernhard Reutner-Fischer [Sat, 1 Aug 2009 09:21:52 +0000 (11:21 +0200)]
ioperm is not used internally, remove hidden_proto

Without a hidden_def we'd end up with __GI_ioperm which is wrong.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agoMakefile.in: Let make release or make dist to use git.
Khem Raj [Sat, 1 Aug 2009 08:41:23 +0000 (01:41 -0700)]
Makefile.in: Let make release or make dist to use git.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agoRules.mak: Fix references to svn.
Khem Raj [Sat, 1 Aug 2009 08:40:34 +0000 (01:40 -0700)]
Rules.mak: Fix references to svn.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agosyscall.c: Use common syscall.c for ARM
Khem Raj [Sat, 1 Aug 2009 07:58:01 +0000 (00:58 -0700)]
syscall.c: Use common syscall.c for ARM

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agofnmatch.c: Include unistd.h before undefining _LIBC.
Khem Raj [Sat, 1 Aug 2009 07:57:05 +0000 (00:57 -0700)]
fnmatch.c: Include unistd.h before undefining _LIBC.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agofnmatch.c: Change scope of posixly_correct to be global.
Khem Raj [Fri, 31 Jul 2009 21:17:31 +0000 (14:17 -0700)]
fnmatch.c: Change scope of posixly_correct to be global.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agotest_librt: Fix shmtest.c test case
Carmelo Amoroso [Thu, 30 Jul 2009 12:21:20 +0000 (14:21 +0200)]
test_librt: Fix shmtest.c test case

Fix wrong use of sizeof (array) to retrieve the number
of elements; it was causing accessing beyond the array's boundaries.

Below the output of the testcase showing an attempt to read beyond
the array (actually 11 elements in size).

root@amorosoc:/home/carmelo# ./shmtest
Compare memory error                    : Offset 11, local 4262624, shm 224
Compare memory error                    : Offset 12, local 693493828, shm 68
Compare memory error                    : Offset 13, local 693489168, shm 16
Compare memory error                    : Offset 14, local 693826444, shm 20
.....

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
14 years agotest_librt: Fix build system for shm_open/unlink tests
Carmelo Amoroso [Thu, 30 Jul 2009 09:38:26 +0000 (11:38 +0200)]
test_librt: Fix build system for shm_open/unlink tests

Fix and align build system of librt tests to the test suite.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
14 years agobuild: Include Makefile.commonarch from common Makefile.in
Carmelo Amoroso [Wed, 29 Jul 2009 16:50:58 +0000 (18:50 +0200)]
build: Include Makefile.commonarch from common Makefile.in

Avoid including akefile.commonarch in each Makefile.arch.
Include it instead from Makefile.in just after the arch specific
Makefile.arch

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
14 years agoremove erroneous ';'
Bernhard Reutner-Fischer [Tue, 28 Jul 2009 13:39:52 +0000 (15:39 +0200)]
remove erroneous ';'

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
14 years agolinuxthreads.old: define pthread_yield to sched_yield
Mike Frysinger [Sun, 26 Jul 2009 20:09:10 +0000 (16:09 -0400)]
linuxthreads.old: define pthread_yield to sched_yield

The pthread_yield() function in linuxthreads does the same thing as the
standardized sched_yield() function, so add a simple define for it to make
porting GNU apps easier.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoforce arches to provide sys/user.h
Mike Frysinger [Sun, 26 Jul 2009 19:51:06 +0000 (15:51 -0400)]
force arches to provide sys/user.h

Now that Linux is no longer installing linux/user.h, arches will have to
provide their own.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoadd missing UTIME_* defines for *at funcs
Mike Frysinger [Sun, 26 Jul 2009 19:23:32 +0000 (15:23 -0400)]
add missing UTIME_* defines for *at funcs

I always forget that many arches have their own bits/stat.h ...

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoenable nanosecond stat support for everyone
Mike Frysinger [Sun, 26 Jul 2009 19:17:21 +0000 (15:17 -0400)]
enable nanosecond stat support for everyone

Fill out the stat structure so that the nanosecond resolution support is
always available.  There is a small code size increase for a few ports
(three additional assignments in xstatconv), but otherwise everything
should remain the same.

While we're here, punt __old_kernel_stat from the few headers that still
define it as it is unused in uClibc and causes compile errors after these
nanosecond changes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agodo not force LFS for Blackfin systems
Mike Frysinger [Sun, 26 Jul 2009 18:31:24 +0000 (14:31 -0400)]
do not force LFS for Blackfin systems

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoenable sbrk() for everyone
Mike Frysinger [Sun, 26 Jul 2009 18:25:08 +0000 (14:25 -0400)]
enable sbrk() for everyone

The sbrk() function can be used to merely query sizes and for that, no-mmu
works the same as mmu.  It can also sometimes increase data segments on
no-mmu systems provided the trailing memory is free.  So, there is no real
reason to exclude this function for no-mmu ports.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoadd missing UTIME_* defines for *at funcs
Mike Frysinger [Sun, 26 Jul 2009 17:37:07 +0000 (13:37 -0400)]
add missing UTIME_* defines for *at funcs

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: rename __dl_boot to __start
Mike Frysinger [Thu, 23 Jul 2009 09:38:44 +0000 (05:38 -0400)]
Blackfin: rename __dl_boot to __start

The entry symbol is __start rather than __dl_boot.  While in the past this
was silently ignored, now with common code checking the _start symbol in C
code, we end up with link errors:

ldso/ldso/ld-uClibc_so.a(ldso.oS): In function `__dl_get_ready_to_run':
ldso/ldso/ldso.c:(.text+0x2b30): undefined reference to `__start'
collect2: ld returned 1 exit status
make[1]: *** [lib/ld-uClibc.so] Error 1

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agotest/librt: make it build again
Denys Vlasenko [Thu, 23 Jul 2009 11:42:37 +0000 (13:42 +0200)]
test/librt: make it build again

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotestsuite: fix one bug, one warning; extend README (one TODO added)
Denys Vlasenko [Thu, 23 Jul 2009 11:27:05 +0000 (13:27 +0200)]
testsuite: fix one bug, one warning; extend README (one TODO added)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agotestsuite: use KERNEL_HEADERS
Denys Vlasenko [Thu, 23 Jul 2009 11:26:08 +0000 (13:26 +0200)]
testsuite: use KERNEL_HEADERS

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agofix lib_hidden_proto's which have extra ;
Denys Vlasenko [Thu, 23 Jul 2009 11:23:49 +0000 (13:23 +0200)]
fix lib_hidden_proto's which have extra ;

This was making them appear in sanitized headers.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agofix dl_iterate_phdr() for FDPIC systems
Mike Frysinger [Thu, 23 Jul 2009 09:27:24 +0000 (05:27 -0400)]
fix dl_iterate_phdr() for FDPIC systems

The dlpi_addr isn't a simple Elf_Addr type for FDPIC systems, so we can't
just assign 0 to it to initialize.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix typo in byteswap.h commit
Mike Frysinger [Thu, 23 Jul 2009 09:21:51 +0000 (05:21 -0400)]
Blackfin: fix typo in byteswap.h commit

The Blackfin port hasn't been compiling cleanly, so this typo was missed
in the byteswap unification commit.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix incorrect attribute order
Mike Frysinger [Thu, 23 Jul 2009 09:02:41 +0000 (05:02 -0400)]
Blackfin: fix incorrect attribute order

The order of attributes in a function definition matters and in a few
places in the Blackfin code, it was being applied to the return type
instead of the function itself.

In file included from ldso/ldso/ldso.c:43:
ldso/ldso/bfin/elfinterp.c: At top level:
ldso/ldso/bfin/elfinterp.c:42: warning: '__visibility__' attribute ignored on non-class types

In file included from ldso/ldso/bfin/elfinterp.c:341,
                 from ldso/ldso/ldso.c:43:
libc/sysdeps/linux/bfin/crtreloc.c: At top level:
libc/sysdeps/linux/bfin/crtreloc.c:91: warning: 'visibility' attribute ignored on non-class types

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: add elf_machine_load_address() stub
Mike Frysinger [Thu, 23 Jul 2009 09:01:14 +0000 (05:01 -0400)]
Blackfin: add elf_machine_load_address() stub

The Blackfin port never defined elf_machine_load_address() because the one
place this code is called never matters to us.  But without it, common code
likes to hit a build failure, so stub it out.

ldso/ldso/dl-startup.c: In function '_dl_start':
ldso/ldso/dl-startup.c:170: warning: implicit declaration of function 'elf_machine_load_address'

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoldso: fix building for FDPIC systems
Mike Frysinger [Thu, 23 Jul 2009 08:58:56 +0000 (04:58 -0400)]
ldso: fix building for FDPIC systems

The force shareable code missed a spot of using the DL_RELOC_ADDR()
indirection thus leading to invalid operands:
ldso/ldso/ldso.c: In function '_dl_get_ready_to_run':
ldso/ldso/ldso.c:409: error: invalid operands to binary +
(have 'Elf32_Addr' and 'struct elf32_fdpic_loadaddr')

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agosilence warnings in Blackfin ldso code
Mike Frysinger [Thu, 23 Jul 2009 08:47:12 +0000 (04:47 -0400)]
silence warnings in Blackfin ldso code

In file included from ./ldso/include/ldso.h:135,
                 from ldso/ldso/ldso.c:34:
./ldso/ldso/bfin/dl-inlines.h: In function '__dl_init_loadaddr_map':
./ldso/ldso/bfin/dl-inlines.h:43: warning: assignment makes pointer from integer without a cast

In file included from ldso/ldso/ldso.c:43:
ldso/ldso/bfin/elfinterp.c: In function '_dl_do_lazy_reloc':
ldso/ldso/bfin/elfinterp.c:299: warning: assignment makes pointer from integer without a cast

ldso/ldso/ldso.c: In function '_dl_get_ready_to_run':
ldso/ldso/ldso.c:534: warning: assignment makes integer from pointer without a cast

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: add support for automatic loading of L2 SRAM regions
Jie Zhang [Tue, 2 Sep 2008 07:16:44 +0000 (07:16 +0000)]
Blackfin: add support for automatic loading of L2 SRAM regions

These match the kernel/etc... pieces already merged.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agodo not install bits/syscalls-common.h
Mike Frysinger [Thu, 23 Jul 2009 08:11:35 +0000 (04:11 -0400)]
do not install bits/syscalls-common.h

Since we stub out the installed bits/syscalls.h, the installed
bits/syscalls-common.h header is completely useless.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoadd more arch-specific include/ ignores
Mike Frysinger [Thu, 23 Jul 2009 08:08:17 +0000 (04:08 -0400)]
add more arch-specific include/ ignores

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agocreate real common vfork() function
Mike Frysinger [Thu, 23 Jul 2009 08:03:17 +0000 (04:03 -0400)]
create real common vfork() function

Rather than force people to always implement their own vfork(), have the
default implementation be sane.

For now, only the Blackfin port uses the new code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: no need to load P5 for shared FLAT
Jie Zhang [Thu, 12 Mar 2009 07:15:33 +0000 (07:15 +0000)]
Blackfin: no need to load P5 for shared FLAT

The register is already loaded for us upon entry by the kernel.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: fix generation of Scrt1.o for FDPIC
Jie Zhang [Sun, 4 Mar 2007 04:08:47 +0000 (04:08 +0000)]
Blackfin: fix generation of Scrt1.o for FDPIC

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoBlackfin: unify FDPIC/FLAT versions of clone
Mike Frysinger [Wed, 22 Jul 2009 16:51:54 +0000 (12:51 -0400)]
Blackfin: unify FDPIC/FLAT versions of clone

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoignore gdb/debugging files
Mike Frysinger [Wed, 22 Jul 2009 09:52:11 +0000 (05:52 -0400)]
ignore gdb/debugging files

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoadd hidden aliases for openat funcs
Mike Frysinger [Wed, 22 Jul 2009 05:48:08 +0000 (01:48 -0400)]
add hidden aliases for openat funcs

openat64() uses openat(), so we need hidden aliases for it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoadd hidden aliases for ntoh/hton functions
Mike Frysinger [Wed, 22 Jul 2009 05:44:38 +0000 (01:44 -0400)]
add hidden aliases for ntoh/hton functions

Sometimes references for these functions show up (like when debugging is
enabled), so add hidden aliases for them if needed.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agolinuxthreads.old: fix crash in debug code
Mike Frysinger [Wed, 22 Jul 2009 03:33:57 +0000 (23:33 -0400)]
linuxthreads.old: fix crash in debug code

If pthread_join() is called and there is nothing to join, then the debug
code will attempt to dereference a NULL pointer.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agolibpthread: add format attribute to __pthread_message()
Mike Frysinger [Wed, 22 Jul 2009 03:13:46 +0000 (23:13 -0400)]
libpthread: add format attribute to __pthread_message()

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agobyteswap: unify common definitions
Mike Frysinger [Mon, 20 Jul 2009 20:38:30 +0000 (16:38 -0400)]
byteswap: unify common definitions

The majority of the byteswap functions are the same across all arches, so
setup a common header to provide definitions if they don't exist.  This
allows arches to override only the ones they actually want to implement
with inline assembly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agos/UCLIBC_INTERNAL/_LIBC/g
Denys Vlasenko [Tue, 21 Jul 2009 18:09:13 +0000 (20:09 +0200)]
s/UCLIBC_INTERNAL/_LIBC/g

Undo my old mistake. I added UCLIBC_INTERNAL define,
but later I realized _LIBC is doing exactly the same thing.

This change converts all usages of UCLIBC_INTERNAL to _LIBC,
removing all instances of UCLIBC_INTERNAL.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agocorrected typo
Denys Vlasenko [Tue, 21 Jul 2009 18:08:24 +0000 (20:08 +0200)]
corrected typo

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agolibc/string/i386/string.h: fix -O0 build failure
Denys Vlasenko [Tue, 21 Jul 2009 13:44:39 +0000 (15:44 +0200)]
libc/string/i386/string.h: fix -O0 build failure

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 years agoIt fixes the following warnings seen on mips build.
Khem Raj [Mon, 20 Jul 2009 20:41:28 +0000 (13:41 -0700)]
It fixes the following warnings seen on mips build.

libc/sysdeps/linux/mips/clone.S: Assembler messages:
libc/sysdeps/linux/mips/clone.S:122: Warning: No .frame pseudo-op used in PIC code
libc/sysdeps/linux/mips/clone.S:75: Warning: Pretending global symbol used as branch target is local.

libc/sysdeps/linux/mips/crt1.S: Assembler messages:
libc/sysdeps/linux/mips/crt1.S:134: Warning: No .cprestore pseudo-op used in PIC code

Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 years agoavr32/microblaze/vax: punt local byteswap.h
Mike Frysinger [Mon, 20 Jul 2009 20:37:30 +0000 (16:37 -0400)]
avr32/microblaze/vax: punt local byteswap.h

These arches are generic C implementations of the byteswap functions, so
rather than keep a useless local copy, use the common C one.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agosyscall: convert cris/hppa to common syscalls
Mike Frysinger [Mon, 20 Jul 2009 19:24:38 +0000 (15:24 -0400)]
syscall: convert cris/hppa to common syscalls

The cris/hppa code appears to be easy to convert, so go ahead and do it
for them.  Build tested only.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoMAKEALL: find kernel headers better
Mike Frysinger [Mon, 20 Jul 2009 19:23:26 +0000 (15:23 -0400)]
MAKEALL: find kernel headers better

Work with pre-sysroot compilers that have kernel headers available in the
standard location, and let people force the location manually.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agosome ports define ENOTSUP
Mike Frysinger [Mon, 20 Jul 2009 19:22:33 +0000 (15:22 -0400)]
some ports define ENOTSUP

A port or two (like hppa) does define ENOTSUP, so don't assume that
everyone needs this fallback define.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoINLINE_SYSCALL_NCS: scope out local vars to avoid conflicts
Mike Frysinger [Mon, 20 Jul 2009 19:04:54 +0000 (15:04 -0400)]
INLINE_SYSCALL_NCS: scope out local vars to avoid conflicts

The INLINE_SYSCALL_NCS() macro was using "res" and "err" as local variable
names, but this caused conflicts with some code (like clock_getres) whose
arguments were named the same.

libc/sysdeps/linux/common/clock_getres.c: In function 'clock_getres':
libc/sysdeps/linux/common/clock_getres.c:15: warning: 'res' is used uninitialized in this function

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agolinuxthreads.old: extend workaround for asm rename warnings
Mike Frysinger [Mon, 20 Jul 2009 18:57:24 +0000 (14:57 -0400)]
linuxthreads.old: extend workaround for asm rename warnings

The libc_pthread_init.c needs the include workaround like forward.c, and
forward.c needs more includes now.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agofix building for systems w/out ldso support
Mike Frysinger [Mon, 20 Jul 2009 18:05:44 +0000 (14:05 -0400)]
fix building for systems w/out ldso support

If an arch (like alpha and others) have no ldso support at all, then there
is no point in attempting to walk loaded modules in the dl-* helper funcs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoalpha: fix building with no asm/elf.h
Mike Frysinger [Mon, 20 Jul 2009 17:54:41 +0000 (13:54 -0400)]
alpha: fix building with no asm/elf.h

The latest sanitized linux kernel headers no longer export asm/elf.h, so do
not rely on it anymore.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agofdatasync: handle latest alpha syscalls
Mike Frysinger [Mon, 20 Jul 2009 17:52:26 +0000 (13:52 -0400)]
fdatasync: handle latest alpha syscalls

The latest alpha Linux kernel defines __NR_fdatasync like everyone else and
deprecates the older __NR_osf_fdatasync, so support that setup.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoalpha/sigprocmask: fix implicit memset() prototype
Mike Frysinger [Mon, 20 Jul 2009 17:50:48 +0000 (13:50 -0400)]
alpha/sigprocmask: fix implicit memset() prototype

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agofirst pass at implementing *at funcs
Mike Frysinger [Mon, 20 Jul 2009 17:36:52 +0000 (13:36 -0400)]
first pass at implementing *at funcs

Tested basic functionality with coreutils and things seem to work.  At
least gives us a basis to jump from.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agosync a few headers with glibc (no functional changes)
Mike Frysinger [Mon, 20 Jul 2009 17:34:16 +0000 (13:34 -0400)]
sync a few headers with glibc (no functional changes)

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agodirent: push dirent type to prototypes
Mike Frysinger [Mon, 20 Jul 2009 17:19:36 +0000 (13:19 -0400)]
dirent: push dirent type to prototypes

This syncs the dirent related functions with the glibc behavior -- rather
than take void pointers everywhere, make the struct dirent pointers
explicit in the API.  After all, the functions themselves will cast the
pointers to a dirent structure, so if it isn't as expected, people will
crash.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agostring: only include inline-asm if UCLIBC_HAS_STRING_ARCH_OPT
Mike Frysinger [Mon, 20 Jul 2009 17:17:38 +0000 (13:17 -0400)]
string: only include inline-asm if UCLIBC_HAS_STRING_ARCH_OPT

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoregex: convert #if to #ifdef
Mike Frysinger [Mon, 20 Jul 2009 17:09:55 +0000 (13:09 -0400)]
regex: convert #if to #ifdef

Avoid gcc warnings about #if statements with defines that aren't defined.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoadd a wchar.h stub
Mike Frysinger [Mon, 20 Jul 2009 17:07:38 +0000 (13:07 -0400)]
add a wchar.h stub

The basic C standard requires a few wchar types, so provide those even when
wchar support is disabled.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agomknod: convert to INLINE_SYSCALL() to sync with glibc
Mike Frysinger [Mon, 20 Jul 2009 14:50:49 +0000 (10:50 -0400)]
mknod: convert to INLINE_SYSCALL() to sync with glibc

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agonote that we do not want hidden malloc aliases
Mike Frysinger [Mon, 20 Jul 2009 13:03:29 +0000 (09:03 -0400)]
note that we do not want hidden malloc aliases

We want to let malloc() and friends be overridable at runtime so that apps
can insert their own implementation (think debugging, specialized setups,
etc...).  That means that C library functions that return allocated memory
have to go through the normal malloc() symbol as well as the external code
is the one who will be calling free().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agofix typo in frv endian comment
Mike Frysinger [Mon, 20 Jul 2009 12:35:53 +0000 (08:35 -0400)]
fix typo in frv endian comment

Reported-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agorelocate i386 string.h to i386-specific dir
Mike Frysinger [Mon, 20 Jul 2009 12:08:30 +0000 (08:08 -0400)]
relocate i386 string.h to i386-specific dir

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