[uClibc]Hi, upgrading to uClibc 9/6 snapshot ...
Marshall M. Midden
m4 at brecis.com
Sat Sep 7 05:50:41 UTC 2002
I am in the process of upgrading to latest uClibc, snapshot from 9/6.
I made one change to our kernel to make it closer to 2.4.19 kernel (sys_pipe).
[I had it update the user space array directly, instead of using 2 registers.]
Otherwise everything I've tested (evm-testscript, snmpd, pppoe, etc...) works.
a) The configuration changes are the first thing needed, I have it first.
b) Following is the wishlist of fixes/work-arounds.
c) A complete "diff -ruN" is at the end.
Many changes to header files are due to the gcc -Werror option/flag. The
${KERNEL_SOURCE}/include/linux files have previously been changed for
mis-matching or re-definitions of structures/enums/etc.
------------------------------------------------------------------------------
NOT DONE #1:
__UCLIBC_USE_UNIFIED_SYSCALL__ not done.
NOT DONE #2:
pipe system call does not return errors, check linux man page, etc.
------------------------------------------------------------------------------
diff Config.brecis Config.mips
1,6d0
< ARCH_CFLAGS=-DBRECIS
< ARCH_CFLAGS += -Werror
<
< # Enable if HAS_MMU = false, but fork() works.
< HAS_FORK=true
<
42c36
< CROSS = mips-
---
> CROSS = mips-linux-
45d38
< AS = $(CROSS)as
65,66c58
< # KERNEL_SOURCE = /usr/src/linux
< KERNEL_SOURCE := $(shell /bin/pwd)/../linux
---
> KERNEL_SOURCE = /usr/src/linux
70,71c62
< # HAS_MMU = true
< HAS_MMU = false
---
> HAS_MMU = true
80,81c71
< # DO_C99_MATH = false
< DO_C99_MATH = true
---
> DO_C99_MATH = false
105,106c95,96
< MALLOC = malloc
< # MALLOC = malloc-930716
---
> #MALLOC = malloc
> MALLOC = malloc-930716
110,111c100
< # DOLFS = false
< DOLFS = true
---
> DOLFS = false
122,123c111
< # INCLUDE_RPC = false
< INCLUDE_RPC = true
---
> INCLUDE_RPC = false
128,129c116
< # INCLUDE_FULL_RPC = false
< INCLUDE_FULL_RPC = true
---
> INCLUDE_FULL_RPC = false
156,157c143
< # HAVE_SHARED = true
< HAVE_SHARED = false
---
> HAVE_SHARED = true
------------------------------------------------------------------------------
Wishlist of changes/suggested fixes/work-arounds to get things to compile
and work for us -- note: we have a different crt0 ... "diff -ruN" at end.
a) Option to turn off #warning's and link_warning's. (#ifdef around them?)
misc/locale/locale.c(#warning and link_warning's), inet/rpc/clnt_generic.c,
inet/rpc/rcmd.c, string/wstring.c
b) Main makefile, mipsnommu -- ARCH = mips.
# elif [ $(TARGET_ARCH) = "mips" ];then \
# ln -fs $(KERNEL_SOURCE)/include/asm-mips include/asm; \
Need asm-mipsnommu ... or just asm ??
(since the kernel needs to be configured anyway, right, why not just use
"ln -fs $(KERNEL_SOURCE)/include/asm include/asm"?)
c) mips-gcc -Wall -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -fno-builtin -nostdinc -I../../include -iwithprefix include -I. -D_LIBC -DBRECIS -Werror -DNDEBUG -c valloc.c -o valloc.o
cc1: warnings being treated as errors
valloc.c: In function `valloc':
valloc.c:33: warning: implicit declaration of function `memalign'
valloc.c:33: warning: return makes pointer from integer without a cast
d) mips-gcc -Wall -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -fno-builtin -nostdinc -I../../../../include -iwithprefix include -I. -D_LIBC -DBRECIS -Werror -DNDEBUG -c __longjmp.c -o __longjmp.o
cc1: warnings being treated as errors
__longjmp.c:31: warning: function declaration isn't a prototype
e) mips-gcc -Wall -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -fno-builtin -nostdinc -I../../../../include -iwithprefix include -I. -D_LIBC -DBRECIS -Werror -DNDEBUG -c pipe.c -o pipe.o
cc1: warnings being treated as errors
pipe.c: In function `pipe':
pipe.c:12: warning: `res2' might be used uninitialized in this function
f) mips-gcc -Wall -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -fno-builtin -nostdinc -I../include -iwithprefix include -I. -D_LIBC -DBRECIS -Werror -DNDEBUG -c md5.c -o md5.o
cc1: warnings being treated as errors
md5.c:116: warning: function declaration isn't a prototype
md5.c:137: warning: function declaration isn't a prototype
g) mips-gcc -Wall -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -fno-builtin -nostdinc -I../include -iwithprefix include -I. -D_LIBC -DBRECIS -Werror -DNDEBUG -D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE -c w_cabs.c -o w_cabs.o
cc1: warnings being treated as errors
w_cabs.c:17: warning: function declaration isn't a prototype
h) mips-gcc -Wall -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -fno-builtin -nostdinc -I../../include -iwithprefix include -I. -D_LIBC -DBRECIS -Werror -DNDEBUG -I../../libpthread/linuxthreads/sysdeps/unix/sysv/linux -I../../libpthread/linuxthreads/sysdeps/pthread -I../../libpthread/linuxthreads/sysdeps/unix/sysv -I../../libpthread/linuxthreads/sysdeps/unix/unix -I../../libpthread/linuxthreads/sysdeps/mips -I../../libpthread/linuxthreads/sysdeps -I../../libc/sysdeps/linux/mips -c manager.c -o manager.o
cc1: warnings being treated as errors
manager.c: In function `pthread_allocate_stack':
manager.c:380: warning: assignment from incompatible pointer type
manager.c:382: warning: assignment makes pointer from integer without a cast
manager.c:389: warning: comparison of distinct pointer types lacks a cast
manager.c:389: warning: assignment from incompatible pointer type
manager.c:297: warning: unused variable `stacksize'
i) mips-gcc -Wall -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -fno-builtin -nostdinc -I../../include -iwithprefix include -I. -D_LIBC -DBRECIS -Werror -DNDEBUG -I../../libpthread/linuxthreads/sysdeps/unix/sysv/linux -I../../libpthread/linuxthreads/sysdeps/pthread -I../../libpthread/linuxthreads/sysdeps/unix/sysv -I../../libpthread/linuxthreads/sysdeps/unix/unix -I../../libpthread/linuxthreads/sysdeps/mips -I../../libpthread/linuxthreads/sysdeps -I../../libc/sysdeps/linux/mips -c pthread.c -o pthread.o
cc1: warnings being treated as errors
pthread.c: In function `pthread_initialize':
pthread.c:255: warning: unused variable `limit'
pthread.c:256: warning: unused variable `max_stack'
j) libc/unistd/Makefile, add:
ifeq ($(strip $(HAS_FORK)),true)
CSRC+=daemon.c
endif
k) libc/inet
-rw-r--r-- 1 m4 m4 601 Sep 6 16:16 resolveaddress.o
-rw-r--r-- 1 m4 m4 601 Sep 6 16:16 resolvename.o
These are in the Makefile and my "ping" uses resolve_name()... .
But, these two do not exist in resolv.c any longer.
I put them back in (with appropriate changes).
l) libc/sysdeps/linux/mips/pipe.c
m) UNIFIED SYSTEM CALL.
For the "mips", having a "c" routine is a bad idea. The stack is used, etc.
If you want things as small as possible, doing the minimal is appropriate.
------------------------------------------------------------------------------
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/Makefile ./Makefile
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/Makefile Thu Sep 5 00:29:49 2002
+++ ./Makefile Fri Sep 6 20:19:15 2002
@@ -31,17 +31,22 @@
TOPDIR=./
include Rules.mak
-DIRS = extra ldso libc libcrypt libresolv libutil libm libpthread
+DIRS = extra libc libcrypt libresolv libutil libm libpthread
+ifeq ($(strip $(HAVE_SHARED)),true)
+DIRS += ldso
+endif
+
all: headers uClibc_config subdirs shared utils finished
Config:
- @echo
- @echo "You didn't read the README, did you... =)"
- @echo "Choose a configuration file in extras/Config/ and then run"
- @echo " ln -s ./extra/Configs/Config.<arch> ./Config"
- @echo
- @exit 1
+ ln -sf extra/Configs/Config.brecis ./Config
+# @echo
+# @echo "You didn't read the README, did you... =)"
+# @echo "Choose a configuration file in extras/Config/ and then run"
+# @echo " ln -s ./extra/Configs/Config.<arch> ./Config"
+# @echo
+# @exit 1
shared:
ifeq ($(strip $(HAVE_SHARED)),true)
@@ -70,29 +75,31 @@
headers: dummy
rm -f include/asm;
- @if [ $(TARGET_ARCH) = "powerpc" ];then \
- ln -fs $(KERNEL_SOURCE)/include/asm-ppc include/asm; \
- elif [ $(TARGET_ARCH) = "mips" ];then \
- ln -fs $(KERNEL_SOURCE)/include/asm-mips include/asm; \
- elif [ $(TARGET_ARCH) = "mipsel" ];then \
- ln -fs $(KERNEL_SOURCE)/include/asm-mips include/asm; \
- cd $(shell pwd)/libc/sysdeps/linux; \
- ln -fs mips mipsel; \
- cd $(shell pwd)/ldso/ldso; \
- ln -fs mips mipsel; \
- cd $(shell pwd)/libpthread/linuxthreads/sysdeps; \
- ln -fs mips mipsel; \
- else \
- if [ $(HAS_MMU) != "true" ]; then \
- if [ -d $(KERNEL_SOURCE)/include/asm-$(TARGET_ARCH)nommu ] ; then \
- ln -fs $(KERNEL_SOURCE)/include/asm-$(TARGET_ARCH)nommu include/asm;\
- else \
- ln -fs $(KERNEL_SOURCE)/include/asm-$(TARGET_ARCH) include/asm; \
- fi; \
- else \
- ln -fs $(KERNEL_SOURCE)/include/asm-$(TARGET_ARCH) include/asm; \
- fi; \
- fi;
+# @if [ $(TARGET_ARCH) = "powerpc" ];then \
+# ln -fs $(KERNEL_SOURCE)/include/asm-ppc include/asm; \
+# elif [ $(TARGET_ARCH) = "mips" ];then \
+# ln -fs $(KERNEL_SOURCE)/include/asm-mips include/asm; \
+# elif [ $(TARGET_ARCH) = "mipsel" ];then \
+# ln -fs $(KERNEL_SOURCE)/include/asm-mips include/asm; \
+# cd $(shell pwd)/libc/sysdeps/linux; \
+# ln -fs mips mipsel; \
+# cd $(shell pwd)/ldso/ldso; \
+# ln -fs mips mipsel; \
+# cd $(shell pwd)/libpthread/linuxthreads/sysdeps; \
+# ln -fs mips mipsel; \
+# else \
+# if [ $(HAS_MMU) != "true" ]; then \
+# if [ -d $(KERNEL_SOURCE)/include/asm-$(TARGET_ARCH)nommu ] ; then \
+# ln -fs $(KERNEL_SOURCE)/include/asm-$(TARGET_ARCH)nommu include/asm;\
+# else \
+# ln -fs $(KERNEL_SOURCE)/include/asm-$(TARGET_ARCH) include/asm; \
+# fi; \
+# else \
+# ln -fs $(KERNEL_SOURCE)/include/asm-$(TARGET_ARCH) include/asm; \
+# fi; \
+# fi;
+ ln -fs $(KERNEL_SOURCE)/include/asm include/asm
+# replace above mess.
@if [ ! -f include/asm/unistd.h ] ; then \
set -e; \
echo " "; \
@@ -104,6 +111,7 @@
fi;
rm -f include/linux include/scsi
ln -fs $(KERNEL_SOURCE)/include/linux include/linux
+ ln -fs $(KERNEL_SOURCE)/include/brecis include/brecis
ln -fs $(KERNEL_SOURCE)/include/scsi include/scsi
rm -rf include/bits
mkdir -p include/bits
@@ -148,6 +156,11 @@
else \
echo "#undef __UCLIBC_HAS_IPV6__" >> include/bits/uClibc_config.h ; \
fi
+ @if [ "$(HAS_FORK)" = "true" ] ; then \
+ echo "#define __UCLIBC_HAS_FORK__ 1" >> include/bits/uClibc_config.h ; \
+ else \
+ echo "#undef __UCLIBC_HAS_FORK__" >> include/bits/uClibc_config.h ; \
+ fi
@if [ "$(HAS_MMU)" = "true" ] ; then \
echo "#define __UCLIBC_HAS_MMU__ 1" >> include/bits/uClibc_config.h ; \
else \
@@ -379,6 +392,7 @@
rm -f libc/sysdeps/linux/mipsel; \
rm -f libpthread/linuxthreads/sysdeps/mipsel; \
fi;
+ rm -f Config include/brecis
dist release: distclean
cd ..; \
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/extra/Configs/Config.brecis ./extra/Configs/Config.brecis
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/extra/Configs/Config.brecis Wed Dec 31 18:00:00 1969
+++ ./extra/Configs/Config.brecis Fri Sep 6 17:45:18 2002
@@ -0,0 +1,204 @@
+ARCH_CFLAGS=-DBRECIS
+ARCH_CFLAGS += -Werror
+
+# Enable if HAS_MMU = false, but fork() works.
+HAS_FORK=true
+
+# Library Configuration rules for uClibc
+#
+# This file contains rules which are shared between multiple Makefiles. All
+# normal configuration options live in the file named "Config". You probably
+# should not mess with this file unless you know what you are doing...
+#
+# Copyright (C) 2000 by Lineo, inc.
+# Copyright (C) 2000,2001 Erik Andersen <andersee at debian.org>
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Derived in part from the Linux-8086 C library, the GNU C Library, and several
+# other sundry sources. Files within this library are copyright by their
+# respective copyright holders.
+
+NATIVE_CC = gcc
+
+# Specify the target
+TARGET_ARCH=mips
+
+# If you are running a cross compiler, you may want to set this
+# to something more interesting... Target architecture is determined
+# by asking this compiler what arch it compiles stuff for.
+CROSS = mips-
+CC = $(CROSS)gcc
+AR = $(CROSS)ar
+AS = $(CROSS)as
+LD = $(CROSS)ld
+NM = $(CROSS)nm
+STRIPTOOL = $(CROSS)strip
+#STRIPTOOL = /bin/true
+
+# Set the following to `true' to make a debuggable build, and `false' for
+# production builds.
+DODEBUG = false
+
+# Compiler warnings you want to see
+WARNINGS = -Wall
+
+# Note that the kernel source you use to compile with should be the same as the
+# Linux kernel you run your apps on. uClibc doesn't even try to achieve binary
+# compatibility across kernel versions. So don't expect, for example, uClibc
+# compiled with Linux kernel 2.0.x to implement lchown properly, since 2.0.x
+# can't do that. Similarly, if you compile uClibc vs Linux 2.4.x kernel headers,
+# but then run on Linux 2.0.x, lchown will be compiled into uClibc, but won't
+# work at all. You have been warned.
+# KERNEL_SOURCE = /usr/src/linux
+KERNEL_SOURCE := $(shell /bin/pwd)/../linux
+
+# Set this to `false' if your CPU doesn't have a memory management unit (MMU).
+# Set it to `true' otherwise.
+# HAS_MMU = true
+HAS_MMU = false
+
+# Set this to `false' if you don't have/need basic floating point support
+# support in libc (strtod, printf, scanf). Set it to `true' otherwise.
+# If this is not true, then libm will not be built.
+HAS_FLOATING_POINT = true
+
+# Set to `true' if you want the math library to contain the full set
+# of C99 math library features. Costs an extra 35k or so on x86.
+# DO_C99_MATH = false
+DO_C99_MATH = true
+
+# Set this to 'false if you don't need shadow password support.
+HAS_SHADOW = false
+
+# Set this to `false' if you don't have/need locale support; `true' otherwise.
+# NOTE: Currently does not affect collation.
+# You must also generate the locale data and associated .h file.
+# See the README in directory extra/locale for details.
+HAS_LOCALE = false
+
+# Set this to `false' if you don't have/need wide char support.
+HAS_WCHAR = false
+
+# This specifies which malloc implementation is used.
+#
+# "malloc" use mmap for all allocations and so works very well on MMU-less
+# systems that do not support the brk() system call. It is pretty smart
+# about reusing already allocated memory, and minimizing memory wastage.
+#
+# "malloc-930716" is derived from libc-5.3.12 and uses the brk() system call
+# for all memory allocations. This makes it very fast. It is also pretty
+# smart about reusing already allocated memory, and minimizing memory wastage.
+# Because this uses brk() it will not work on uClinux MMU-less systems.
+MALLOC = malloc
+# MALLOC = malloc-930716
+
+# If you want large file support (greater then 2 GiB) turn this on.
+# Do not enable this unless your kernel provides large file support.
+# DOLFS = false
+DOLFS = true
+
+# Posix regular expression code is really big -- 27k all by itself.
+# If you don't use regular expressions, turn this off and save space.
+# Of course, if you only staticly link, leave this on, since it will
+# only be included in your apps if you use regular expressions.
+INCLUDE_REGEX = true
+
+# If you want to include RPC support, enable this. RPC is almost never used
+# for anything except NFS support, so unless you plan to use NFS, leave this
+# disabled. This is off by default.
+# INCLUDE_RPC = false
+INCLUDE_RPC = true
+
+# Normally we enable just enough RPC support for things like rshd and
+# nfs mount to work. If you find you need the rest of the RPC stuff,
+# then enable this.
+# INCLUDE_FULL_RPC = false
+INCLUDE_FULL_RPC = true
+
+# If you want to include support for the next version of the Internet
+# Protocol: IP version 6, enable this. This is off by default.
+INCLUDE_IPV6 = false
+
+# If you want to include threads support, enable this. The C library will
+# be compiled thread-safe, and the libpthread library will be built.
+INCLUDE_THREADS = true
+
+# If you want to support only Unix 98 PTYs enable this. Some older
+# applications may need this disabled. For most current programs,
+# you can generally leave this true.
+UNIX98PTY_ONLY = true
+
+# Enable this if /dev/pts is on a devpts or devfs file system. Both
+# these filesystems automatically manage permissions on the /dev/pts
+# devices. You may need to mount this fs on /dev/pts for this to work.
+# This is true by default.
+ASSUME_DEVPTS = true
+
+# If you want to compile the library as PIC code, turn this on.
+# This is automagically enabled when HAVE_SHARED is true
+DOPIC = false
+
+# Enable support for shared libraries? If this is false, you can
+# ignore all the rest of the options in this file...
+# HAVE_SHARED = true
+HAVE_SHARED = false
+
+# uClibc has a native shared library loader for some architectures.
+BUILD_UCLIBC_LDSO = true
+
+# If you are using shared libraries, but do not want/have a native
+# uClibc shared library loader, please specify the name of your
+# system's shared library loader here...
+#SYSTEM_LDSO = /lib/ld-linux.so.2
+
+# When using shared libraries, this path is the location where the
+# shared library will be invoked. This value will be compiled into
+# every binary compiled with uClibc.
+#
+# BIG FAT WARNING:
+# If you do not have a shared library loader with the correct name
+# sitting in the directory this points to, your binaries will not run.
+SHARED_LIB_LOADER_PATH = /lib
+
+# DEVEL_PREFIX is the directory into which the uClibc development
+# environment will be installed. The result will look something
+# like the following:
+# DEVEL_PREFIX/
+# lib/ <contains all runtime and static libs>
+# include/ <Where all the header files go>
+# This value is used by the 'make install' Makefile target. Since this
+# directory is compiled into the uclibc cross compiler spoofer, you
+# have to recompile if you change this value...
+DEVEL_PREFIX = /usr/$(TARGET_ARCH)-linux-uclibc
+
+# SYSTEM_DEVEL_PREFIX is the directory prefix used when installing
+# bin/arch-uclibc-gcc, bin/arch-uclibc-ld, etc. This is only used by
+# the 'make install' target, and is not compiled into anything. This
+# defaults to $DEVEL_PREFIX/usr, but makers of .rpms and .debs will
+# want to set this to "/usr" instead.
+SYSTEM_DEVEL_PREFIX = $(DEVEL_PREFIX)
+
+# DEVEL_TOOL_PREFIX is the directory prefix used when installing
+# bin/gcc, bin/ld, etc. This is only used by the 'make install'
+# target, and is not compiled into anything. This defaults to
+# $DEVEL_PREFIX/usr, but makers of .rpms and .debs may want to
+# set this to something else.
+DEVEL_TOOL_PREFIX = $(DEVEL_PREFIX)/usr
+
+# If you want 'make install' to install everything under a temporary
+# directory, the define PREFIX during the install step,
+# i.e., 'make PREFIX=/var/tmp/uClibc install'.
+#PREFIX = $(TOPDIR)/_install
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/features.h ./include/features.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/features.h Fri Aug 9 08:02:54 2002
+++ ./include/features.h Fri Sep 6 23:21:43 2002
@@ -382,8 +382,13 @@
extern __typeof (name) aliasname __attribute__ ((alias (#name)));
/* This comes between the return type and function name in
* a function definition to make that definition weak. */
+#ifndef BRECIS
# define weak_function __attribute__ ((weak))
# define weak_const_function __attribute__ ((weak, __const__))
+#else /* BRECIS */
+# define weak_function
+# define weak_const_function
+#endif
/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
* section attributes on what looks like a comment to the assembler. */
# define link_warning(symbol, msg) \
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/netinet/in.h ./include/netinet/in.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/netinet/in.h Thu Sep 27 02:22:21 2001
+++ ./include/netinet/in.h Fri Sep 6 18:33:20 2002
@@ -26,6 +26,8 @@
__BEGIN_DECLS
+#ifndef IPPROTO_defined
+#define IPPROTO_defined
/* Standard well-defined IP protocols. */
enum
{
@@ -83,6 +85,7 @@
#define IPPROTO_RAW IPPROTO_RAW
IPPROTO_MAX
};
+#endif
/* Type to represent a port. */
@@ -131,10 +134,13 @@
/* Internet address. */
typedef uint32_t in_addr_t;
+#ifndef in_addr_defined
+#define in_addr_defined
struct in_addr
{
in_addr_t s_addr;
};
+#endif
/* Definitions of the bits in an Internet address integer.
@@ -212,6 +218,8 @@
#include <bits/socket.h>
+#ifndef sockaddr_in_defined
+#define sockaddr_in_defined
/* Structure describing an Internet socket address. */
struct sockaddr_in
{
@@ -225,6 +233,7 @@
sizeof (in_port_t) -
sizeof (struct in_addr)];
};
+#endif
/* Ditto, for IPv6. */
struct sockaddr_in6
@@ -256,13 +265,21 @@
this was a short-sighted decision since on different systems the types
may have different representations but the values are always the same. */
+#ifndef ntohl
extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__));
+#endif
+#ifndef ntohs
extern uint16_t ntohs (uint16_t __netshort)
__THROW __attribute__ ((__const__));
+#endif
+#ifndef htonl
extern uint32_t htonl (uint32_t __hostlong)
__THROW __attribute__ ((__const__));
+#endif
+#ifndef htons
extern uint16_t htons (uint16_t __hostshort)
__THROW __attribute__ ((__const__));
+#endif
#include <endian.h>
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/sys/select.h ./include/sys/select.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/sys/select.h Thu Sep 27 00:21:15 2001
+++ ./include/sys/select.h Fri Sep 6 17:28:58 2002
@@ -53,6 +53,8 @@
#define __FDELT(d) ((d) / __NFDBITS)
#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
+#ifndef __fd_set_defined
+#define __fd_set_defined
/* fd_set for select and pselect. */
typedef struct
{
@@ -66,6 +68,7 @@
# define __FDS_BITS(set) ((set)->__fds_bits)
#endif
} fd_set;
+#endif /* __fd_set_defined */
/* Maximum number of file descriptors in `fd_set'. */
#define FD_SETSIZE __FD_SETSIZE
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/sys/time.h ./include/sys/time.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/sys/time.h Thu Sep 27 00:21:15 2001
+++ ./include/sys/time.h Fri Sep 6 19:51:23 2002
@@ -87,6 +87,7 @@
#endif
+#ifndef BRECIS
/* Values for the first argument to `getitimer' and `setitimer'. */
enum __itimer_which
{
@@ -101,9 +102,12 @@
ITIMER_PROF = 2
#define ITIMER_PROF ITIMER_PROF
};
+#endif /* BRECIS */
/* Type of the second argument to `getitimer' and
the second and third arguments `setitimer'. */
+#ifndef __need_itimerval
+#define __need_itimerval
struct itimerval
{
/* Value to put into `it_value' when the timer expires. */
@@ -111,7 +115,9 @@
/* Time to the next timer expiration. */
struct timeval it_value;
};
+#endif
+#ifndef BRECIS
#if defined __USE_GNU && !defined __cplusplus
/* Use the nicer parameter type only in GNU mode and not for C++ since the
strict C++ rules prevent the automatic promotion. */
@@ -119,6 +125,9 @@
#else
typedef int __itimer_which_t;
#endif
+#else /* BRECIS */
+typedef int __itimer_which_t;
+#endif /* BRECIS */
/* Set *VALUE to the current setting of timer WHICH.
Return 0 on success, -1 on errors. */
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/time.h ./include/time.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/include/time.h Mon Jun 17 04:45:11 2002
+++ ./include/time.h Fri Sep 6 18:59:41 2002
@@ -127,7 +127,7 @@
int tm_yday; /* Days in year.[0-365] */
int tm_isdst; /* DST. [-1/0/1]*/
-#if 0
+/* #if 0 */
# ifdef __USE_BSD
long int tm_gmtoff; /* Seconds east of UTC. */
__const char *tm_zone; /* Timezone abbreviation. */
@@ -135,7 +135,7 @@
long int __tm_gmtoff; /* Seconds east of UTC. */
__const char *__tm_zone; /* Timezone abbreviation. */
# endif
-#endif
+/* #endif */
};
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/Makefile ./libc/Makefile
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/Makefile Fri Aug 9 07:35:37 2002
+++ ./libc/Makefile Fri Sep 6 17:41:05 2002
@@ -31,6 +31,7 @@
include $(TOPDIR)Rules.mak
DIRS = misc pwd_grp stdio string termios inet signal stdlib sysdeps unistd
+DIRS += additional
all: halfclean subdirs $(LIBNAME) $(DO_SHARED)
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/Makefile ./libc/additional/Makefile
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/Makefile Wed Dec 31 18:00:00 1969
+++ ./libc/additional/Makefile Fri Sep 6 17:40:40 2002
@@ -0,0 +1,31 @@
+
+TOPDIR=../../
+include $(TOPDIR)Rules.mak
+DIRS:=
+
+CSRC=err.c errx.c verr.c verrx.c vwarn.c vwarnx.c warn.c warnx.c
+CSRC+=getusershell.c
+
+COBJS=$(patsubst %.c,%.o, $(CSRC))
+
+OBJS=$(COBJS)
+
+all: $(OBJS) $(LIBC)
+
+$(LIBC): ar-target
+
+ar-target: $(OBJS)
+ $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+
+$(COBJS): %.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
+$(OBJ): Makefile
+
+.PHONY: dummy
+dummy:
+
+clean:
+ rm -f *.[oa] *~ core
+
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/err.c ./libc/additional/err.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/err.c Wed Dec 31 18:00:00 1969
+++ ./libc/additional/err.c Fri Sep 6 17:40:40 2002
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] = "$OpenBSD: err.c,v 1.4 1997/07/25 20:30:01 mickey Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <err.h>
+
+#include <stdarg.h>
+
+void err(int eval, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ verr(eval, fmt, ap);
+ va_end(ap);
+}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/errx.c ./libc/additional/errx.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/errx.c Wed Dec 31 18:00:00 1969
+++ ./libc/additional/errx.c Fri Sep 6 17:40:40 2002
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] = "$OpenBSD: errx.c,v 1.3 1997/07/25 20:30:02 mickey Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <err.h>
+
+#include <stdarg.h>
+
+void errx(int eval, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ verrx(eval, fmt, ap);
+ va_end(ap);
+}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/getusershell.c ./libc/additional/getusershell.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/getusershell.c Wed Dec 31 18:00:00 1969
+++ ./libc/additional/getusershell.c Fri Sep 6 17:40:40 2002
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 1985, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char rcsid[] = "$OpenBSD: getusershell.c,v 1.2 1996/08/19 08:24:15 tholo Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/param.h>
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <paths.h>
+
+/*
+ * Local shells should NOT be added here. They should be added in
+ * /etc/shells.
+ */
+
+static char *okshells[] = { _PATH_BSHELL, _PATH_CSHELL, NULL };
+static char **curshell, **shells, *strings;
+static char **initshells __P((void));
+
+/*
+ * Get a list of shells from _PATH_SHELLS, if it exists.
+ */
+char *
+getusershell()
+{
+ char *ret;
+
+ if (curshell == NULL)
+ curshell = initshells();
+ ret = *curshell;
+ if (ret != NULL)
+ curshell++;
+ return (ret);
+}
+
+void
+endusershell()
+{
+
+ if (shells != NULL)
+ free(shells);
+ shells = NULL;
+ if (strings != NULL)
+ free(strings);
+ strings = NULL;
+ curshell = NULL;
+}
+
+void
+setusershell()
+{
+
+ curshell = initshells();
+}
+
+static char **
+initshells()
+{
+ register char **sp, *cp;
+ register FILE *fp;
+ struct stat statb;
+
+ if (shells != NULL)
+ free(shells);
+ shells = NULL;
+ if (strings != NULL)
+ free(strings);
+ strings = NULL;
+ if ((fp = fopen(_PATH_SHELLS, "r")) == NULL)
+ return (okshells);
+ if (fstat(fileno(fp), &statb) == -1) {
+ (void)fclose(fp);
+ return (okshells);
+ }
+ if ((strings = malloc((u_int)statb.st_size)) == NULL) {
+ (void)fclose(fp);
+ return (okshells);
+ }
+ shells = calloc((unsigned)statb.st_size / 3, sizeof (char *));
+ if (shells == NULL) {
+ (void)fclose(fp);
+ free(strings);
+ strings = NULL;
+ return (okshells);
+ }
+ sp = shells;
+ cp = strings;
+ while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) {
+ while (*cp != '#' && *cp != '/' && *cp != '\0')
+ cp++;
+ if (*cp == '#' || *cp == '\0')
+ continue;
+ *sp++ = cp;
+ while (!isspace(*cp) && *cp != '#' && *cp != '\0')
+ cp++;
+ *cp++ = '\0';
+ }
+ *sp = NULL;
+ (void)fclose(fp);
+ return (shells);
+}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/verr.c ./libc/additional/verr.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/verr.c Wed Dec 31 18:00:00 1969
+++ ./libc/additional/verr.c Fri Sep 6 17:40:40 2002
@@ -0,0 +1,64 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+/* static char rcsid[] = "$OpenBSD: verr.c,v 1.2 1996/08/19 08:27:30 tholo Exp $"; */
+#endif /* LIBC_SCCS and not lint */
+
+#include <err.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <stdarg.h>
+
+extern char *__progname; /* Program name, from crt0. */
+
+void
+verr(eval, fmt, ap)
+ int eval;
+ const char *fmt;
+ va_list ap;
+{
+ int sverrno;
+
+ sverrno = errno;
+ (void)fprintf(stderr, "%s: ", __progname);
+ if (fmt != NULL) {
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, ": ");
+ }
+ (void)fprintf(stderr, "%s\n", strerror(sverrno));
+ exit(eval);
+}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/verrx.c ./libc/additional/verrx.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/verrx.c Wed Dec 31 18:00:00 1969
+++ ./libc/additional/verrx.c Fri Sep 6 17:40:40 2002
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+/* static char rcsid[] = "$OpenBSD: verrx.c,v 1.2 1996/08/19 08:27:32 tholo Exp $"; */
+#endif /* LIBC_SCCS and not lint */
+
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <stdarg.h>
+
+extern char *__progname; /* Program name, from crt0. */
+
+void
+verrx(eval, fmt, ap)
+ int eval;
+ const char *fmt;
+ va_list ap;
+{
+ (void)fprintf(stderr, "%s: ", __progname);
+ if (fmt != NULL)
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, "\n");
+ exit(eval);
+}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/vwarn.c ./libc/additional/vwarn.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/vwarn.c Wed Dec 31 18:00:00 1969
+++ ./libc/additional/vwarn.c Fri Sep 6 17:40:40 2002
@@ -0,0 +1,61 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+/* static char rcsid[] = "$OpenBSD: vwarn.c,v 1.2 1996/08/19 08:27:38 tholo Exp $"; */
+#endif /* LIBC_SCCS and not lint */
+
+#include <err.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <stdarg.h>
+
+extern char *__progname; /* Program name, from crt0. */
+
+void
+vwarn(fmt, ap)
+ const char *fmt;
+ va_list ap;
+{
+ int sverrno;
+
+ sverrno = errno;
+ (void)fprintf(stderr, "%s: ", __progname);
+ if (fmt != NULL) {
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, ": ");
+ }
+ (void)fprintf(stderr, "%s\n", strerror(sverrno));
+}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/vwarnx.c ./libc/additional/vwarnx.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/vwarnx.c Wed Dec 31 18:00:00 1969
+++ ./libc/additional/vwarnx.c Fri Sep 6 17:40:40 2002
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+/* static char rcsid[] = "$OpenBSD: vwarnx.c,v 1.2 1996/08/19 08:27:39 tholo Exp $"; */
+#endif /* LIBC_SCCS and not lint */
+
+#include <err.h>
+#include <stdio.h>
+
+#include <stdarg.h>
+
+extern char *__progname; /* Program name, from crt0. */
+
+void
+vwarnx(fmt, ap)
+ const char *fmt;
+ va_list ap;
+{
+ (void)fprintf(stderr, "%s: ", __progname);
+ if (fmt != NULL)
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, "\n");
+}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/warn.c ./libc/additional/warn.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/warn.c Wed Dec 31 18:00:00 1969
+++ ./libc/additional/warn.c Fri Sep 6 17:40:40 2002
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+/* static char rcsid[] = "$OpenBSD: warn.c,v 1.3 1997/07/25 20:30:06 mickey Exp $"; */
+#endif /* LIBC_SCCS and not lint */
+
+#include <err.h>
+
+#include <stdarg.h>
+
+void warn(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vwarn(fmt, ap);
+ va_end(ap);
+}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/warnx.c ./libc/additional/warnx.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/additional/warnx.c Wed Dec 31 18:00:00 1969
+++ ./libc/additional/warnx.c Fri Sep 6 17:40:40 2002
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+/* static char rcsid[] = "$OpenBSD: warnx.c,v 1.2 1996/08/19 08:27:50 tholo Exp $"; */
+#endif /* LIBC_SCCS and not lint */
+
+#include <err.h>
+
+#include <stdarg.h>
+
+void warnx(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+
+ vwarnx(fmt, ap);
+ va_end(ap);
+}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/inet/resolv.c ./libc/inet/resolv.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/inet/resolv.c Mon Aug 19 06:07:21 2002
+++ ./libc/inet/resolv.c Fri Sep 6 17:59:05 2002
@@ -2000,3 +2000,85 @@
return NETDB_SUCCESS;
}
#endif
+
+#ifdef L_resolveaddress
+
+int resolve_address(const char *address, int nscount,
+ char **nsip, struct in_addr *in)
+{
+ unsigned char *packet;
+ struct resolv_answer a;
+ char temp[256];
+ int i;
+ int nest = 0;
+
+ if (!address || !in)
+ return -1;
+
+ strncpy(temp, address, sizeof(temp));
+
+ for (;;) {
+
+ i = __dns_lookup(temp, T_A, nscount, nsip, &packet, &a);
+
+ if (i < 0)
+ return -1;
+
+ free(a.dotted);
+
+ if (a.atype == T_CNAME) { /* CNAME */
+ DPRINTF("Got a CNAME in resolve_address()\n");
+ i = __decode_dotted(packet, a.rdoffset, temp, sizeof(temp));
+ free(packet);
+
+ if (i < 0)
+ return -1;
+ if (++nest > MAX_RECURSE)
+ return -1;
+ continue;
+ } else if (a.atype == T_A) { /* ADDRESS */
+ free(packet);
+ break;
+ } else {
+ free(packet);
+ return -1;
+ }
+ }
+
+ if (in)
+ memcpy(in, a.rdata, INADDRSZ); /* IPv4 T_A */
+
+ return 0;
+}
+#endif
+
+#ifdef L_resolvename
+extern int resolve_address(const char *address, int nscount, char **nsip, struct in_addr *in);
+
+const char *resolve_name(const char *name, int mailbox)
+{
+ struct in_addr in;
+ int i;
+
+ /* shortcut: is it a valid IP address to begin with? */
+ if (inet_aton(name, &in))
+ return name;
+
+ __open_nameservers();
+
+ DPRINTF("looking up '%s', mailbox=%d, nameservers=%d\n",
+ name, mailbox, __nameservers);
+
+/* if (mailbox) */
+/* i = resolve_mailbox(name, nameservers, nameserver, &in); */
+/* else */
+ i = resolve_address(name, __nameservers, __nameserver, &in);
+
+ if (i < 0)
+ return 0;
+
+ DPRINTF("success = '%s'\n", inet_ntoa(in));
+
+ return inet_ntoa(in);
+}
+#endif
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/inet/rpc/clnt_generic.c ./libc/inet/rpc/clnt_generic.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/inet/rpc/clnt_generic.c Mon Jun 17 16:12:14 2002
+++ ./libc/inet/rpc/clnt_generic.c Fri Sep 6 16:16:54 2002
@@ -113,7 +113,7 @@
bzero (sin.sin_zero, sizeof (sin.sin_zero));
memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length);
-#warning getprotobyname is not reentrant... Add getprotobyname_r
+/* #warning getprotobyname is not reentrant... Add getprotobyname_r */
p = getprotobyname(proto);
if (p == NULL) {
struct rpc_createerr *ce = &get_rpc_createerr ();
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/inet/rpc/rcmd.c ./libc/inet/rpc/rcmd.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/inet/rpc/rcmd.c Thu Aug 15 23:49:03 2002
+++ ./libc/inet/rpc/rcmd.c Fri Sep 6 16:18:23 2002
@@ -40,7 +40,7 @@
#ifdef __UCLIBC_HAS_THREADS__
#undef __UCLIBC_HAS_THREADS__
-#warning FIXME I am not reentrant yet...
+/* #warning FIXME I am not reentrant yet... */
#endif
#define __USE_GNU
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/misc/internals/__uClibc_main.c ./libc/misc/internals/__uClibc_main.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/misc/internals/__uClibc_main.c Mon Aug 19 05:10:01 2002
+++ ./libc/misc/internals/__uClibc_main.c Fri Sep 6 19:15:57 2002
@@ -31,6 +31,41 @@
extern void weak_function _locale_init(void);
#endif
+#ifdef BRECIS
+/*
+ * Define an empty function and use it as a weak alias for the stdio
+ * initialization routine. That way we don't pull in all the stdio
+ * code unless we need to. Similarly, do the same for _stdio_term
+ * so as not to include atexit unnecessarily.
+ *
+ * NOTE!!! This is only true for the _static_ case!!!
+ */
+
+int __uClibc_empty_func_atexit(void (*function)(void))
+{
+ return(0);
+}
+
+void __uClibc_empty_func(void)
+{
+}
+
+static int __h_errno_tmp;
+int *__uClibc_empty_func_h_errno(void)
+{
+ return(&__h_errno_tmp);
+}
+
+weak_alias(__uClibc_empty_func, _fini); // 1
+weak_alias(__uClibc_empty_func, _stdio_init); // 2
+weak_alias(__uClibc_empty_func_atexit, atexit); // 3
+weak_alias(__uClibc_empty_func, _init); // 4
+weak_alias(__uClibc_empty_func_h_errno, __h_errno_location); // 5
+weak_alias(__uClibc_empty_func, _locale_init); // 6
+weak_alias(__uClibc_empty_func, _stdio_term); // 7
+weak_alias(__environ, environ); // 8
+
+#endif /* BRECIS */
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/misc/locale/locale.c ./libc/misc/locale/locale.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/misc/locale/locale.c Wed Jul 3 12:23:59 2002
+++ ./libc/misc/locale/locale.c Fri Sep 6 16:08:34 2002
@@ -46,7 +46,7 @@
#ifdef __LOCALE_C_ONLY
-link_warning(setlocale,"the 'setlocale' function supports only C|POSIX locales");
+/* link_warning(setlocale,"the 'setlocale' function supports only C|POSIX locales"); */
static const char C_string[] = "C";
@@ -272,8 +272,8 @@
#ifdef __LOCALE_C_ONLY
-#warning localeconv is hardwired for C/POSIX locale only
-link_warning(localeconv,"the 'localeconv' function is hardwired for C/POSIX locale only");
+/* #warning localeconv is hardwired for C/POSIX locale only */
+/* link_warning(localeconv,"the 'localeconv' function is hardwired for C/POSIX locale only"); */
static struct lconv the_lconv;
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/misc/time/time.c ./libc/misc/time/time.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/misc/time/time.c Sun Aug 11 23:32:33 2002
+++ ./libc/misc/time/time.c Fri Sep 6 16:05:08 2002
@@ -450,7 +450,7 @@
register rule_struct *r = _time_tzinfo;
long sec;
int i, isdst, isleap, day, day0, monlen, mday;
- int oday; /* Note: oday can be uninitialized. */
+ int oday = 0; /* Note: oday can be uninitialized. */
isdst = 0;
if (r[1].tzname[0] != 0) {
@@ -1682,7 +1682,7 @@
{
register int *p;
time_t t1, t, v;
- int wday; /* Note: wday can be uninitialized. */
+ int wday=0; /* Note: wday can be uninitialized. */
{
register const uint16_t *vp;
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/pwd_grp/__getgrent.c ./libc/pwd_grp/__getgrent.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/pwd_grp/__getgrent.c Sun Aug 18 13:50:51 2002
+++ ./libc/pwd_grp/__getgrent.c Fri Sep 6 16:11:49 2002
@@ -24,6 +24,7 @@
#include <string.h>
#include "config.h"
+#if 0
#ifdef __UCLIBC_HAS_THREADS__
#include <pthread.h>
static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
@@ -33,6 +34,7 @@
# define LOCK
# define UNLOCK
#endif
+#endif /* 0 */
/*
* This is the core group-file read function. It behaves exactly like
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/stdio/printf.c ./libc/stdio/printf.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/stdio/printf.c Fri Aug 16 19:35:15 2002
+++ ./libc/stdio/printf.c Fri Sep 6 16:13:31 2002
@@ -769,7 +769,7 @@
int n;
int argtype[MAX_ARGS_PER_SPEC+2];
int argnumber[3]; /* width, precision, 1st data arg */
- unsigned int conv_num; /* This does not need to be initialized. */
+ unsigned int conv_num = 0; /* This does not need to be initialized. */
static const char spec_flags[] = SPEC_FLAGS;
static const char spec_chars[] = SPEC_CHARS;/* TODO: b? */
static const char spec_ranges[] = SPEC_RANGES;
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/stdlib/valloc.c ./libc/stdlib/valloc.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/stdlib/valloc.c Wed Sep 4 15:44:36 2002
+++ ./libc/stdlib/valloc.c Fri Sep 6 16:21:57 2002
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
+#include <malloc.h>
static size_t pagesize;
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/string/wstring.c ./libc/string/wstring.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/string/wstring.c Tue Aug 27 14:23:02 2002
+++ ./libc/string/wstring.c Fri Sep 6 16:15:46 2002
@@ -628,7 +628,7 @@
#ifdef L_strcmp
#ifndef L_wcscmp
-#warning implement strcoll and remove weak alias (or enable for C locale only)
+/* #warning implement strcoll and remove weak alias (or enable for C locale only) */
weak_alias(strcmp,strcoll);
#endif
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/DUMP ./libc/sysdeps/linux/common/DUMP
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/DUMP Wed Dec 31 18:00:00 1969
+++ ./libc/sysdeps/linux/common/DUMP Fri Sep 6 23:58:07 2002
@@ -0,0 +1,46 @@
+#!/bin/csh -x
+setenv PROG wait4.o
+#-----------------------------------------------------------------------------
+source ~/uClinux/brecis/build.env
+which mips-objdump
+#-----------------------------------------------------------------------------
+# mips-objdump -dlSDxhprtG ${PROG} > ${PROG}.objdump
+mips-objdump -dlSDxhprTtRG -j .reginfo ${PROG} > ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .reginfo ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .hash ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .dynsym ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .dynstr ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+# "s" will dump sections in hex.
+# mips-objdump -dlDrSs -j .text ${PROG} >> ${PROG}.objdump
+mips-objdump -dlDrS -j .text ${PROG} >> ${PROG}.objdump
+#mips-objdump -lsS -j .text ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -lsS -j .rodata ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .rel.dyn ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -lsS -j .data ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .got ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .dynamic ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .sbss ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .bss ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .comment ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .pdr ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .compact_rel ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .mdebug ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
+mips-objdump -ls -j .rtproc ${PROG} >> ${PROG}.objdump
+echo '------------------------------------------------------------------------------' >> ${PROG}.objdump
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/bits/errno.h ./libc/sysdeps/linux/common/bits/errno.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/bits/errno.h Fri Aug 23 20:35:44 2002
+++ ./libc/sysdeps/linux/common/bits/errno.h Sat Sep 7 00:00:57 2002
@@ -39,7 +39,7 @@
# if defined _LIBC
/* We wouldn't need a special macro anymore but it is history. */
-# define __set_errno(val) ((errno) = (val))
+# define __set_errno(val) ((errno) = (-val))
# endif /* _LIBC */
# if defined __UCLIBC_HAS_THREADS__
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/bits/in.h ./libc/sysdeps/linux/common/bits/in.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/bits/in.h Fri Mar 1 14:46:02 2002
+++ ./libc/sysdeps/linux/common/bits/in.h Fri Sep 6 18:31:58 2002
@@ -70,27 +70,35 @@
};
/* Structure used for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */
+#ifndef ip_mreq_defined
+#define ip_mreq_defined
struct ip_mreq
{
struct in_addr imr_multiaddr; /* IP multicast address of group */
struct in_addr imr_interface; /* local IP address of interface */
};
+#endif
/* As above but including interface specification by index. */
+#ifndef ip_mreqn_defined
+#define ip_mreqn_defined
struct ip_mreqn
{
struct in_addr imr_multiaddr; /* IP multicast address of group */
struct in_addr imr_address; /* local IP address of interface */
int imr_ifindex; /* Interface index */
};
-
+#endif
/* Structure used for IP_PKTINFO. */
+#ifndef in_pktinfo_defined
+#define in_pktinfo_defined
struct in_pktinfo
{
int ipi_ifindex; /* Interface index */
struct in_addr ipi_spec_dst; /* Routing destination address */
struct in_addr ipi_addr; /* Header destination address */
};
+#endif
/* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
The first word in the comment at the right is the data type used;
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/bits/sockaddr.h ./libc/sysdeps/linux/common/bits/sockaddr.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/bits/sockaddr.h Fri Mar 1 14:46:02 2002
+++ ./libc/sysdeps/linux/common/bits/sockaddr.h Fri Sep 6 17:32:48 2002
@@ -26,7 +26,10 @@
/* POSIX.1g specifies this type name for the `sa_family' member. */
+#ifndef sa_family_t_defined
+#define sa_family_t_defined
typedef unsigned short int sa_family_t;
+#endif
/* This macro is used to declare the initial common members
of the data types used for socket addresses, `struct sockaddr',
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/bits/uio.h ./libc/sysdeps/linux/common/bits/uio.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/bits/uio.h Fri Mar 1 14:46:02 2002
+++ ./libc/sysdeps/linux/common/bits/uio.h Fri Sep 6 17:37:07 2002
@@ -38,9 +38,12 @@
#define UIO_MAXIOV 1024
+#ifndef iovec_defined
+#define iovec_defined
/* Structure for scatter/gather I/O. */
struct iovec
{
void *iov_base; /* Pointer to data. */
size_t iov_len; /* Length of data. */
};
+#endif
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/syscalls.c ./libc/sysdeps/linux/common/syscalls.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/syscalls.c Tue Sep 3 21:48:29 2002
+++ ./libc/sysdeps/linux/common/syscalls.c Fri Sep 6 21:07:23 2002
@@ -42,9 +42,10 @@
//See _exit.c
//#define __NR_fork 2
+#ifndef BRECIS
#ifdef L___libc_fork
#include <unistd.h>
-# ifdef __UCLIBC_HAS_MMU__
+# if defined __UCLIBC_HAS_MMU__
#define __NR___libc_fork __NR_fork
_syscall0(pid_t, __libc_fork);
weak_alias (__libc_fork, fork)
@@ -56,6 +57,7 @@
}
# endif
#endif
+#endif
//#define __NR_read 3
#ifdef L___libc_read
@@ -1281,7 +1283,7 @@
//#define __NR_mlockall 152
#ifdef L_mlockall
#include <sys/mman.h>
-# if defined __UCLIBC_HAS_MMU__ && defined __NR_mlockall
+# if (defined __UCLIBC_HAS_MMU__ || defined BRECIS) && defined __NR_mlockall
_syscall1(int, mlockall, int, flags);
# endif
#endif
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/wait4.o.objdump ./libc/sysdeps/linux/common/wait4.o.objdump
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/common/wait4.o.objdump Wed Dec 31 18:00:00 1969
+++ ./libc/sysdeps/linux/common/wait4.o.objdump Sat Sep 7 00:02:54 2002
@@ -0,0 +1,139 @@
+
+wait4.o: file format elf32-bigmips
+wait4.o
+architecture: mips:isa32, flags 0x00000011:
+HAS_RELOC, HAS_SYMS
+start address 0x00000000
+private flags = 50000001: [no abi set] [mips32] [not 32bitmode]
+
+Sections:
+Idx Name Size VMA LMA File off Algn
+ 0 .text 00000078 00000000 00000000 00000034 2**2
+ CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
+ 1 .data 00000000 00000000 00000000 000000ac 2**0
+ CONTENTS, ALLOC, LOAD, DATA
+ 2 .bss 00000000 00000000 00000000 000000ac 2**0
+ ALLOC
+ 3 .reginfo 00000018 00000000 00000000 000000ac 2**2
+ CONTENTS, READONLY, LINK_ONCE_SAME_SIZE
+ 4 .mdebug.abi32 00000000 00000000 00000000 000000c4 2**0
+ CONTENTS, READONLY
+SYMBOL TABLE:
+00000000 l d .text 00000000
+00000000 l d .data 00000000
+00000000 l d .bss 00000000
+00000000 l d .mdebug.abi32 00000000
+00000000 l d .reginfo 00000000
+00000000 g F .text 00000078 wait4
+00000000 *UND* 00000000 __errno_location
+
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+Contents of section .reginfo:
+ 0000 a00700fc 00000000 00000000 00000000 ................
+ 0010 00000000 00000000 ........
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+Disassembly of section .text:
+
+00000000 <wait4>:
+wait4():
+ 0: 27bdffe0 addiu sp,sp,-32
+ 4: afb20018 sw s2,24(sp)
+ 8: afb10014 sw s1,20(sp)
+ c: afb00010 sw s0,16(sp)
+ 10: afbf001c sw ra,28(sp)
+ 14: 00809021 move s2,a0
+ 18: 00a08821 move s1,a1
+ 1c: 00c08021 move s0,a2
+ 20: 00e01821 move v1,a3
+ 24: 02402021 move a0,s2
+ 28: 02202821 move a1,s1
+ 2c: 02003021 move a2,s0
+ 30: 00603821 move a3,v1
+ 34: 24021012 li v0,4114
+ 38: 0000000c syscall
+ 3c: 00408021 move s0,v0
+ 40: 00e01821 move v1,a3
+ 44: 10600006 beqz v1,60 <wait4+0x60>
+ 48: 02001021 move v0,s0
+ 4c: 0c000000 jal 0 <wait4>
+ 4c: R_MIPS_26 __errno_location
+ 50: 00000000 nop
+ 54: 00101823 negu v1,s0
+ 58: ac430000 sw v1,0(v0)
+ 5c: 2402ffff li v0,-1
+ 60: 8fbf001c lw ra,28(sp)
+ 64: 8fb20018 lw s2,24(sp)
+ 68: 8fb10014 lw s1,20(sp)
+ 6c: 8fb00010 lw s0,16(sp)
+ 70: 03e00008 jr ra
+ 74: 27bd0020 addiu sp,sp,32
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+Contents of section .data:
+Disassembly of section .data:
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
+
+wait4.o: file format elf32-bigmips
+
+------------------------------------------------------------------------------
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/Makefile ./libc/sysdeps/linux/mips/Makefile
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/Makefile Thu Sep 5 00:29:29 2002
+++ ./libc/sysdeps/linux/mips/Makefile Fri Sep 6 19:38:44 2002
@@ -27,13 +27,26 @@
TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
-CRT0=crt0.S
-CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0))
-
-SSRC=bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S fork.S syscall.S
+# CRT0=crt0.S
+# CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0))
+CRT0=crt0.c
+CRT0_OBJ=$(patsubst %.c,%.o, $(CRT0))
+
+SSRC=bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S syscall.S
+ifeq ($(strip $(HAS_MMU)),true)
+SSRC += fork.S
+else
+SSRC += vfork.S
+endif
+ifeq ($(strip $(HAS_FORK)),true)
+SSRC += fork.S
+endif
SOBJS=$(patsubst %.S,%.o, $(SSRC))
-CSRC=__longjmp.c brk.c vfork.c setjmp_aux.c _mmap.c pipe.c __syscall_error.c
+CSRC=__longjmp.c brk.c setjmp_aux.c _mmap.c pipe.c __syscall_error.c
+ifeq ($(strip $(HAS_MMU)),true)
+CSRC += vfork.c
+endif
COBJS=$(patsubst %.c,%.o, $(CSRC))
OBJS=$(SOBJS) $(MOBJ) $(COBJS)
@@ -48,8 +61,11 @@
cp $(CRT0_OBJ) $(TOPDIR)lib/
-$(CRT0_OBJ): %.o : %.S
- $(CC) $(CFLAGS) -c $< -o $@
+# $(CRT0_OBJ): %.o : %.S
+# $(CC) $(CFLAGS) -c $< -o $@
+# $(STRIPTOOL) -x -R .note -R .comment $*.o
+$(CRT0_OBJ): %.o : %.c
+ $(CC) $(CFLAGS) -DNO_UNDERSCORE -DVERBOSE_DLINKER -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(SOBJS): %.o : %.S
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/__longjmp.c ./libc/sysdeps/linux/mips/__longjmp.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/__longjmp.c Mon Feb 4 07:51:21 2002
+++ ./libc/sysdeps/linux/mips/__longjmp.c Fri Sep 6 16:26:06 2002
@@ -27,9 +27,7 @@
#endif
void
-__longjmp (env, val_arg)
- __jmp_buf env;
- int val_arg;
+__longjmp (__jmp_buf env, int val_arg)
{
/* gcc 1.39.19 miscompiled the longjmp routine (as it did setjmp before
the hack around it); force it to use $a1 for the longjmp value.
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/bits/ioctl-types.h ./libc/sysdeps/linux/mips/bits/ioctl-types.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/bits/ioctl-types.h Wed Nov 14 01:37:42 2001
+++ ./libc/sysdeps/linux/mips/bits/ioctl-types.h Fri Sep 6 18:25:51 2002
@@ -24,6 +24,8 @@
/* Get definition of constants for use with `ioctl'. */
#include <asm/ioctls.h>
+#ifndef winsize_defined
+#define winsize_defined
struct winsize
{
unsigned short int ws_row;
@@ -31,8 +33,11 @@
unsigned short int ws_xpixel;
unsigned short int ws_ypixel;
};
+#endif
#define NCC 8
+#ifndef termio_defined
+#define termio_defined
struct termio
{
unsigned short int c_iflag; /* input mode flags */
@@ -43,6 +48,7 @@
/* Yes, this is really NCCS. */
unsigned char c_cc[32 /* NCCS */]; /* control characters */
};
+#endif
/* modem lines */
#define TIOCM_LE 0x001 /* line enable */
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/bits/socket.h ./libc/sysdeps/linux/mips/bits/socket.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/bits/socket.h Wed Nov 14 01:37:42 2001
+++ ./libc/sysdeps/linux/mips/bits/socket.h Fri Sep 6 18:27:32 2002
@@ -141,12 +141,15 @@
/* Get the definition of the macro to define the common sockaddr members. */
#include <bits/sockaddr.h>
+#ifndef sockaddr_defined
+#define sockaddr_defined
/* Structure describing a generic socket address. */
struct sockaddr
{
__SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
char sa_data[14]; /* Address data. */
};
+#endif
/* Structure large enough to hold any socket address (with the historical
@@ -210,6 +213,8 @@
};
+#ifndef msghdr_defined
+#define msghdr_defined
/* Structure describing messages sent by
`sendmsg' and received by `recvmsg'. */
struct msghdr
@@ -225,7 +230,9 @@
int msg_flags; /* Flags on received message. */
};
-
+#endif
+#ifndef cmsghdr_defined
+#define cmsghdr_defined
/* Structure used for storage of ancillary data object information. */
struct cmsghdr
{
@@ -237,6 +244,7 @@
__extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
#endif
};
+#endif /* cmsghdr_defined */
/* Ancillary data object manipulation macros. */
#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
@@ -254,8 +262,12 @@
+ CMSG_ALIGN (sizeof (struct cmsghdr)))
#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+#ifndef __cmsg_nxthdr_defined
+#define __cmsg_nxthdr_defined
extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
struct cmsghdr *__cmsg) __THROW;
+#endif
+
#ifdef __USE_EXTERN_INLINES
# ifndef _EXTERN_INLINE
# define _EXTERN_INLINE extern __inline
@@ -293,23 +305,28 @@
};
/* User visible structure for SCM_CREDENTIALS message */
-
+#ifndef ucred_defined
+#define ucred_defined
struct ucred
{
pid_t pid; /* PID of sending process. */
uid_t uid; /* UID of sending process. */
gid_t gid; /* GID of sending process. */
};
+#endif
/* Get socket manipulation related informations from kernel headers. */
#include <asm/socket.h>
+#ifndef linger_defined
+#define linger_defined
/* Structure used to manipulate the SO_LINGER option. */
struct linger
{
int l_onoff; /* Nonzero to linger on close. */
int l_linger; /* Time to linger. */
};
+#endif
#endif /* bits/socket.h */
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/bits/syscalls.h ./libc/sysdeps/linux/mips/bits/syscalls.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/bits/syscalls.h Thu Sep 5 00:29:27 2002
+++ ./libc/sysdeps/linux/mips/bits/syscalls.h Fri Sep 6 23:28:25 2002
@@ -10,7 +10,7 @@
#include <bits/sysnum.h>
#ifndef __set_errno
-# define __set_errno(val) (*__errno_location ()) = (val)
+# define __set_errno(val) (*__errno_location ()) = (- val)
#endif
#ifndef SYS_ify
# define SYS_ify(syscall_name) (__NR_##syscall_name)
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/bits/termios.h ./libc/sysdeps/linux/mips/bits/termios.h
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/bits/termios.h Wed Nov 14 01:37:43 2001
+++ ./libc/sysdeps/linux/mips/bits/termios.h Fri Sep 6 18:24:19 2002
@@ -22,10 +22,12 @@
#endif
typedef unsigned char cc_t;
-typedef unsigned int speed_t;
-typedef unsigned int tcflag_t;
+typedef unsigned long speed_t;
+typedef unsigned long tcflag_t;
#define NCCS 32
+#ifndef termios_defined
+#define termios_defined
struct termios
{
tcflag_t c_iflag; /* input mode flags */
@@ -35,6 +37,7 @@
cc_t c_line; /* line discipline */
cc_t c_cc[NCCS]; /* control characters */
};
+#endif
/* c_cc characters */
#define VINTR 0 /* Interrupt character [ISIG]. */
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/crt0.c ./libc/sysdeps/linux/mips/crt0.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/crt0.c Wed Dec 31 18:00:00 1969
+++ ./libc/sysdeps/linux/mips/crt0.c Fri Sep 6 18:55:07 2002
@@ -0,0 +1,87 @@
+/* $Id: crt0.c,v 1.2 2002/08/21 23:09:54 m4 Exp $ */
+/* $OpenBSD: loader.c,v 1.4 2000/10/13 05:21:10 drahn Exp $ */
+
+/*
+ * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed under OpenBSD by
+ * Per Fogelstrom, Opsycon AB, Sweden.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#define _DYN_LOADER
+
+#include <stdlib.h>
+#include <string.h>
+
+/* ------------------------------------------------------------------------ */
+extern void __uClibc_main(int argc,void *argv,void *envp);
+
+/* ------------------------------------------------------------------------ */
+/* This are main variables used thru-out the system. */
+char *__progname = "";
+
+extern int _fdata;
+int *_f_d_a_t_a_ = &_fdata;
+/* ------------------------------------------------------------------------ */
+void __start(const void *sp)
+{
+ struct kframe {
+ int kargc;
+ char *kargv[1]; /* size depends on kargc */
+ char kargstr[1]; /* size varies */
+ char kenvstr[1]; /* size varies */
+ };
+
+ char **argv;
+ int argc;
+ char **envp;
+ struct kframe *kfp;
+
+ kfp = (struct kframe *) sp;
+/* Scan argument and environment vectors. */
+ argc = kfp->kargc;
+ argv = &kfp->kargv[0];
+ envp = &argv[argc + 1];
+
+ {
+ char *ap = (char *)argv[0];
+
+ if (ap != 0) {
+ if ((__progname = (char *)strrchr(ap, '/')) == 0) {
+ __progname = ap;
+ } else {
+ ++__progname;
+ }
+ }
+ }
+
+ __uClibc_main(argc, argv, envp);
+}
+
+/* ------------------------------------------------------------------------ */
+int h_errno;
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/fork.S ./libc/sysdeps/linux/mips/fork.S
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/fork.S Fri Aug 9 08:41:25 2002
+++ ./libc/sysdeps/linux/mips/fork.S Fri Sep 6 23:33:20 2002
@@ -26,7 +26,7 @@
syscall; \
la t3, errno; \
beqz a3, 1f; \
- negu a1, v0; \
+ negu a1, v0; \
sw a1, 0(t3); \
li v0, -1; \
1: ; \
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/pipe.c ./libc/sysdeps/linux/mips/pipe.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/pipe.c Thu Feb 21 18:10:00 2002
+++ ./libc/sysdeps/linux/mips/pipe.c Fri Sep 6 22:18:30 2002
@@ -8,16 +8,17 @@
int pipe(int *fd)
{
- register long int res __asm__ ("$2"); // v0
- register long int res2 __asm__ ("$3"); // v1
+ register long res __asm__ ("$2");
+ register long res2 __asm__ ("$3");
- asm ("move\t$4,%2\n\t" // $4 = a0
- "syscall" /* Perform the system call. */
+ __asm__ volatile ("move $4,%2;"
+ "li $2,%1;"
+ "syscall;"
: "=r" (res)
- : "0" (__NR_pipe), "r" (fd)
- : "$4", "$7");
+ : "i" (__NR_pipe), "r" (fd)
+ : "$2", "$3", "$4", "$7", "$8","$9","$10","$11","$12","$13","$14","$15","$24");
- fd[0] = res;
+ fd[0] = res;
fd[1] = res2;
return(0);
}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/vfork.S ./libc/sysdeps/linux/mips/vfork.S
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/sysdeps/linux/mips/vfork.S Wed Dec 31 18:00:00 1969
+++ ./libc/sysdeps/linux/mips/vfork.S Fri Sep 6 23:32:48 2002
@@ -0,0 +1,80 @@
+/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Brendan Kehoe (brendan at zen.org).
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* #include <features.h> */
+
+#define ALIGN 2
+
+/* Note: .abicalls goes at top of routine, and only one of them. */
+#if defined(USER_ABICALLS)
+#define ABISETUP \
+ .set noreorder; \
+ .cpload t9; \
+ .set reorder;
+
+ .abicalls
+#else
+#define ABISETUP
+#endif
+
+#ifndef __UCLIBC_USE_UNIFIED_SYSCALL__
+#define SYSCALL__(name) \
+ .text; \
+ .align ALIGN; \
+ .globl name; \
+ .ent name, 0; \
+ name: ; \
+ ABISETUP \
+ li v0, __NR_##name ; \
+ syscall; \
+ la t3, errno; \
+ beqz a3, 1f; \
+ negu a1, v0; \
+ sw a1, 0(t3); \
+ li v0, -1; \
+ 1: ; \
+ j ra; \
+ .end name; \
+ .size name,.-name;
+#else /* Unified syscall */
+#define SYSCALL__(name) \
+ .text; \
+/* .align ALIGN;*/ \
+ .globl name; \
+ .ent name, 0; \
+ name: ; \
+ ABISETUP \
+ .set push; \
+ .set noreorder; \
+ j __uClibc_syscall; \
+ addiu v0, zero, __NR_##name ; \
+ .set pop; \
+ .end name; \
+ .size name,.-name;
+#endif /* __UCLIBC_USE_UNIFIED_SYSCALL__ */
+
+#include <asm/asm.h>
+#include <asm/unistd.h>
+#include <asm/mipsregs.h>
+#include <asm/regdef.h>
+/* #include <asm/stackframe.h> */
+
+#define _SYSCALL0(type,name) SYSCALL__(name)
+_SYSCALL0(pid_t, vfork);
+
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/unistd/Makefile ./libc/unistd/Makefile
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libc/unistd/Makefile Wed Aug 7 07:49:37 2002
+++ ./libc/unistd/Makefile Fri Sep 6 17:44:27 2002
@@ -32,6 +32,9 @@
ifeq ($(strip $(HAS_MMU)),true)
CSRC+=daemon.c
endif
+ifeq ($(strip $(HAS_FORK)),true)
+ CSRC+=daemon.c
+endif
# TESTING -- comment this out if it breaks for you
ifeq ($(TARGET_ARCH), $(NATIVE_ARCH))
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libcrypt/md5.c ./libcrypt/md5.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libcrypt/md5.c Wed Aug 7 10:11:51 2002
+++ ./libcrypt/md5.c Fri Sep 6 16:43:28 2002
@@ -112,10 +112,7 @@
*/
static void
-__md5_Encode (output, input, len)
- unsigned char *output;
- u_int32_t *input;
- unsigned int len;
+__md5_Encode (unsigned char *output, u_int32_t *input, unsigned int len)
{
unsigned int i, j;
@@ -133,10 +130,7 @@
*/
static void
-__md5_Decode (output, input, len)
- u_int32_t *output;
- const unsigned char *input;
- unsigned int len;
+__md5_Decode (u_int32_t *output, const unsigned char *input, unsigned int len)
{
unsigned int i, j;
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libm/w_cabs.c ./libm/w_cabs.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libm/w_cabs.c Thu Nov 22 08:01:05 2001
+++ ./libm/w_cabs.c Fri Sep 6 16:44:42 2002
@@ -13,8 +13,7 @@
};
double
-cabs(z)
- struct complex z;
+cabs(struct complex z)
{
return hypot(z.x, z.y);
}
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libpthread/linuxthreads/manager.c ./libpthread/linuxthreads/manager.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libpthread/linuxthreads/manager.c Wed Feb 20 03:18:44 2002
+++ ./libpthread/linuxthreads/manager.c Fri Sep 6 16:52:28 2002
@@ -294,7 +294,10 @@
pthread_descr new_thread;
char * new_thread_bottom;
char * guardaddr;
- size_t stacksize, guardsize;
+#ifdef __UCLIBC_HAS_MMU__
+ size_t stacksize;
+#endif
+ size_t guardsize;
if (attr != NULL && attr->__stackaddr_set)
{
@@ -377,16 +380,16 @@
* the kernel chokes on a non-aligned stack frame. Choose the lower
* available word boundary.
*/
- new_thread_bottom = (pthread_descr) new_stack;
- new_thread = (long)((char *) new_stack + INITIAL_STACK_SIZE - sizeof(*new_thread) - 1)
- & -sizeof(void*); /* align new_thread */
+ new_thread_bottom = (char *) new_stack;
+ new_thread = (pthread_descr)((long)((char *) new_stack + INITIAL_STACK_SIZE - sizeof(*new_thread) - 1)
+ & -sizeof(void*)); /* align new_thread */
guardaddr = NULL;
guardsize = 0;
PDEBUG("thread stack: bos=%p, tos=%p\n", new_thread_bottom, new_thread);
/* check the initial thread stack boundaries so they don't overlap */
- NOMMU_INITIAL_THREAD_BOUNDS(new_thread, new_thread_bottom);
+ NOMMU_INITIAL_THREAD_BOUNDS((char *)new_thread, new_thread_bottom);
PDEBUG("initial stack: bos=%p, tos=%p\n", __pthread_initial_thread_bos,
__pthread_initial_thread_tos);
diff -ruN /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libpthread/linuxthreads/pthread.c ./libpthread/linuxthreads/pthread.c
--- /usr/src/OTHER/M4/lineo/NEW/uClibc/uClibc.2002-09-06/libpthread/linuxthreads/pthread.c Mon Aug 19 05:05:03 2002
+++ ./libpthread/linuxthreads/pthread.c Fri Sep 6 16:56:42 2002
@@ -252,8 +252,10 @@
{
struct sigaction sa;
sigset_t mask;
+#ifdef __UCLIBC_HAS_MMU__
struct rlimit limit;
int max_stack;
+#endif
/* If already done (e.g. by a constructor called earlier!), bail out */
if (__pthread_initial_thread_bos != NULL) return;
More information about the uClibc
mailing list