------------------------------------------------------------------------
r26222 | austinf | 2009-04-27 17:47:49 -0500 (Mon, 27 Apr 2009) | 19 lines
Changed paths:
   M /trunk/uClibc/include/stdint.h

patch from Joseph S. Meyers

This patch merges

2006-06-23  Paul Eggert  

        [BZ #2841]
        * sysdeps/generic/stdint.h (UINT8_C, UINT16_C): Don't append 'U',
        since C99 requires the result to promote to 'int' when uint_least8_t
        and uint_least16_t promote to 'int'.

from glibc to fix a bug in uClibc's stdint.h
(GCC's testsuite will now detect this problem, along with various others 
some systems have in their stdint.h headers.)

Signed-off-by: Austin Foxley 



 ------------------------------------------------------------------------

Index: include/stdint.h
===================================================================
--- include/stdint.h	(revision 26221)
+++ include/stdint.h	(revision 26222)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,1999,2000,2001,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -309,8 +309,8 @@
 # endif
 
 /* Unsigned.  */
-# define UINT8_C(c)	c ## U
-# define UINT16_C(c)	c ## U
+# define UINT8_C(c)	c
+# define UINT16_C(c)	c
 # define UINT32_C(c)	c ## U
 # if __WORDSIZE == 64
 #  define UINT64_C(c)	c ## UL

 ------------------------------------------------------------------------
r26189 | vda | 2009-04-23 06:19:30 -0500 (Thu, 23 Apr 2009) | 3 lines
Changed paths:
   M /trunk/uClibc/libc/string/i386/memset.c

libc/string/i386/memset.c: memset 1 byte at a time is a bit gross


 ------------------------------------------------------------------------

Index: libc/string/i386/memset.c
===================================================================
--- libc/string/i386/memset.c	(revision 26188)
+++ libc/string/i386/memset.c	(revision 26189)
@@ -28,21 +28,68 @@
  * More importantly, these should provide a good example for
  * others to follow when adding arch specific optimizations.
  *  -Erik
+ *
+ * 2009-04: modified by Denys Vlasenko 
+ * Fill byte-by-byte is a bit too slow. I prefer 46 byte function
+ * which fills x4 faster than 21 bytes one.
  */
 
 #include 
 
-/* Experimentally off - libc_hidden_proto(memset) */
 #undef memset
 void *memset(void *s, int c, size_t count)
 {
-    int d0, d1;
-    __asm__ __volatile__(
-	    "rep\n\t"
-	    "stosb"
-	    : "=&c" (d0), "=&D" (d1)
-	    :"a" (c),"1" (s),"0" (count)
-	    :"memory");
-    return s;
+	int reg, edi;
+	__asm__ __volatile__(
+
+		/* Most of the time, count is divisible by 4 and nonzero */
+		/* It's better to make this case faster */
+	/*	"	jecxz	9f\n" - (optional) count == 0: goto ret */
+		"	mov	%%ecx, %1\n"
+		"	shr	$2, %%ecx\n"
+		"	jz	1f\n" /* zero words: goto fill_bytes */
+		/* extend 8-bit fill to 32 bits */
+		"	movzx	%%al, %%eax\n" /* 3 bytes */
+	/* or:	"	and	$0xff, %%eax\n" - 5 bytes */
+		"	imul	$0x01010101, %%eax\n" /* 6 bytes */
+		/* fill full words */
+		"	rep; stosl\n"
+		/* fill 0-3 bytes */
+		"1:	and	$3, %1\n"
+		"	jz	9f\n" /* (count & 3) == 0: goto end */
+		"2:	stosb\n"
+		"	dec	%1\n"
+		"	jnz	2b\n"
+		/* end */
+		"9:\n"
+
+		: "=&D" (edi), "=&r" (reg)
+		: "0" (s), "a" (c), "c" (count)
+		: "memory"
+	);
+	return s;
 }
 libc_hidden_def(memset)
+
+/*
+gcc 4.3.1
+=========
+57                     push   %edi
+8b 7c 24 08            mov    0x8(%esp),%edi
+8b 4c 24 10            mov    0x10(%esp),%ecx
+8b 44 24 0c            mov    0xc(%esp),%eax
+89 ca                  mov    %ecx,%edx
+c1 e9 02               shr    $0x2,%ecx
+74 0b                  je     1f <__GI_memset+0x1f>
+0f b6 c0               movzbl %al,%eax
+69 c0 01 01 01 01      imul   $0x1010101,%eax,%eax
+f3 ab                  rep stos %eax,%es:(%edi)
+83 e2 03               and    $0x3,%edx
+74 04                  je     28 <__GI_memset+0x28>
+aa                     stos   %al,%es:(%edi)
+4a                     dec    %edx
+75 fc                  jne    24 <__GI_memset+0x24>
+8b 44 24 08            mov    0x8(%esp),%eax
+5f                     pop    %edi
+c3                     ret
+*/

 ------------------------------------------------------------------------
r26155 | vda | 2009-04-18 19:51:04 -0500 (Sat, 18 Apr 2009) | 5 lines
Changed paths:
   M /trunk/uClibc/extra/scripts/install_kernel_headers.sh

Reinstate {drm,mtd,rdma,sound,video} directory installtion
pending some explanation from gurus. Expanded comment explaining
_why_ we try to install these exact directories.


 ------------------------------------------------------------------------

Index: extra/scripts/install_kernel_headers.sh
===================================================================
--- extra/scripts/install_kernel_headers.sh	(revision 26154)
+++ extra/scripts/install_kernel_headers.sh	(revision 26155)
@@ -60,17 +60,17 @@
 		die_if_not_dir "$2/asm-generic"
 		cp -RHL "$KERNEL_HEADERS/asm-generic"/* "$2/asm-generic" || exit 1
 	fi
-## vda: looks like I was fooled by two mtd directories existing
-## in include/ and include/linux/. This seems to be not needed.
-##	# For paranoid reasons, we use explicit list of directories
-##	# which may be here. List last updated for linux-2.6.27:
-##	for dir in drm mtd rdma sound video; do
-##		if test -d "$KERNEL_HEADERS/$dir"; then
-##			mkdir -p "$2/$dir" 2>/dev/null
-##			die_if_not_dir "$2/$dir"
-##			cp -RHL "$KERNEL_HEADERS/$dir"/* "$2/$dir" || exit 1
-##		fi
-##	done
+	# For paranoid reasons, we use explicit list of directories
+	# which may be found in kernel's "sanitized headers" directory after
+	# "make defconfig; make headers_install" was run in kernel tree.
+	# List last updated for linux-2.6.27:
+	for dir in drm mtd rdma sound video; do
+		if test -d "$KERNEL_HEADERS/$dir"; then
+			mkdir -p "$2/$dir" 2>/dev/null
+			die_if_not_dir "$2/$dir"
+			cp -RHL "$KERNEL_HEADERS/$dir"/* "$2/$dir" || exit 1
+		fi
+	done
 	if ! test -f "$2/linux/version.h"; then
 		echo "Warning: '$KERNEL_HEADERS/linux/version.h' is not found"
 		echo "in kernel headers directory specified in .config."

 ------------------------------------------------------------------------
r26154 | vda | 2009-04-18 18:45:13 -0500 (Sat, 18 Apr 2009) | 4 lines
Changed paths:
   M /trunk/uClibc/extra/scripts/install_kernel_headers.sh

install_kernel_headers: comment out copying of extra directories,
  this seem to be not needed


 ------------------------------------------------------------------------

Index: extra/scripts/install_kernel_headers.sh
===================================================================
--- extra/scripts/install_kernel_headers.sh	(revision 26153)
+++ extra/scripts/install_kernel_headers.sh	(revision 26154)
@@ -60,15 +60,17 @@
 		die_if_not_dir "$2/asm-generic"
 		cp -RHL "$KERNEL_HEADERS/asm-generic"/* "$2/asm-generic" || exit 1
 	fi
-	# For paranoid reasons, we use explicit list of directories
-	# which may be here. List last updated for linux-2.6.27:
-	for dir in drm mtd rdma sound video; do
-		if test -d "$KERNEL_HEADERS/$dir"; then
-			mkdir -p "$2/$dir" 2>/dev/null
-			die_if_not_dir "$2/$dir"
-			cp -RHL "$KERNEL_HEADERS/$dir"/* "$2/$dir" || exit 1
-		fi
-	done
+## vda: looks like I was fooled by two mtd directories existing
+## in include/ and include/linux/. This seems to be not needed.
+##	# For paranoid reasons, we use explicit list of directories
+##	# which may be here. List last updated for linux-2.6.27:
+##	for dir in drm mtd rdma sound video; do
+##		if test -d "$KERNEL_HEADERS/$dir"; then
+##			mkdir -p "$2/$dir" 2>/dev/null
+##			die_if_not_dir "$2/$dir"
+##			cp -RHL "$KERNEL_HEADERS/$dir"/* "$2/$dir" || exit 1
+##		fi
+##	done
 	if ! test -f "$2/linux/version.h"; then
 		echo "Warning: '$KERNEL_HEADERS/linux/version.h' is not found"
 		echo "in kernel headers directory specified in .config."

 ------------------------------------------------------------------------
r26153 | vda | 2009-04-18 18:12:40 -0500 (Sat, 18 Apr 2009) | 16 lines
Changed paths:
   M /trunk/uClibc/libc/inet/Makefile.in
   M /trunk/uClibc/libc/inet/resolv.c

libc/inet/resolv.c:

Collapse __length_dotted into __length_question (the sole user of it).
Make __length_question and __decode_answer static, they are used only once
  by only one function.
Delete __decode_question, it is unused.
All in all, four less .o files in libc.a.
Document what __dns_lookup returns (length of the packet).
Propagate packet len into __decode_answer, __length_question, __decode_dotted
  and check that we do not use data past the end of the packet.
Rename some variables/parameters to better names (len -> packet_len,
  data -> packet etc).
Add mini-doc how DNS packets look like.
Style cleanup.


 ------------------------------------------------------------------------

Index: libc/inet/Makefile.in
===================================================================
--- libc/inet/Makefile.in	(revision 26152)
+++ libc/inet/Makefile.in	(revision 26153)
@@ -34,8 +34,8 @@
 
 # multi source resolv.c
 resolv_CSRC += \
-	encodeh.c decodeh.c encoded.c decoded.c lengthd.c \
-	encodeq.c decodeq.c encodea.c decodea.c lengthq.c \
+	encodeh.c decodeh.c encoded.c decoded.c \
+	encodeq.c encodea.c \
 	dnslookup.c opennameservers.c closenameservers.c \
 	read_etc_hosts_r.c get_hosts_byaddr_r.c get_hosts_byname_r.c \
 	getnameinfo.c \
Index: libc/inet/resolv.c
===================================================================
--- libc/inet/resolv.c	(revision 26152)
+++ libc/inet/resolv.c	(revision 26153)
@@ -9,7 +9,6 @@
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  */
-
 /*
  * Portions Copyright (c) 1985, 1993
  *    The Regents of the University of California.  All rights reserved.
@@ -38,7 +37,6 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-
 /*
  * Portions Copyright (c) 1993 by Digital Equipment Corporation.
  *
@@ -58,7 +56,6 @@
  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  * SOFTWARE.
  */
-
 /*
  * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
  *
@@ -75,33 +72,26 @@
  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  * SOFTWARE.
  */
-
 /*
- *
  *  5-Oct-2000 W. Greathouse  wgreathouse@smva.com
- *                              Fix memory leak and memory corruption.
- *                              -- Every name resolution resulted in
- *                                 a new parse of resolv.conf and new
- *                                 copy of nameservers allocated by
- *                                 strdup.
- *                              -- Every name resolution resulted in
- *                                 a new read of resolv.conf without
- *                                 resetting index from prior read...
- *                                 resulting in exceeding array bounds.
+ *   Fix memory leak and memory corruption.
+ *   -- Every name resolution resulted in
+ *      a new parse of resolv.conf and new
+ *      copy of nameservers allocated by
+ *      strdup.
+ *   -- Every name resolution resulted in
+ *      a new read of resolv.conf without
+ *      resetting index from prior read...
+ *      resulting in exceeding array bounds.
  *
- *                              Limit nameservers read from resolv.conf
+ *   Limit nameservers read from resolv.conf.
+ *   Add "search" domains from resolv.conf.
+ *   Some systems will return a security
+ *   signature along with query answer for
+ *   dynamic DNS entries -- skip/ignore this answer.
+ *   Include arpa/nameser.h for defines.
+ *   General cleanup.
  *
- *                              Add "search" domains from resolv.conf
- *
- *                              Some systems will return a security
- *                              signature along with query answer for
- *                              dynamic DNS entries.
- *                              -- skip/ignore this answer
- *
- *                              Include arpa/nameser.h for defines.
- *
- *                              General cleanup
- *
  * 20-Jun-2001 Michal Moskal 
  *   partial IPv6 support (i.e. gethostbyname2() and resolve_address2()
  *   functions added), IPv6 nameservers are also supported.
@@ -132,16 +122,174 @@
  * 7-Sep-2004 Erik Andersen 
  *   Added gethostent_r()
  *
+ * 2008, 2009 Denys Vlasenko 
+ *   Cleanups, fixes, readability, more cleanups and more fixes.
  */
-
 /* Nota bene:
-   The whole resolver code has several (severe) problems:
-   - it doesn't even build without IPv4, i.e. !UCLIBC_HAS_IPV4 but only IPv6
-   - it is way too big
+ * The whole resolver code has several (severe) problems:
+ * - it doesn't even build without IPv4, i.e. !UCLIBC_HAS_IPV4 but only IPv6
+ * - it is way too big
+ *
+ * Both points above are considered bugs, patches/reimplementations welcome.
+ */
+/* RFC 1035
+...
+Whenever an octet represents a numeric quantity, the left most bit
+in the diagram is the high order or most significant bit.
+That is, the bit labeled 0 is the most significant bit.
+...
 
-   Both points above are considered bugs, patches/reimplementations welcome.
-*/
+4.1.1. Header section format
+      0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                      ID                       |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |QR|   OPCODE  |AA|TC|RD|RA| 0  0  0|   RCODE   |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                    QDCOUNT                    |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                    ANCOUNT                    |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                    NSCOUNT                    |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                    ARCOUNT                    |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ID      16 bit random identifier assigned by querying peer.
+        Used to match query/response.
+QR      message is a query (0), or a response (1).
+OPCODE  0   standard query (QUERY)
+        1   inverse query (IQUERY)
+        2   server status request (STATUS)
+AA      Authoritative Answer - this bit is valid in responses.
+        Responding name server is an authority for the domain name
+        in question section. Answer section may have multiple owner names
+        because of aliases.  The AA bit corresponds to the name which matches
+        the query name, or the first owner name in the answer section.
+TC      TrunCation - this message was truncated.
+RD      Recursion Desired - this bit may be set in a query and
+        is copied into the response.  If RD is set, it directs
+        the name server to pursue the query recursively.
+        Recursive query support is optional.
+RA      Recursion Available - this be is set or cleared in a
+        response, and denotes whether recursive query support is
+        available in the name server.
+RCODE   Response code.
+        0   No error condition
+        1   Format error
+        2   Server failure - server was unable to process the query
+            due to a problem with the name server.
+        3   Name Error - meaningful only for responses from
+            an authoritative name server. The referenced domain name
+            does not exist.
+        4   Not Implemented.
+        5   Refused.
+QDCOUNT number of entries in the question section.
+ANCOUNT number of records in the answer section.
+NSCOUNT number of records in the authority records section.
+ARCOUNT number of records in the additional records section.
 
+4.1.2. Question section format
+
+The section contains QDCOUNT (usually 1) entries, each of this format:
+      0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    /                     QNAME                     /
+    /                                               /
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                     QTYPE                     |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                     QCLASS                    |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+QNAME   a domain name represented as a sequence of labels, where
+        each label consists of a length octet followed by that
+        number of octets. The domain name terminates with the
+        zero length octet for the null label of the root. Note
+        that this field may be an odd number of octets; no
+        padding is used.
+QTYPE   a two octet type of the query.
+          1 a host address [REQ_A const]
+          2 an authoritative name server
+          3 a mail destination (Obsolete - use MX)
+          4 a mail forwarder (Obsolete - use MX)
+          5 the canonical name for an alias
+          6 marks the start of a zone of authority
+          7 a mailbox domain name (EXPERIMENTAL)
+          8 a mail group member (EXPERIMENTAL)
+          9 a mail rename domain name (EXPERIMENTAL)
+         10 a null RR (EXPERIMENTAL)
+         11 a well known service description
+         12 a domain name pointer [REQ_PTR const]
+         13 host information
+         14 mailbox or mail list information
+         15 mail exchange
+         16 text strings
+       0x1c IPv6?
+        252 a request for a transfer of an entire zone
+        253 a request for mailbox-related records (MB, MG or MR)
+        254 a request for mail agent RRs (Obsolete - see MX)
+        255 a request for all records
+QCLASS  a two octet code that specifies the class of the query.
+          1 the Internet
+        (others are historic only)
+        255 any class
+
+4.1.3. Resource record format
+
+The answer, authority, and additional sections all share the same format:
+a variable number of resource records, where the number of records
+is specified in the corresponding count field in the header.
+Each resource record has this format:
+      0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    /                                               /
+    /                      NAME                     /
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                      TYPE                     |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                     CLASS                     |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                      TTL                      |
+    |                                               |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |                   RDLENGTH                    |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|
+    /                     RDATA                     /
+    /                                               /
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+NAME    a domain name to which this resource record pertains.
+TYPE    two octets containing one of the RR type codes.  This
+        field specifies the meaning of the data in the RDATA field.
+CLASS   two octets which specify the class of the data in the RDATA field.
+TTL     a 32 bit unsigned integer that specifies the time interval
+        (in seconds) that the record may be cached.
+RDLENGTH a 16 bit integer, length in octets of the RDATA field.
+RDATA   a variable length string of octets that describes the resource.
+        The format of this information varies according to the TYPE
+        and CLASS of the resource record.
+        If the TYPE is A and the CLASS is IN, it's a 4 octet IP address.
+
+4.1.4. Message compression
+
+In order to reduce the size of messages, domain names can be compressed.
+An entire domain name or a list of labels at the end of a domain name
+is replaced with a pointer to a prior occurance of the same name.
+
+The pointer takes the form of a two octet sequence:
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    | 1  1|                OFFSET                   |
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+The first two bits are ones.  This allows a pointer to be distinguished
+from a label, since the label must begin with two zero bits because
+labels are restricted to 63 octets or less.  The OFFSET field specifies
+an offset from the start of the message (i.e., the first octet
+of the ID field in the domain header).
+A zero offset specifies the first byte of the ID field, etc.
+Domain name in a message can be represented as either:
+   - a sequence of labels ending in a zero octet
+   - a pointer
+   - a sequence of labels ending with a pointer
+ */
+
 #define __FORCE_GLIBC
 #include 
 #include 
@@ -210,7 +358,7 @@
 /* Structs */
 struct resolv_header {
 	int id;
-	int qr,opcode,aa,tc,rd,ra,rcode;
+	int qr, opcode, aa, tc, rd, ra, rcode;
 	int qdcount;
 	int ancount;
 	int nscount;
@@ -218,18 +366,18 @@
 };
 
 struct resolv_question {
-	char * dotted;
+	char *dotted;
 	int qtype;
 	int qclass;
 };
 
 struct resolv_answer {
-	char * dotted;
+	char *dotted;
 	int atype;
 	int aclass;
 	int ttl;
 	int rdlength;
-	const unsigned char * rdata;
+	const unsigned char *rdata;
 	int rdoffset;
 	char* buf;
 	size_t buflen;
@@ -272,42 +420,54 @@
 
 
 /* function prototypes */
-extern int __get_hosts_byname_r(const char * name, int type,
-			struct hostent * result_buf,
-			char * buf, size_t buflen,
-			struct hostent ** result,
-			int * h_errnop) attribute_hidden;
-extern int __get_hosts_byaddr_r(const char * addr, int len, int type,
-			struct hostent * result_buf,
-			char * buf, size_t buflen,
-			struct hostent ** result,
-			int * h_errnop) attribute_hidden;
-extern FILE * __open_etc_hosts(void) attribute_hidden;
-extern int __read_etc_hosts_r(FILE *fp, const char * name, int type,
-			enum etc_hosts_action action,
-			struct hostent * result_buf,
-			char * buf, size_t buflen,
-			struct hostent ** result,
-			int * h_errnop) attribute_hidden;
-extern int __dns_lookup(const char * name, int type,
-			unsigned char ** outpacket,
-			struct resolv_answer * a) attribute_hidden;
-
-extern int __encode_dotted(const char * dotted, unsigned char * dest, int maxlen) attribute_hidden;
-extern int __decode_dotted(const unsigned char * const message, int offset,
-			char * dest, int maxlen) attribute_hidden;
-extern int __length_dotted(const unsigned char * const message, int offset) attribute_hidden;
-extern int __encode_header(struct resolv_header * h, unsigned char * dest, int maxlen) attribute_hidden;
-extern void __decode_header(unsigned char * data, struct resolv_header * h) attribute_hidden;
-extern int __encode_question(const struct resolv_question * const q,
-			unsigned char * dest, int maxlen) attribute_hidden;
-extern int __decode_question(const unsigned char * const message, int offset,
-			struct resolv_question * q) attribute_hidden;
-extern int __encode_answer(struct resolv_answer * a,
-			unsigned char * dest, int maxlen) attribute_hidden;
-extern int __decode_answer(const unsigned char * message, int offset,
-			int len, struct resolv_answer * a) attribute_hidden;
-extern int __length_question(const unsigned char * const message, int offset) attribute_hidden;
+extern int __get_hosts_byname_r(const char *name,
+		int type,
+		struct hostent *result_buf,
+		char *buf,
+		size_t buflen,
+		struct hostent **result,
+		int *h_errnop) attribute_hidden;
+extern int __get_hosts_byaddr_r(const char *addr,
+		int len,
+		int type,
+		struct hostent *result_buf,
+		char *buf,
+		size_t buflen,
+		struct hostent **result,
+		int *h_errnop) attribute_hidden;
+extern FILE *__open_etc_hosts(void) attribute_hidden;
+extern int __read_etc_hosts_r(FILE *fp,
+		const char *name,
+		int type,
+		enum etc_hosts_action action,
+		struct hostent *result_buf,
+		char *buf,
+		size_t buflen,
+		struct hostent **result,
+		int *h_errnop) attribute_hidden;
+extern int __dns_lookup(const char *name,
+		int type,
+		unsigned char **outpacket,
+		struct resolv_answer *a) attribute_hidden;
+extern int __encode_dotted(const char *dotted,
+		unsigned char *dest,
+		int maxlen) attribute_hidden;
+extern int __decode_dotted(const unsigned char *packet,
+		int offset,
+		int packet_len,
+		char *dest,
+		int dest_len) attribute_hidden;
+extern int __encode_header(struct resolv_header *h,
+		unsigned char *dest,
+		int maxlen) attribute_hidden;
+extern void __decode_header(unsigned char *data,
+		struct resolv_header *h) attribute_hidden;
+extern int __encode_question(const struct resolv_question *q,
+		unsigned char *dest,
+		int maxlen) attribute_hidden;
+extern int __encode_answer(struct resolv_answer *a,
+		unsigned char *dest,
+		int maxlen) attribute_hidden;
 extern void __open_nameservers(void) attribute_hidden;
 extern void __close_nameservers(void) attribute_hidden;
 
@@ -427,7 +587,8 @@
 
 #ifdef L_decodeh
 
-void attribute_hidden __decode_header(unsigned char *data, struct resolv_header *h)
+void attribute_hidden __decode_header(unsigned char *data,
+		struct resolv_header *h)
 {
 	h->id = (data[0] << 8) | data[1];
 	h->qr = (data[2] & 0x80) ? 1 : 0;
@@ -488,39 +649,53 @@
 
 /* Decode a dotted string from nameserver transport-level encoding.
    This routine understands compressed data. */
-int attribute_hidden __decode_dotted(const unsigned char * const data, int offset,
-				  char *dest, int maxlen)
+int attribute_hidden __decode_dotted(const unsigned char *packet,
+		int offset,
+		int packet_len,
+		char *dest,
+		int dest_len)
 {
-	int l;
+	unsigned b;
 	bool measure = 1;
 	unsigned total = 0;
 	unsigned used = 0;
 
-	if (!data)
+	if (!packet)
 		return -1;
 
-	while ((l = data[offset++])) {
+	while (1) {
+		if (offset >= packet_len)
+			return -1;
+		b = packet[offset++];
+		if (b == 0)
+			break;
+
 		if (measure)
 			total++;
-		if ((l & 0xc0) == (0xc0)) {
+
+		if ((b & 0xc0) == 0xc0) {
+			if (offset >= packet_len)
+				return -1;
 			if (measure)
 				total++;
 			/* compressed item, redirect */
-			offset = ((l & 0x3f) << 8) | data[offset];
+			offset = ((b & 0x3f) << 8) | packet[offset];
 			measure = 0;
 			continue;
 		}
 
-		if ((used + l + 1) >= maxlen)
+		if (used + b + 1 >= dest_len)
 			return -1;
+		if (offset + b + 1 >= packet_len)
+			return -1;
+		memcpy(dest + used, packet + offset, b);
+		offset += b;
+		used += b;
 
-		memcpy(dest + used, data + offset, l);
-		offset += l;
-		used += l;
 		if (measure)
-			total += l;
+			total += b;
 
-		if (data[offset] != 0)
+		if (packet[offset] != 0)
 			dest[used++] = '.';
 		else
 			dest[used++] = '\0';
@@ -537,35 +712,11 @@
 #endif
 
 
-#ifdef L_lengthd
-
-/* Returns -1 only if data == NULL */
-int attribute_hidden __length_dotted(const unsigned char * const data, int offset)
-{
-	int orig_offset = offset;
-	int l;
-
-	if (!data)
-		return -1;
-
-	while ((l = data[offset++])) {
-		if ((l & 0xc0) == (0xc0)) {
-			offset++;
-			break;
-		}
-
-		offset += l;
-	}
-
-	return offset - orig_offset;
-}
-#endif
-
-
 #ifdef L_encodeq
 
-int attribute_hidden __encode_question(const struct resolv_question * const q,
-					unsigned char *dest, int maxlen)
+int attribute_hidden __encode_question(const struct resolv_question *q,
+		unsigned char *dest,
+		int maxlen)
 {
 	int i;
 
@@ -589,47 +740,6 @@
 #endif
 
 
-#ifdef L_decodeq
-
-int attribute_hidden __decode_question(const unsigned char * const message, int offset,
-					struct resolv_question *q)
-{
-	char temp[256];
-	int i;
-
-	i = __decode_dotted(message, offset, temp, sizeof(temp));
-	if (i < 0)
-		return i;
-
-	offset += i;
-
-/*TODO: what if strdup fails? */
-	q->dotted = strdup(temp);
-	q->qtype = (message[offset + 0] << 8) | message[offset + 1];
-	q->qclass = (message[offset + 2] << 8) | message[offset + 3];
-
-	return i + 4;
-}
-#endif
-
-
-#ifdef L_lengthq
-
-/* Returns -1 only if message == NULL */
-int attribute_hidden __length_question(const unsigned char * const message, int offset)
-{
-	int i;
-
-	/* returns -1 only if message == NULL */
-	i = __length_dotted(message, offset);
-	if (i < 0)
-		return i;
-
-	return i + 4;
-}
-#endif
-
-
 #ifdef L_encodea
 
 int attribute_hidden __encode_answer(struct resolv_answer *a, unsigned char *dest, int maxlen)
@@ -663,64 +773,21 @@
 #endif
 
 
-#ifdef L_decodea
-
-int attribute_hidden __decode_answer(const unsigned char *message, int offset,
-				  int len, struct resolv_answer *a)
-{
-	char temp[256];
-	int i;
-
-	DPRINTF("decode_answer(start): off %d, len %d\n", offset, len);
-	i = __decode_dotted(message, offset, temp, sizeof(temp));
-	if (i < 0)
-		return i;
-
-	message += offset + i;
-	len -= i + RRFIXEDSZ + offset;
-	if (len < 0) {
-		DPRINTF("decode_answer: off %d, len %d, i %d\n", offset, len, i);
-		return len;
-	}
-
-/* TODO: what if strdup fails? */
-	a->dotted = strdup(temp);
-	a->atype = (message[0] << 8) | message[1];
-	message += 2;
-	a->aclass = (message[0] << 8) | message[1];
-	message += 2;
-	a->ttl = (message[0] << 24) |
-		(message[1] << 16) | (message[2] << 8) | (message[3] << 0);
-	message += 4;
-	a->rdlength = (message[0] << 8) | message[1];
-	message += 2;
-	a->rdata = message;
-	a->rdoffset = offset + i + RRFIXEDSZ;
-
-	DPRINTF("i=%d,rdlength=%d\n", i, a->rdlength);
-
-	if (len < a->rdlength)
-		return -1;
-	return i + RRFIXEDSZ + a->rdlength;
-}
-#endif
-
-
 #ifdef CURRENTLY_UNUSED
 #ifdef L_encodep
 
 int __encode_packet(struct resolv_header *h,
-	struct resolv_question **q,
-	struct resolv_answer **an,
-	struct resolv_answer **ns,
-	struct resolv_answer **ar,
-	unsigned char *dest, int maxlen) attribute_hidden;
+		struct resolv_question **q,
+		struct resolv_answer **an,
+		struct resolv_answer **ns,
+		struct resolv_answer **ar,
+		unsigned char *dest, int maxlen) attribute_hidden;
 int __encode_packet(struct resolv_header *h,
-	struct resolv_question **q,
-	struct resolv_answer **an,
-	struct resolv_answer **ns,
-	struct resolv_answer **ar,
-	unsigned char *dest, int maxlen)
+		struct resolv_question **q,
+		struct resolv_answer **an,
+		struct resolv_answer **ns,
+		struct resolv_answer **ar,
+		unsigned char *dest, int maxlen)
 {
 	int i, total = 0;
 	unsigned j;
@@ -785,9 +852,16 @@
 
 #ifdef L_formquery
 
-int __form_query(int id, const char *name, int type, unsigned char *packet, int maxlen);
-int __form_query(int id, const char *name, int type, unsigned char *packet,
-				 int maxlen)
+int __form_query(int id,
+		const char *name,
+		int type,
+		unsigned char *packet,
+		int maxlen);
+int __form_query(int id,
+		const char *name,
+		int type,
+		unsigned char *packet,
+		int maxlen)
 {
 	struct resolv_header h;
 	struct resolv_question q;
@@ -1034,12 +1108,87 @@
 
 #ifdef L_dnslookup
 
+/* Helpers */
+static int __length_question(const unsigned char *data, int maxlen)
+{
+	const unsigned char *start;
+	unsigned b;
+
+	if (!data)
+		return -1;
+
+	start = data;
+	while (1) {
+		if (maxlen <= 0)
+			return -1;
+		b = *data++;
+		if (b == 0)
+			break;
+		if ((b & 0xc0) == 0xc0) {
+			/* It's a "compressed" name. */
+			data++; /* skip lsb of redirected offset */
+			maxlen -= 2;
+			break;
+		}
+		data += b;
+		maxlen -= (b + 1); /* account for data++ above */
+	}
+	/* Up to here we were skipping encoded name */
+
+	/* Account for QTYPE and QCLASS fields */
+	if (maxlen < 4)
+		return -1;
+	return data - start + 2 + 2;
+}
+
+static int __decode_answer(const unsigned char *message, /* packet */
+		int offset,
+		int len, /* total packet len */
+		struct resolv_answer *a)
+{
+	char temp[256];
+	int i;
+
+	DPRINTF("decode_answer(start): off %d, len %d\n", offset, len);
+	i = __decode_dotted(message, offset, len, temp, sizeof(temp));
+	if (i < 0)
+		return i;
+
+	message += offset + i;
+	len -= i + RRFIXEDSZ + offset;
+	if (len < 0) {
+		DPRINTF("decode_answer: off %d, len %d, i %d\n", offset, len, i);
+		return len;
+	}
+
+/* TODO: what if strdup fails? */
+	a->dotted = strdup(temp);
+	a->atype = (message[0] << 8) | message[1];
+	message += 2;
+	a->aclass = (message[0] << 8) | message[1];
+	message += 2;
+	a->ttl = (message[0] << 24) |
+		(message[1] << 16) | (message[2] << 8) | (message[3] << 0);
+	message += 4;
+	a->rdlength = (message[0] << 8) | message[1];
+	message += 2;
+	a->rdata = message;
+	a->rdoffset = offset + i + RRFIXEDSZ;
+
+	DPRINTF("i=%d,rdlength=%d\n", i, a->rdlength);
+
+	if (len < a->rdlength)
+		return -1;
+	return i + RRFIXEDSZ + a->rdlength;
+}
+
 /* On entry:
  *  a.buf(len) = auxiliary buffer for IP addresses after first one
  *  a.add_count = how many additional addresses are there already
  *  outpacket = where to save ptr to raw packet? can be NULL
  * On exit:
  *  ret < 0: error, all other data is not valid
+ *  ret >= 0: length of reply packet
  *  a.add_count & a.buf: updated
  *  a.rdlength: length of addresses (4 bytes for IPv4)
  *  *outpacket: updated (packet is malloced, you need to free it)
@@ -1050,15 +1199,17 @@
  *      appended. (why the filed is called "dotted" I have no idea)
  *      This is a malloced string. May be NULL because strdup failed.
  */
-int attribute_hidden __dns_lookup(const char *name, int type,
-			unsigned char **outpacket,
-			struct resolv_answer *a)
+int attribute_hidden __dns_lookup(const char *name,
+		int type,
+		unsigned char **outpacket,
+		struct resolv_answer *a)
 {
 	/* Protected by __resolv_lock: */
 	static int last_ns_num = 0;
 	static uint16_t last_id = 1;
 
-	int i, j, len, fd, pos, rc;
+	int i, j, fd, rc;
+	int packet_len;
 	int name_len;
 #ifdef USE_SELECT
 	struct timeval tv;
@@ -1095,6 +1246,7 @@
 	DPRINTF("Looking up type %d answer for '%s'\n", type, name);
 	retries_left = 0; /* for compiler */
 	do {
+		int pos;
 		unsigned reply_timeout;
 
 		if (fd != -1) {
@@ -1166,7 +1318,7 @@
 		j = __encode_question(&q, packet+i, PACKETSZ-i);
 		if (j < 0)
 			goto fail;
-		len = i + j;
+		packet_len = i + j;
 
 		/* send packet */
 		DPRINTF("On try %d, sending query to port %d\n",
@@ -1184,9 +1336,9 @@
 			/* retry */
 			/*continue; */
 		}
-		DPRINTF("Xmit packet len:%d id:%d qr:%d\n", len, h.id, h.qr);
+		DPRINTF("Xmit packet len:%d id:%d qr:%d\n", packet_len, h.id, h.qr);
 		/* no error check - if it fails, we time out on recv */
-		send(fd, packet, len, 0);
+		send(fd, packet, packet_len, 0);
 
 #ifdef USE_SELECT
 /*TODO: use _res.retrans*/
@@ -1217,8 +1369,28 @@
 /*TODO: better timeout accounting?*/
 		reply_timeout -= 1000;
 #endif
-		len = recv(fd, packet, PACKETSZ, MSG_DONTWAIT);
-		if (len < HFIXEDSZ) {
+
+/* vda: a bogus response seen in real world (caused SEGV in uclibc):
+ * "ping www.google.com" sending AAAA query and getting
+ * response with one answer... with answer part missing!
+ * Fixed by thorough checks for not going past the packet's end.
+ */
+#ifdef DEBUG
+		{
+			static const char test_query[32] = "\0\2\1\0\0\1\0\0\0\0\0\0\3www\6google\3com\0\0\34\0\1";
+			static const char test_respn[32] = "\0\2\201\200\0\1\0\1\0\0\0\0\3www\6google\3com\0\0\34\0\1";
+			pos = memcmp(packet + 2, test_query + 2, 30);
+		packet_len = recv(fd, packet, PACKETSZ, MSG_DONTWAIT);
+			if (pos == 0) {
+				packet_len = 32;
+				memcpy(packet + 2, test_respn + 2, 30);
+			}
+		}
+#else
+		packet_len = recv(fd, packet, PACKETSZ, MSG_DONTWAIT);
+#endif
+
+		if (packet_len < HFIXEDSZ) {
 			/* too short!
 			 * it's just a bogus packet from somewhere */
  bogus_packet:
@@ -1227,7 +1399,7 @@
 			goto try_next_server;
 		}
 		__decode_header(packet, &h);
-		DPRINTF("id = %d, qr = %d\n", h.id, h.qr);
+		DPRINTF("len:%d id:%d qr:%d\n", packet_len, h.id, h.qr);
 		if (h.id != local_id || !h.qr) {
 			/* unsolicited */
 			goto bogus_packet;
@@ -1266,22 +1438,26 @@
 
 		/* Code below won't work correctly with h.ancount == 0, so... */
 		if (h.ancount <= 0) {
-			h_errno = NO_DATA; /* is this correct code? */
+			h_errno = NO_DATA; /* [is this correct code to check for?] */
 			goto fail1;
 		}
 		pos = HFIXEDSZ;
 		for (j = 0; j < h.qdcount; j++) {
 			DPRINTF("Skipping question %d at %d\n", j, pos);
-			/* returns -1 only if packet == NULL (can't happen) */
-			i = __length_question(packet, pos);
+			i = __length_question(packet + pos, packet_len - pos);
+			if (i < 0) {
+				DPRINTF("Packet'question section "
+					"is truncated, trying next server\n");
+				goto try_next_server;
+			}
+			pos += i;
 			DPRINTF("Length of question %d is %d\n", j, i);
-			pos += i;
 		}
 		DPRINTF("Decoding answer at pos %d\n", pos);
 
 		first_answer = 1;
-		for (j = 0; j < h.ancount && pos < len; j++) {
-			i = __decode_answer(packet, pos, len, &ma);
+		for (j = 0; j < h.ancount; j++) {
+			i = __decode_answer(packet, pos, packet_len, &ma);
 			if (i < 0) {
 				DPRINTF("failed decode %d\n", i);
 				/* If the message was truncated but we have
@@ -1333,7 +1509,7 @@
 		else
 			free(packet);
 		free(lookup);
-		return len;
+		return packet_len;
 
  try_next_server:
 		/* Try next nameserver */
@@ -1366,13 +1542,13 @@
 
 int attribute_hidden __read_etc_hosts_r(
 		FILE * fp,
-		const char * name,
+		const char *name,
 		int type,
 		enum etc_hosts_action action,
-		struct hostent * result_buf,
-		char * buf, size_t buflen,
-		struct hostent ** result,
-		int * h_errnop)
+		struct hostent *result_buf,
+		char *buf, size_t buflen,
+		struct hostent **result,
+		int *h_errnop)
 {
 	struct in_addr **addr_list = NULL;
 	struct in_addr *in = NULL;
@@ -1509,11 +1685,13 @@
 
 #ifdef L_get_hosts_byname_r
 
-int attribute_hidden __get_hosts_byname_r(const char * name, int type,
-			    struct hostent * result_buf,
-			    char * buf, size_t buflen,
-			    struct hostent ** result,
-			    int * h_errnop)
+int attribute_hidden __get_hosts_byname_r(const char *name,
+		int type,
+		struct hostent *result_buf,
+		char *buf,
+		size_t buflen,
+		struct hostent **result,
+		int *h_errnop)
 {
 	return __read_etc_hosts_r(NULL, name, type, GET_HOSTS_BYNAME,
 	                          result_buf, buf, buflen, result, h_errnop);
@@ -1523,11 +1701,14 @@
 
 #ifdef L_get_hosts_byaddr_r
 
-int attribute_hidden __get_hosts_byaddr_r(const char * addr, int len, int type,
-			    struct hostent * result_buf,
-			    char * buf, size_t buflen,
-			    struct hostent ** result,
-			    int * h_errnop)
+int attribute_hidden __get_hosts_byaddr_r(const char *addr,
+		int len,
+		int type,
+		struct hostent *result_buf,
+		char *buf,
+		size_t buflen,
+		struct hostent **result,
+		int *h_errnop)
 {
 #ifndef __UCLIBC_HAS_IPV6__
 	char	ipaddr[INET_ADDRSTRLEN];
@@ -1562,9 +1743,13 @@
 
 #ifdef L_getnameinfo
 
-int getnameinfo(const struct sockaddr *sa, socklen_t addrlen, char *host,
-				 socklen_t hostlen, char *serv, socklen_t servlen,
-				 unsigned int flags)
+int getnameinfo(const struct sockaddr *sa,
+		socklen_t addrlen,
+		char *host,
+		socklen_t hostlen,
+		char *serv,
+		socklen_t servlen,
+		unsigned flags)
 {
 	int serrno = errno;
 	unsigned ok;
@@ -1786,12 +1971,12 @@
  *
  * When examples were run, /etc/resolv.conf contained "search com" line.
  */
-int gethostbyname_r(const char * name,
-		struct hostent * result_buf,
-		char * buf,
+int gethostbyname_r(const char *name,
+		struct hostent *result_buf,
+		char *buf,
 		size_t buflen,
-		struct hostent ** result,
-		int * h_errnop)
+		struct hostent **result,
+		int *h_errnop)
 {
 	struct in_addr **addr_list;
 	char **alias;
@@ -1799,6 +1984,7 @@
 	unsigned char *packet;
 	struct resolv_answer a;
 	int i;
+	int packet_len;
 	int wrong_af = 0;
 
 	*result = NULL;
@@ -1898,8 +2084,8 @@
 	 * we'll need space of one in_addr + two addr_list[] elems */
 	a.buflen = buflen - ((sizeof(addr_list[0]) * 2 + sizeof(struct in_addr)));
 	a.add_count = 0;
-	i = __dns_lookup(name, T_A, &packet, &a);
-	if (i < 0) {
+	packet_len = __dns_lookup(name, T_A, &packet, &a);
+	if (packet_len < 0) {
 		*h_errnop = HOST_NOT_FOUND;
 		DPRINTF("__dns_lookup returned < 0\n");
 		return TRY_AGAIN;
@@ -1975,11 +2161,11 @@
 
 int gethostbyname2_r(const char *name,
 		int family,
-		struct hostent * result_buf,
-		char * buf,
+		struct hostent *result_buf,
+		char *buf,
 		size_t buflen,
-		struct hostent ** result,
-		int * h_errnop)
+		struct hostent **result,
+		int *h_errnop)
 {
 #ifndef __UCLIBC_HAS_IPV6__
 	return family == (AF_INET)
@@ -2080,9 +2266,11 @@
 /* TODO: why it's so different from gethostbyname_r (IPv4 case)? */
 	memset(&a, '\0', sizeof(a));
 	for (;;) {
+		int packet_len;
+
 /* Hmm why we memset(a) to zeros only once? */
-		i = __dns_lookup(buf, T_AAAA, &packet, &a);
-		if (i < 0) {
+		packet_len = __dns_lookup(buf, T_AAAA, &packet, &a);
+		if (packet_len < 0) {
 			*h_errnop = HOST_NOT_FOUND;
 			return TRY_AGAIN;
 		}
@@ -2097,7 +2285,7 @@
 			*h_errnop = NO_RECOVERY;
 			return -1;
 		}
-		i = __decode_dotted(packet, a.rdoffset, buf, buflen);
+		i = __decode_dotted(packet, a.rdoffset, packet_len, buf, buflen);
 		free(packet);
 		if (i < 0) {
 			*h_errnop = NO_RECOVERY;
@@ -2128,11 +2316,12 @@
 
 #ifdef L_gethostbyaddr_r
 
-int gethostbyaddr_r(const void *addr, socklen_t addrlen, int type,
-					 struct hostent * result_buf,
-					 char * buf, size_t buflen,
-					 struct hostent ** result,
-					 int * h_errnop)
+int gethostbyaddr_r(const void *addr, socklen_t addrlen,
+		int type,
+		struct hostent *result_buf,
+		char *buf, size_t buflen,
+		struct hostent **result,
+		int *h_errnop)
 
 {
 	struct in_addr *in;
@@ -2141,6 +2330,7 @@
 	unsigned char *packet;
 	struct resolv_answer a;
 	int i;
+	int packet_len;
 	int nest = 0;
 
 	*result = NULL;
@@ -2235,8 +2425,8 @@
 	memset(&a, '\0', sizeof(a));
 	for (;;) {
 /* Hmm why we memset(a) to zeros only once? */
-		i = __dns_lookup(buf, T_PTR, &packet, &a);
-		if (i < 0) {
+		packet_len = __dns_lookup(buf, T_PTR, &packet, &a);
+		if (packet_len < 0) {
 			*h_errnop = HOST_NOT_FOUND;
 			return TRY_AGAIN;
 		}
@@ -2252,7 +2442,7 @@
 			return -1;
 		}
 		/* Decode CNAME into buf, feed it to __dns_lookup() again */
-		i = __decode_dotted(packet, a.rdoffset, buf, buflen);
+		i = __decode_dotted(packet, a.rdoffset, packet_len, buf, buflen);
 		free(packet);
 		if (i < 0) {
 			*h_errnop = NO_RECOVERY;
@@ -2261,7 +2451,7 @@
 	}
 
 	if (a.atype == T_PTR) {	/* ADDRESS */
-		i = __decode_dotted(packet, a.rdoffset, buf, buflen);
+		i = __decode_dotted(packet, a.rdoffset, packet_len, buf, buflen);
 		free(packet);
 		result_buf->h_name = buf;
 		result_buf->h_addrtype = type;
@@ -2807,7 +2997,7 @@
               unsigned char *answer, int anslen)
 {
 	int i;
-	unsigned char * packet = NULL;
+	unsigned char *packet = NULL;
 	struct resolv_answer a;
 
 	if (!dname || class != 1 /* CLASS_IN */) {
@@ -2849,7 +3039,8 @@
 int res_search(const char *name, int class, int type, u_char *answer,
 		int anslen)
 {
-	const char *cp, * const *domain;
+	const char *cp;
+	char **domain;
 	HEADER *hp = (HEADER *)(void *)answer;
 	unsigned dots;
 	unsigned state;
@@ -2908,9 +3099,7 @@
 	) {
 		bool done = 0;
 
-		for (domain = (const char * const *)_res_dnsrch;
-			*domain && !done;
-			domain++) {
+		for (domain = _res_dnsrch; *domain && !done; domain++) {
 
 			ret = res_querydomain(name, *domain, class, type,
 								  answer, anslen);
@@ -2998,7 +3187,7 @@
  * removing a trailing dot from name if domain is NULL.
  */
 int res_querydomain(const char *name, const char *domain, int class, int type,
-			u_char * answer, int anslen)
+			u_char *answer, int anslen)
 {
 	char nbuf[MAXDNAME];
 	const char *longname = nbuf;
@@ -3019,7 +3208,7 @@
 	__UCLIBC_MUTEX_UNLOCK(__resolv_lock);
 	if (!(_res_options & RES_INIT)) {
 		res_init(); /* our res_init never fails */
-		goto again:
+		goto again;
 	}
 	if (_res_options & RES_DEBUG)
 		printf(";; res_querydomain(%s, %s, %d, %d)\n",

 ------------------------------------------------------------------------
r26078 | vapier | 2009-04-12 19:06:40 -0500 (Sun, 12 Apr 2009) | 1 line
Changed paths:
   M /trunk/uClibc/libc/unistd/daemon.c

make sure to block all signals when calling daemon() to prevent delivery while the parent is sharing the stack
 ------------------------------------------------------------------------

Index: libc/unistd/daemon.c
===================================================================
--- libc/unistd/daemon.c	(revision 26077)
+++ libc/unistd/daemon.c	(revision 26078)
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
@@ -61,7 +62,7 @@
 /* use clone() to get fork() like behavior here -- we just want to disassociate
  * from the controlling terminal
  */
-static inline pid_t fork_parent(void)
+static inline pid_t _fork_parent(void)
 {
 	register unsigned long ret = INTERNAL_SYSCALL(clone, wtf, 2, CLONE_VM, 0);
 	if (ret != -1 && ret != 0)
@@ -69,6 +70,17 @@
 		INTERNAL_SYSCALL(exit, wtf, 0);
 	return ret;
 }
+static inline pid_t fork_parent(void)
+{
+	/* Block all signals to keep the parent from using the stack */
+	pid_t ret;
+	sigset_t new_set, old_set;
+	sigfillset(&new_set);
+	sigprocmask(SIG_BLOCK, &new_set, &old_set);
+	ret = _fork_parent();
+	sigprocmask(SIG_SETMASK, &old_set, NULL);
+	return ret;
+}
 #else
 static inline pid_t fork_parent(void)
 {

 ------------------------------------------------------------------------
r26066 | austinf | 2009-04-11 14:30:04 -0500 (Sat, 11 Apr 2009) | 5 lines
Changed paths:
   M /trunk/uClibc/ldso/ldso/sparc/dl-sysdep.h

for sparc v8 MAGIC1 was defined incorrectly

Signed-off-by: Austin Foxley 


 ------------------------------------------------------------------------

Index: ldso/ldso/sparc/dl-sysdep.h
===================================================================
--- ldso/ldso/sparc/dl-sysdep.h	(revision 26065)
+++ ldso/ldso/sparc/dl-sysdep.h	(revision 26066)
@@ -29,7 +29,7 @@
 /* Here we define the magic numbers that this dynamic loader should accept
  * Note that SPARCV9 doesn't use EM_SPARCV9 since the userland is still 32-bit.
  */
-#if defined(__sparc_v9__) || defined(__sparc_v8__)
+#if defined(__sparc_v9__)
 #define MAGIC1 EM_SPARC32PLUS
 #else
 #define MAGIC1 EM_SPARC

 ------------------------------------------------------------------------
r26062 | austinf | 2009-04-10 19:08:47 -0500 (Fri, 10 Apr 2009) | 4 lines
Changed paths:
   M /trunk/uClibc/ldso/include/dl-string.h

sparc also needs CONSTANT_STRING_GOT_FIXUP for doing debug printing in ldso

Signed-off-by: Austin Foxley 

 ------------------------------------------------------------------------

Index: ldso/include/dl-string.h
===================================================================
--- ldso/include/dl-string.h	(revision 26061)
+++ ldso/include/dl-string.h	(revision 26062)
@@ -286,7 +286,7 @@
  * This requires that load_addr must already be defined... */
 #if defined(mc68000)  || defined(__arm__) || defined(__thumb__) || \
     defined(__mips__) || defined(__sh__)  || defined(__powerpc__) || \
-    defined(__avr32__) || defined(__xtensa__)
+    defined(__avr32__) || defined(__xtensa__) || defined(__sparc__)
 # define CONSTANT_STRING_GOT_FIXUP(X) \
 	if ((X) < (const char *) load_addr) (X) += load_addr
 # define NO_EARLY_SEND_STDERR

 ------------------------------------------------------------------------
r26046 | aldot | 2009-04-09 12:48:17 -0500 (Thu, 09 Apr 2009) | 2 lines
Changed paths:
   M /trunk/uClibc/Makefile.help

- fix typo

 ------------------------------------------------------------------------

Index: Makefile.help
===================================================================
--- Makefile.help	(revision 26045)
+++ Makefile.help	(revision 26046)
@@ -8,7 +8,7 @@
 help:
 	@echo 'Cleaning:'
 	@echo '  clean			- delete temporary object files'
-	@echo '  realclean		- delete temporary object file, including dependencies'
+	@echo '  realclean		- delete temporary object files, including dependencies'
 	@echo '  distclean		- delete all non-source files (including .config)'
 	@echo
 	@echo 'Build:'

 ------------------------------------------------------------------------
r26038 | kraj | 2009-04-09 03:45:24 -0500 (Thu, 09 Apr 2009) | 2 lines
Changed paths:
   M /trunk/uClibc/ldso/include/dl-syscall.h

Fix the ifdef logic broken by last commit for !defined (__mcoldfire__)

 ------------------------------------------------------------------------

Index: ldso/include/dl-syscall.h
===================================================================
--- ldso/include/dl-syscall.h	(revision 26037)
+++ ldso/include/dl-syscall.h	(revision 26038)
@@ -152,9 +152,8 @@
 # define __NR__dl_mmap __NR_mmap
 static __always_inline _syscall6(void *, _dl_mmap, void *, start, size_t, length,
                         int, prot, int, flags, int, fd, off_t, offset);
-#if !defined (__mcoldfire__) // Might be a kernel problem. failed on 2.6.25
 /* then try mmap2() */
-#elif defined(__NR_mmap2)
+#elif defined(__NR_mmap2) && !defined (__mcoldfire__)
 
 # define __NR___syscall_mmap2       __NR_mmap2
 static __always_inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, size_t, len,
@@ -176,7 +175,6 @@
 	return __syscall_mmap2(addr, size, prot, flags,
 	                       fd, (off_t) (offset >> MMAP2_PAGE_SHIFT));
 }
-#endif
 /* finally, fall back to mmap(), syscall1() style */
 #elif defined(__NR_mmap)
 

 ------------------------------------------------------------------------
r26033 | kraj | 2009-04-09 02:38:04 -0500 (Thu, 09 Apr 2009) | 13 lines
Changed paths:
   M /trunk/uClibc/ldso/include/dl-syscall.h
   M /trunk/uClibc/ldso/ldso/m68k/dl-startup.h
   M /trunk/uClibc/ldso/ldso/m68k/dl-sysdep.h
   M /trunk/uClibc/libpthread/linuxthreads.old/sysdeps/m68k/pt-machine.h

The attached patches fixes the problems found bringing up uclibc on coldfire 
M5485 processor

1.  Disable mmap2() if we're compiling for coldfire and fall back to mmap().
    It seems to map a different file area on a 2.6.25 linux kernel.

2.  Uses pc-relative addresing[1], computes ADDR_ALIGN, PAGE_ALIGN
    and OFFSET_ALIGN relatively to _dl_pagesize[3]. 
    On coldfire/M5485 _dl_pagesize is 0x2000.

Signed-off-by: Groleo Marius 


 ------------------------------------------------------------------------

Index: ldso/ldso/m68k/dl-startup.h
===================================================================
--- ldso/ldso/m68k/dl-startup.h	(revision 26032)
+++ ldso/ldso/m68k/dl-startup.h	(revision 26033)
@@ -4,6 +4,17 @@
  * Copyright (C) 2005 by Erik Andersen 
  */
 
+/* Perform operation OP with PC-relative SRC as the first operand and
+ * DST as the second.  TMP is available as a temporary if needed.  */
+
+#ifdef __mcoldfire__
+#define PCREL_OP(OP, SRC, DST, TMP, PC) \
+  "move.l #" SRC " - ., " TMP "\n\t" OP " (-8, " PC ", " TMP "), " DST
+#else
+#define PCREL_OP(OP, SRC, DST, TMP, PC) \
+  OP " " SRC "(" PC "), " DST
+#endif
+
 __asm__ ("\
 	.text\n\
 	.globl _start\n\
@@ -21,7 +32,7 @@
 	move.l %d0, %a4\n\
 	# See if we were run as a command with the executable file\n\
 	# name as an extra leading argument.\n\
-	move.l _dl_skip_args(%pc), %d0\n\
+	" PCREL_OP ("move.l", "_dl_skip_args", "%d0", "%d0", "%pc") "\n\
 	# Pop the original argument count\n\
 	move.l (%sp)+, %d1\n\
 	# Subtract _dl_skip_args from it.\n\
@@ -31,7 +42,7 @@
 	# Push back the modified argument count.\n\
 	move.l %d1, -(%sp)\n\
 	# Pass our finalizer function to the user in %a1.\n\
-	lea _dl_fini(%pc), %a1\n\
+	" PCREL_OP ("lea", "_dl_fini", "%a1", "%a1", "%pc") "\n\
 	# Initialize %fp with the stack pointer.\n\
 	move.l %sp, %fp\n\
 	# Jump to the user's entry point.\n\
Index: ldso/ldso/m68k/dl-sysdep.h
===================================================================
--- ldso/ldso/m68k/dl-sysdep.h	(revision 26032)
+++ ldso/ldso/m68k/dl-sysdep.h	(revision 26033)
@@ -42,19 +42,29 @@
 static __always_inline Elf32_Addr
 elf_machine_dynamic (void)
 {
-	register Elf32_Addr *got __asm__ ("%a5");
-	return *got;
+	Elf32_Addr got;
+
+	__asm__ ("move.l _DYNAMIC@GOT.w(%%a5), %0"
+			: "=a" (got));
+	return got;
 }
 
+#ifdef __mcoldfire__
+#define PCREL_OP(OP, SRC, DST, TMP, PC) \
+  "move.l #" SRC " - ., " TMP "\n\t" OP " (-8, " PC ", " TMP "), " DST
+#else
+#define PCREL_OP(OP, SRC, DST, TMP, PC) \
+  OP " " SRC "(" PC "), " DST
+#endif
 
 /* Return the run-time load address of the shared object.  */
 static __always_inline Elf32_Addr
 elf_machine_load_address (void)
 {
 	Elf32_Addr addr;
-	__asm__ ("lea _dl_start(%%pc), %0\n\t"
-	     "sub.l _dl_start@GOT.w(%%a5), %0"
-	     : "=a" (addr));
+	__asm__ (PCREL_OP ("lea", "_dl_start", "%0", "%0", "%%pc") "\n\t"
+			"sub.l _dl_start@GOT.w(%%a5), %0"
+			: "=a" (addr));
 	return addr;
 }
 
Index: ldso/include/dl-syscall.h
===================================================================
--- ldso/include/dl-syscall.h	(revision 26032)
+++ ldso/include/dl-syscall.h	(revision 26033)
@@ -152,7 +152,7 @@
 # define __NR__dl_mmap __NR_mmap
 static __always_inline _syscall6(void *, _dl_mmap, void *, start, size_t, length,
                         int, prot, int, flags, int, fd, off_t, offset);
-
+#if !defined (__mcoldfire__) // Might be a kernel problem. failed on 2.6.25
 /* then try mmap2() */
 #elif defined(__NR_mmap2)
 
@@ -176,7 +176,7 @@
 	return __syscall_mmap2(addr, size, prot, flags,
 	                       fd, (off_t) (offset >> MMAP2_PAGE_SHIFT));
 }
-
+#endif
 /* finally, fall back to mmap(), syscall1() style */
 #elif defined(__NR_mmap)
 
Index: libpthread/linuxthreads.old/sysdeps/m68k/pt-machine.h
===================================================================
--- libpthread/linuxthreads.old/sysdeps/m68k/pt-machine.h	(revision 26032)
+++ libpthread/linuxthreads.old/sysdeps/m68k/pt-machine.h	(revision 26033)
@@ -40,7 +40,7 @@
 #else
          "bset #7,%1; sne %0"
 #endif
-       : "=dm"(ret), "=m"(*spinlock)
+       : "=&dm"(ret), "=m"(*spinlock)
        : "m"(*spinlock)
        : "cc");
 

 ------------------------------------------------------------------------
r26002 | vapier | 2009-04-07 00:52:48 -0500 (Tue, 07 Apr 2009) | 1 line
Changed paths:
   M /trunk/uClibc/include/unistd.h
   M /trunk/uClibc/libc/unistd/Makefile.in
   M /trunk/uClibc/libc/unistd/daemon.c

implement daemon() using clone() on no-mmu systems as suggested by Jamie Lokier
 ------------------------------------------------------------------------

Index: include/unistd.h
===================================================================
--- include/unistd.h	(revision 26001)
+++ include/unistd.h	(revision 26002)
@@ -956,12 +956,10 @@
 extern void setusershell (void) __THROW; /* Rewind and re-read the file.  */
 
 
-#ifdef __ARCH_USE_MMU__
 /* Put the program in the background, and dissociate from the controlling
    terminal.  If NOCHDIR is zero, do `chdir ("/")'.  If NOCLOSE is zero,
    redirects stdin, stdout, and stderr to /dev/null.  */
 extern int daemon (int __nochdir, int __noclose) __THROW __wur;
-#endif
 #endif /* Use BSD || X/Open.  */
 
 
Index: libc/unistd/Makefile.in
===================================================================
--- libc/unistd/Makefile.in	(revision 26001)
+++ libc/unistd/Makefile.in	(revision 26002)
@@ -14,8 +14,6 @@
 
 ifeq ($(ARCH_USE_MMU),y)
 CSRC := $(filter-out __exec_alloc.c,$(CSRC))
-else
-CSRC := $(filter-out daemon.c,$(CSRC))
 endif
 
 ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
Index: libc/unistd/daemon.c
===================================================================
--- libc/unistd/daemon.c	(revision 26001)
+++ libc/unistd/daemon.c	(revision 26002)
@@ -56,27 +56,40 @@
 /* libc_hidden_proto(chdir) */
 /* libc_hidden_proto(fork) */
 
+#ifndef __ARCH_USE_MMU__
+#include 
+/* use clone() to get fork() like behavior here -- we just want to disassociate
+ * from the controlling terminal
+ */
+static inline pid_t fork_parent(void)
+{
+	register unsigned long ret = INTERNAL_SYSCALL(clone, wtf, 2, CLONE_VM, 0);
+	if (ret != -1 && ret != 0)
+		/* parent needs to die now w/out touching stack */
+		INTERNAL_SYSCALL(exit, wtf, 0);
+	return ret;
+}
+#else
+static inline pid_t fork_parent(void)
+{
+	switch (fork()) {
+		case -1: return -1;
+		case 0:  return 0;
+		default: _exit(0);
+	}
+}
+#endif
+
 int daemon( int nochdir, int noclose )
 {
 	int fd;
 
-	switch (fork()) {
-		case -1:
-			return(-1);
-		case 0:
-			break;
-		default:
-			_exit(0);
-	}
+	if (fork_parent() == -1)
+		return -1;
 
 	if (setsid() == -1)
 		return(-1);
 
-	/* Make certain we are not a session leader, or else we
-	 * might reacquire a controlling terminal */
-	if (fork())
-		_exit(0);
-
 	if (!nochdir)
 		chdir("/");
 

 ------------------------------------------------------------------------
r25971 | vapier | 2009-04-06 01:40:57 -0500 (Mon, 06 Apr 2009) | 1 line
Changed paths:
   M /trunk/uClibc/extra/scripts/unifdef.c

apply getline() fix from linux kernel
 ------------------------------------------------------------------------

Index: extra/scripts/unifdef.c
===================================================================
--- extra/scripts/unifdef.c	(revision 25970)
+++ extra/scripts/unifdef.c	(revision 25971)
@@ -206,7 +206,7 @@
 static void             error(const char *);
 static int              findsym(const char *);
 static void             flushline(bool);
-static Linetype         getline(void);
+static Linetype         get_line(void);
 static Linetype         ifeval(const char **);
 static void             ignoreoff(void);
 static void             ignoreon(void);
@@ -517,7 +517,7 @@
 
 	for (;;) {
 		linenum++;
-		lineval = getline();
+		lineval = get_line();
 		trans_table[ifstate[depth]][lineval]();
 		debug("process %s -> %s depth %d",
 		    linetype_name[lineval],
@@ -531,7 +531,7 @@
  * help from skipcomment().
  */
 static Linetype
-getline(void)
+get_line(void)
 {
 	const char *cp;
 	int cursym;
@@ -889,9 +889,8 @@
 				cp += 1;
 			} else if (strchr(" \t", *cp) != NULL) {
 				cp += 1;
-			} else {
+			} else
 				return (cp);
-			}
 			continue;
 		case CXX_COMMENT:
 			if (strncmp(cp, "\n", 1) == 0) {

 ------------------------------------------------------------------------
r25836 | landley | 2009-03-26 23:03:20 -0500 (Thu, 26 Mar 2009) | 3 lines
Changed paths:
   M /trunk/uClibc/libc/sysdeps/linux/sparc/bits/kernel_types.h

32/64 bit sparc got unified in 2.6.29 the way x86/x86_64 did in 2.6.28.
The new guard symbol is "__SPARC_POSIX_TYPES_H".

 ------------------------------------------------------------------------

Index: libc/sysdeps/linux/sparc/bits/kernel_types.h
===================================================================
--- libc/sysdeps/linux/sparc/bits/kernel_types.h	(revision 25835)
+++ libc/sysdeps/linux/sparc/bits/kernel_types.h	(revision 25836)
@@ -4,9 +4,10 @@
  * our private content, and not the kernel header, will win.
  *  -Erik
  */
-#if ! defined __ARCH_SPARC_POSIX_TYPES_H && ! defined __ARCH_SPARC64_POSIX_TYPES_H
+#if ! defined __ARCH_SPARC_POSIX_TYPES_H && ! defined __ARCH_SPARC64_POSIX_TYPES_H && !defined __SPARC_POSIX_TYPES_H
 #define __ARCH_SPARC_POSIX_TYPES_H
 #define __ARCH_SPARC64_POSIX_TYPES_H
+#define __SPARC_POSIX_TYPES_H
 
 # if __WORDSIZE == 64
 typedef unsigned long          __kernel_size_t;

 ------------------------------------------------------------------------
r25824 | aldot | 2009-03-26 03:51:47 -0500 (Thu, 26 Mar 2009) | 2 lines
Changed paths:
   M /trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux

- ignore objects

 ------------------------------------------------------------------------


Property changes on: libpthread/linuxthreads/sysdeps/unix/sysv/linux
___________________________________________________________________
Name: svn:ignore
   - Implies
Versions

   + Implies
Versions
*.oS



 ------------------------------------------------------------------------
r25823 | aldot | 2009-03-25 15:28:19 -0500 (Wed, 25 Mar 2009) | 8 lines
Changed paths:
   M /trunk/uClibc/include/stdlib.h
   M /trunk/uClibc/libc/stdlib/stdlib.c

- Add strtouq alias (to strtoul) for 64bit

The strtouq alias was only available on 32bit, breaking compilation of stuff
using strtouq on 64bit machines. At the same time use the correct return
type (u_quad_t).

Signed-of-by: Peter Korsgaard 

 ------------------------------------------------------------------------

Index: include/stdlib.h
===================================================================
--- include/stdlib.h	(revision 25822)
+++ include/stdlib.h	(revision 25823)
@@ -209,6 +209,8 @@
 __END_NAMESPACE_STD
 
 #ifdef __USE_BSD
+#include  /* for u_quad_t */
+
 /* Convert a string to a quadword integer.  */
 __extension__
 extern long long int strtoq (__const char *__restrict __nptr,
@@ -216,7 +218,7 @@
      __THROW __nonnull ((1)) __wur;
 /* Convert a string to an unsigned quadword integer.  */
 __extension__
-extern unsigned long long int strtouq (__const char *__restrict __nptr,
+extern u_quad_t strtouq (__const char *__restrict __nptr,
 				       char **__restrict __endptr, int __base)
      __THROW __nonnull ((1)) __wur;
 #endif /* GCC and use BSD.  */
Index: libc/stdlib/stdlib.c
===================================================================
--- libc/stdlib/stdlib.c	(revision 25822)
+++ libc/stdlib/stdlib.c	(revision 25823)
@@ -401,7 +401,10 @@
 libc_hidden_proto(__XL_NPP(strtoull))
 strong_alias(__XL_NPP(strtoul),__XL_NPP(strtoull))
 libc_hidden_def(__XL_NPP(strtoull))
+#if !defined(L_strtoul_l)
+strong_alias(strtoul,strtouq)
 #endif
+#endif
 
 
 #endif

 ------------------------------------------------------------------------
r25821 | aldot | 2009-03-25 14:27:56 -0500 (Wed, 25 Mar 2009) | 2 lines
Changed paths:
   M /trunk/uClibc/Rules.mak

- do not pass -Wl with -shared in LDFLAGS_NOSTRIP (Peter S. Mazinger)

 ------------------------------------------------------------------------

Index: Rules.mak
===================================================================
--- Rules.mak	(revision 25820)
+++ Rules.mak	(revision 25821)
@@ -444,7 +444,7 @@
 	# -shared by itself would get us global function descriptors
 	# and calls through PLTs, dynamic resolution of symbols, etc,
 	# which would break as well, but -Bsymbolic comes to the rescue.
-	export LDPIEFLAG:=-Wl,-shared -Wl,-Bsymbolic
+	export LDPIEFLAG:=-shared -Wl,-Bsymbolic
 	UCLIBC_LDSO=ld.so.1
 endif
 
@@ -550,7 +550,7 @@
 CFLAGS += -DSTATIC
 endif
 
-LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -Wl,-shared \
+LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared \
 	-Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc
 # binutils-2.16.1 warns about ignored sections, 2.16.91.0.3 and newer are ok
 #LDFLAGS_NOSTRIP+=$(call check_ld,--gc-sections)

 ------------------------------------------------------------------------
r25744 | austinf | 2009-03-18 18:05:54 -0500 (Wed, 18 Mar 2009) | 3 lines
Changed paths:
   M /trunk/uClibc/MAINTAINERS
   M /trunk/uClibc/libpthread/linuxthreads/libc-cancellation.c
   M /trunk/uClibc/libpthread/linuxthreads/libc_pthread_init.c
   M /trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h
   M /trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
   A /trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h

fix compilation of linuxthreads for sparc
add myself to MAINTAINERS for sparc

 ------------------------------------------------------------------------

Index: MAINTAINERS
===================================================================
--- MAINTAINERS	(revision 25743)
+++ MAINTAINERS	(revision 25744)
@@ -126,7 +126,9 @@
 
 
 SPARC
-S:	Unmaintained
+P:  Austin Foxley
+E:  austinf@cetoncorp.com
+S:	Maintained
 
 VAX
 P:	Jan-Benedict Glaw
Index: libpthread/linuxthreads/libc_pthread_init.c
===================================================================
--- libpthread/linuxthreads/libc_pthread_init.c	(revision 25743)
+++ libpthread/linuxthreads/libc_pthread_init.c	(revision 25744)
@@ -33,6 +33,10 @@
 /* libc_hidden_proto(uselocale) */
 #endif
 
+int __libc_multiple_threads attribute_hidden __attribute__((nocommon));
+strong_alias (__libc_multiple_threads, __librt_multiple_threads)
+
+
 int *
 __libc_pthread_init (functions)
      const struct pthread_functions *functions;
Index: libpthread/linuxthreads/libc-cancellation.c
===================================================================
--- libpthread/linuxthreads/libc-cancellation.c	(revision 25743)
+++ libpthread/linuxthreads/libc-cancellation.c	(revision 25744)
@@ -31,9 +31,6 @@
 weak_extern (__pthread_do_exit)
 # endif
 
-int __libc_multiple_threads attribute_hidden __attribute__((nocommon));
-strong_alias (__libc_multiple_threads, __librt_multiple_threads)
-
 /* The next two functions are similar to pthread_setcanceltype() but
    more specialized for the use in the cancelable functions like write().
    They do not need to check parameters etc.  */
Index: libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
===================================================================
--- libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h	(revision 0)
+++ libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h	(revision 25744)
@@ -0,0 +1,10 @@
+#ifndef SPARC_SYSDEP_CANCEL_H
+#define SPARC_SYSDEP_CANCEL_H
+
+#if defined(__arch64__)
+#include 
+#else
+#include 
+#endif
+
+#endif
Index: libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h
===================================================================
--- libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h	(revision 25743)
+++ libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h	(revision 25744)
@@ -19,16 +19,5 @@
 
 #include 
 
-#define ARCH_FORK() \
-({									\
-  register long __o0 __asm__ ("o0");					\
-  register long __o1 __asm__ ("o1");					\
-  register long __g1 __asm__ ("g1") = __NR_fork;			\
-  __asm__ __volatile__ (__SYSCALL_STRING					\
-		    : "=r" (__g1), "=r" (__o0), "=r" (__o1)		\
-		    : "0" (__g1)					\
-		    : __SYSCALL_CLOBBERS);				\
-  __o0 == -1 ? __o0 : (__o0 & (__o1 - 1));				\
-})
-
 #include_next 
+
Index: libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
===================================================================
--- libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h	(revision 25743)
+++ libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h	(revision 25744)
@@ -17,7 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include 
 #include 
 #ifndef __ASSEMBLER__
 # include 

 ------------------------------------------------------------------------
r25674 | carmelo | 2009-03-16 08:36:39 -0500 (Mon, 16 Mar 2009) | 10 lines
Changed paths:
   M /trunk/uClibc/test/Makefile
   M /trunk/uClibc/test/README
   M /trunk/uClibc/test/Test.mak
   M /trunk/uClibc/test/args/Makefile
   A /trunk/uClibc/test/args/Makefile.in
   M /trunk/uClibc/test/assert/Makefile
   A /trunk/uClibc/test/assert/Makefile.in
   M /trunk/uClibc/test/build/Makefile
   M /trunk/uClibc/test/crypt/Makefile
   A /trunk/uClibc/test/crypt/Makefile.in
   M /trunk/uClibc/test/ctype/Makefile
   A /trunk/uClibc/test/ctype/Makefile.in
   M /trunk/uClibc/test/dlopen/Makefile
   A /trunk/uClibc/test/dlopen/Makefile.in
   M /trunk/uClibc/test/inet/Makefile
   M /trunk/uClibc/test/locale/Makefile
   A /trunk/uClibc/test/locale/Makefile.in
   M /trunk/uClibc/test/locale-mbwc/Makefile
   A /trunk/uClibc/test/locale-mbwc/Makefile.in
   M /trunk/uClibc/test/malloc/Makefile
   A /trunk/uClibc/test/malloc/Makefile.in
   M /trunk/uClibc/test/math/Makefile
   A /trunk/uClibc/test/math/Makefile.in
   M /trunk/uClibc/test/misc/Makefile
   A /trunk/uClibc/test/misc/Makefile.in
   M /trunk/uClibc/test/mmap/Makefile
   M /trunk/uClibc/test/pthread/Makefile
   A /trunk/uClibc/test/pthread/Makefile.in
   M /trunk/uClibc/test/pwd_grp/Makefile
   A /trunk/uClibc/test/pwd_grp/Makefile.in
   M /trunk/uClibc/test/regex/Makefile
   M /trunk/uClibc/test/rpc/Makefile
   A /trunk/uClibc/test/rpc/Makefile.in
   M /trunk/uClibc/test/setjmp/Makefile
   M /trunk/uClibc/test/signal/Makefile
   A /trunk/uClibc/test/signal/Makefile.in
   M /trunk/uClibc/test/silly/Makefile
   A /trunk/uClibc/test/silly/Makefile.in
   M /trunk/uClibc/test/stat/Makefile
   A /trunk/uClibc/test/stat/Makefile.in
   M /trunk/uClibc/test/stdio/Makefile
   A /trunk/uClibc/test/stdio/Makefile.in
   M /trunk/uClibc/test/stdlib/Makefile
   A /trunk/uClibc/test/stdlib/Makefile.in
   M /trunk/uClibc/test/string/Makefile
   A /trunk/uClibc/test/string/Makefile.in
   M /trunk/uClibc/test/termios/Makefile
   M /trunk/uClibc/test/time/Makefile
   A /trunk/uClibc/test/time/Makefile.in
   M /trunk/uClibc/test/unistd/Makefile
   A /trunk/uClibc/test/unistd/Makefile.in

Fixed makefiles inclusion flow to pass actual configuration variable values.
Test build system modified to be similar to uClibc one: 
 * test custom logic moved from Makefile to a new Makefile.in (to be included 
   by Makefile). 
 * Makefile same for all tests and just used for including all other needed 
   makefiles. 

Signed-off-by: Salvatore Cro 
Signed-off-by: Carmelo Amoroso 

 ------------------------------------------------------------------------

Index: test/stdlib/Makefile.in
===================================================================
--- test/stdlib/Makefile.in	(revision 0)
+++ test/stdlib/Makefile.in	(revision 25674)
@@ -0,0 +1,7 @@
+# uClibc stdlib tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+DODIFF_qsort       := 1
+DODIFF_testatexit  := 1
+DODIFF_teston_exit := 1
+DODIFF_teststrtol  := 1
Index: test/stdlib/Makefile
===================================================================
--- test/stdlib/Makefile	(revision 25673)
+++ test/stdlib/Makefile	(revision 25674)
@@ -1,9 +1,7 @@
 # uClibc stdlib tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-DODIFF_qsort       := 1
-DODIFF_testatexit  := 1
-DODIFF_teston_exit := 1
-DODIFF_teststrtol  := 1
Index: test/dlopen/Makefile.in
===================================================================
--- test/dlopen/Makefile.in	(revision 0)
+++ test/dlopen/Makefile.in	(revision 25674)
@@ -0,0 +1,38 @@
+# uClibc dlopen tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+# rules need a little love to work with glibc ...
+export UCLIBC_ONLY := 1
+
+TESTS := dltest dltest2 dlstatic test1 test2 test3 dlundef dlafk dladdr
+
+CFLAGS_dltest    := -DLIBNAME="\"./libtest.so\""
+CFLAGS_dltest2   := -DLIBNAME="\"./libtest3.so\""
+
+LDFLAGS_dlstatic := -ldl
+LDFLAGS_dltest   := -ldl -lpthread
+LDFLAGS_dltest2  := -ldl -lpthread
+LDFLAGS_dlundef  := -ldl
+LDFLAGS_dlafk    := -ldl ./libafk.so -Wl,-rpath,.
+LDFLAGS_test1    := -ldl
+LDFLAGS_test2    := -ldl
+LDFLAGS_test3    := -ldl ./libtest1.so ./libtest2.so -Wl,-rpath,.
+LDFLAGS_dladdr   := -ldl
+
+DEBUG_LIBS := X
+WRAPPER := env $(DEBUG_LIBS)=all LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)"
+
+dltest: libtest.so
+dltest2: libtest3.so
+dlstatic: libstatic.so
+dlundef: libundef.so
+dlafk: libafk.so
+libafk.so: libafk-temp.so
+LDFLAGS_libafk.so := ./libafk-temp.so -Wl,-rpath,.
+test1: libtest1.so
+test2: libtest1.so libtest2.so
+test3: libtest1.so libtest2.so
+libtest1.so: libtest2.so
+LDFLAGS_libtest1.so := ./libtest2.so -Wl,-rpath,.
+LDFLAGS_libtest2.so := -Wl,-rpath,.
+LDFLAGS_libtest3.so := -lpthread -Wl,-rpath,.
Index: test/dlopen/Makefile
===================================================================
--- test/dlopen/Makefile	(revision 25673)
+++ test/dlopen/Makefile	(revision 25674)
@@ -1,40 +1,7 @@
 # uClibc dlopen tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
-# rules need a little love to work with glibc ...
-export UCLIBC_ONLY := 1
-
-TESTS := dltest dltest2 dlstatic test1 test2 test3 dlundef dlafk dladdr
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-CFLAGS_dltest    := -DLIBNAME="\"./libtest.so\""
-CFLAGS_dltest2   := -DLIBNAME="\"./libtest3.so\""
-
-LDFLAGS_dlstatic := -ldl
-LDFLAGS_dltest   := -ldl -lpthread
-LDFLAGS_dltest2  := -ldl -lpthread
-LDFLAGS_dlundef  := -ldl
-LDFLAGS_dlafk    := -ldl ./libafk.so -Wl,-rpath,.
-LDFLAGS_test1    := -ldl
-LDFLAGS_test2    := -ldl
-LDFLAGS_test3    := -ldl ./libtest1.so ./libtest2.so -Wl,-rpath,.
-LDFLAGS_dladdr   := -ldl
-
-DEBUG_LIBS := X
-WRAPPER := env $(DEBUG_LIBS)=all LD_LIBRARY_PATH="$$PWD:.:$(LD_LIBRARY_PATH)"
-
-dltest: libtest.so
-dltest2: libtest3.so
-dlstatic: libstatic.so
-dlundef: libundef.so
-dlafk: libafk.so
-libafk.so: libafk-temp.so
-LDFLAGS_libafk.so := ./libafk-temp.so -Wl,-rpath,.
-test1: libtest1.so
-test2: libtest1.so libtest2.so
-test3: libtest1.so libtest2.so
-libtest1.so: libtest2.so
-LDFLAGS_libtest1.so := ./libtest2.so -Wl,-rpath,.
-LDFLAGS_libtest2.so := -Wl,-rpath,.
-LDFLAGS_libtest3.so := -lpthread -Wl,-rpath,.
Index: test/stdio/Makefile.in
===================================================================
--- test/stdio/Makefile.in	(revision 0)
+++ test/stdio/Makefile.in	(revision 25674)
@@ -0,0 +1,4 @@
+# uClibc stdio tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+DODIFF_64bit := 1
Index: test/stdio/Makefile
===================================================================
--- test/stdio/Makefile	(revision 25673)
+++ test/stdio/Makefile	(revision 25674)
@@ -1,6 +1,7 @@
-# uClibc assert tests
+# uClibc stdio tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-DODIFF_64bit := 1
Index: test/rpc/Makefile.in
===================================================================
--- test/rpc/Makefile.in	(revision 0)
+++ test/rpc/Makefile.in	(revision 25674)
@@ -0,0 +1,11 @@
+# uClibc rpc tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS := getrpcent
+
+ifeq ($(UCLIBC_HAS_REENTRANT_RPC),y)
+TESTS += getrpcent_r
+endif
+
+DODIFF_getrpcent := 1
+
Index: test/rpc/Makefile
===================================================================
--- test/rpc/Makefile	(revision 25673)
+++ test/rpc/Makefile	(revision 25674)
@@ -1,12 +1,7 @@
 # uClibc rpc tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
-TESTS := getrpcent
-
-ifeq ($(UCLIBC_HAS_REENTRANT_RPC),y)
-TESTS += getrpcent_r
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-DODIFF_getrpcent := 1
Index: test/Test.mak
===================================================================
--- test/Test.mak	(revision 25673)
+++ test/Test.mak	(revision 25674)
@@ -18,9 +18,6 @@
 $(error Sanity check: cannot have a test named "test.c")
 endif
 
-top_builddir = ../../
-include ../Rules.mak
-
 U_TARGETS := $(TESTS)
 G_TARGETS := $(patsubst %,%_glibc,$(U_TARGETS))
 
Index: test/pthread/Makefile.in
===================================================================
--- test/pthread/Makefile.in	(revision 0)
+++ test/pthread/Makefile.in	(revision 25674)
@@ -0,0 +1,7 @@
+# uClibc pthread tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+
+EXTRA_LDFLAGS := -lpthread
+
+LDFLAGS_cancellation-points := -lrt
Index: test/pthread/Makefile
===================================================================
--- test/pthread/Makefile	(revision 25673)
+++ test/pthread/Makefile	(revision 25674)
@@ -1,8 +1,7 @@
 # uClibc pthread tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-EXTRA_LDFLAGS := -lpthread
-
-LDFLAGS_cancellation-points := -lrt
Index: test/math/Makefile.in
===================================================================
--- test/math/Makefile.in	(revision 0)
+++ test/math/Makefile.in	(revision 25674)
@@ -0,0 +1,27 @@
+# uClibc math tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS := basic-test rint tst-definitions test-fpucw test-float test-ifloat test-double test-idouble
+ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),y)
+TESTS += test-ldouble test-ildoubl compile_test
+else
+CFLAGS_basic-test := -DNO_LONG_DOUBLE
+endif
+
+DODIFF_rint     := 1
+
+# NOTE: For basic-test we must disable the floating point optimization.
+#       Only for sh architecture because in the other architecture are disabled.
+ifeq ($(TARGET_ARCH),sh)
+CFLAGS_basic-test += -mieee
+endif
+EXTRA_CFLAGS    := -fno-builtin
+EXTRA_LDFLAGS   := -lm
+
+PERL := /usr/bin/perl
+ulps-file := $(firstword $(wildcard $(config-sysdirs:%=$(..)%/libm-test-ulps)))
+libm-test.c: $(ulps-file) libm-test.inc gen-libm-test.pl
+	$(Q)$(PERL) ./gen-libm-test.pl -u $< ./libm-test.inc -o "." 2>&1 > /dev/null
+EXTRA_CLEAN := libm-test.c libm-test-ulps.h
+TARGETS=libm-test.c
+
Index: test/math/Makefile
===================================================================
--- test/math/Makefile	(revision 25673)
+++ test/math/Makefile	(revision 25674)
@@ -1,30 +1,7 @@
 # uClibc math tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
-include ../../.config
-
-TESTS := basic-test rint tst-definitions test-fpucw test-float test-ifloat test-double test-idouble
-ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),y)
-TESTS += test-ldouble test-ildoubl compile_test
-else
-CFLAGS_basic-test := -DNO_LONG_DOUBLE
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-DODIFF_rint     := 1
-
-# NOTE: For basic-test we must disable the floating point optimization.
-#       Only for sh architecture because in the other architecture are disabled.
-ifeq ($(TARGET_ARCH),sh)
-CFLAGS_basic-test += -mieee
-endif
-EXTRA_CFLAGS    := -fno-builtin
-EXTRA_LDFLAGS   := -lm
-
-PERL := /usr/bin/perl
-ulps-file := $(firstword $(wildcard $(config-sysdirs:%=$(..)%/libm-test-ulps)))
-libm-test.c: $(ulps-file) libm-test.inc gen-libm-test.pl
-	$(Q)$(PERL) ./gen-libm-test.pl -u $< ./libm-test.inc -o "." 2>&1 > /dev/null
-EXTRA_CLEAN := libm-test.c libm-test-ulps.h
-$(TARGETS): libm-test.c
Index: test/silly/Makefile.in
===================================================================
--- test/silly/Makefile.in	(revision 0)
+++ test/silly/Makefile.in	(revision 25674)
@@ -0,0 +1,5 @@
+# uClibc silly tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+RET_hello := 42
+RET_tiny  := 42
Index: test/silly/Makefile
===================================================================
--- test/silly/Makefile	(revision 25673)
+++ test/silly/Makefile	(revision 25674)
@@ -1,7 +1,7 @@
 # uClibc silly tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-RET_hello := 42
-RET_tiny  := 42
Index: test/time/Makefile.in
===================================================================
--- test/time/Makefile.in	(revision 0)
+++ test/time/Makefile.in	(revision 25674)
@@ -0,0 +1,11 @@
+# uClibc time tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \
+	tst-strftime tst-strptime tst-timezone
+
+ifneq ($(UCLIBC_HAS_XLOCALE),y)
+TESTS_DISABLED += tst-ftime_l
+endif
+
+CFLAGS_tst-strptime2 := -std=c99
Index: test/time/Makefile
===================================================================
--- test/time/Makefile	(revision 25673)
+++ test/time/Makefile	(revision 25674)
@@ -1,13 +1,7 @@
 # uClibc time tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
-TESTS_DISABLED := bug-asctime bug-asctime_r time tst-mktime2 tst-posixtz \
-	tst-strftime tst-strptime tst-timezone
-
-ifneq ($(UCLIBC_HAS_XLOCALE),y)
-TESTS_DISABLED += tst-ftime_l
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-CFLAGS_tst-strptime2 := -std=c99
Index: test/locale/Makefile.in
===================================================================
--- test/locale/Makefile.in	(revision 0)
+++ test/locale/Makefile.in	(revision 25674)
@@ -0,0 +1,29 @@
+# uClibc locale tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#	 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm    \
+
+TESTS := bug-iconv-trans bug-usesetlocale collate-test dump-ctype \
+	 gen-unicode-ctype show-ucs-data tst-ctype \
+	 tst-digits tst-fmon tst-langinfo tst-leaks tst-mbswcs1 \
+	 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 tst-mbswcs6 \
+	 tst_nl_langinfo tst-numeric tst-rpmatch tst-setlocale \
+	 tst-sscanf tst-strfmon1 tst-trans tst-wctype tst-xlocale1 \
+	 tst-xlocale2 xfrm-test
+
+
+# NOTE: For now disabled some tests that are known not build
+TESTS_DISABLED := tst-ctype tst-fmon tst-leaks tst-rpmatch tst-strfmon1
+
+ifneq ($(UCLIBC_HAS_XLOCALE),y)
+TESTS_DISABLED += bug-usesetlocale tst-xlocale1 tst-xlocale2 xfrm-test tst-C-locale
+endif
+
+DODIFF_rint     := 1
+
+EXTRA_CFLAGS    := -D__USE_GNU -fno-builtin
+
+OPTS_dump-ctype = C
+OPTS_tst-ctype = < tst-ctype-de_DE.ISO-8859-1.in
+OPTS_tst-langinfo = < tst-langinfo.input
+
+EXTRA_DIRS := C
Index: test/locale/Makefile
===================================================================
--- test/locale/Makefile	(revision 25673)
+++ test/locale/Makefile	(revision 25674)
@@ -1,31 +1,7 @@
 # uClibc locale tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#	 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm    \
 
-TESTS := bug-iconv-trans bug-usesetlocale collate-test dump-ctype \
-	 gen-unicode-ctype show-ucs-data tst-ctype \
-	 tst-digits tst-fmon tst-langinfo tst-leaks tst-mbswcs1 \
-	 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 tst-mbswcs6 \
-	 tst_nl_langinfo tst-numeric tst-rpmatch tst-setlocale \
-	 tst-sscanf tst-strfmon1 tst-trans tst-wctype tst-xlocale1 \
-	 tst-xlocale2 xfrm-test
-
-
-# NOTE: For now disabled some tests that are known not build
-TESTS_DISABLED := tst-ctype tst-fmon tst-leaks tst-rpmatch tst-strfmon1
-
-ifneq ($(UCLIBC_HAS_XLOCALE),y)
-TESTS_DISABLED += bug-usesetlocale tst-xlocale1 tst-xlocale2 xfrm-test tst-C-locale
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-DODIFF_rint     := 1
-
-EXTRA_CFLAGS    := -D__USE_GNU -fno-builtin
-
-OPTS_dump-ctype = C
-OPTS_tst-ctype = < tst-ctype-de_DE.ISO-8859-1.in
-OPTS_tst-langinfo = < tst-langinfo.input
-
-EXTRA_DIRS := C
Index: test/assert/Makefile.in
===================================================================
--- test/assert/Makefile.in	(revision 0)
+++ test/assert/Makefile.in	(revision 25674)
@@ -0,0 +1,5 @@
+# uClibc assert tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+RET_assert     := 134
+WRAPPER_assert := trap ":" ABRT ;
Index: test/assert/Makefile
===================================================================
--- test/assert/Makefile	(revision 25673)
+++ test/assert/Makefile	(revision 25674)
@@ -1,7 +1,7 @@
 # uClibc assert tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-RET_assert     := 134
-WRAPPER_assert := trap ":" ABRT ;
Index: test/setjmp/Makefile
===================================================================
--- test/setjmp/Makefile	(revision 25673)
+++ test/setjmp/Makefile	(revision 25674)
@@ -1,4 +1,7 @@
 # uClibc setjmp tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
Index: test/unistd/Makefile.in
===================================================================
--- test/unistd/Makefile.in	(revision 0)
+++ test/unistd/Makefile.in	(revision 25674)
@@ -0,0 +1,11 @@
+# uClibc unistd tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+OPTS_getopt      := -abcXXX -9
+OPTS_getopt_long := --add XXX --delete YYY --verbose
+ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
+OPTS_tstgetopt   := -a -b -cfoobar --required foobar --optional=bazbug --none random --col --color --colour
+else
+# reordering is not supported, behaves as if POSIXLY_CORRECT would be set
+OPTS_tstgetopt   := -a -b -cfoobar --required foobar --optional=bazbug --none --colou --color --colour random
+endif
Index: test/unistd/Makefile
===================================================================
--- test/unistd/Makefile	(revision 25673)
+++ test/unistd/Makefile	(revision 25674)
@@ -1,13 +1,7 @@
 # uClibc unistd tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-OPTS_getopt      := -abcXXX -9
-OPTS_getopt_long := --add XXX --delete YYY --verbose
-ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
-OPTS_tstgetopt   := -a -b -cfoobar --required foobar --optional=bazbug --none random --col --color --colour
-else
-# reordering is not supported, behaves as if POSIXLY_CORRECT would be set
-OPTS_tstgetopt   := -a -b -cfoobar --required foobar --optional=bazbug --none --colou --color --colour random
-endif
Index: test/regex/Makefile
===================================================================
--- test/regex/Makefile	(revision 25673)
+++ test/regex/Makefile	(revision 25674)
@@ -1,4 +1,7 @@
 # uClibc regex tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
Index: test/Makefile
===================================================================
--- test/Makefile	(revision 25673)
+++ test/Makefile	(revision 25674)
@@ -32,7 +32,7 @@
 ifneq ($(UCLIBC_HAS_LOCALE),y)
 	DIRS := $(filter-out locale,$(DIRS))
 endif
-ifeq ($(UCLIBC_HAS_CRYPT_STUB),y)
+ifneq ($(UCLIBC_HAS_CRYPT),y)
 	DIRS := $(filter-out crypt,$(DIRS))
 endif
 ifeq ($(HAS_NO_THREADS),y)
Index: test/signal/Makefile.in
===================================================================
--- test/signal/Makefile.in	(revision 0)
+++ test/signal/Makefile.in	(revision 25674)
@@ -0,0 +1,6 @@
+# uClibc signal tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+ifeq ($(UCLIBC_HAS_OBSOLETE_BSD_SIGNAL),)
+TESTS_DISABLED := tst-sigsimple
+endif
Index: test/signal/Makefile
===================================================================
--- test/signal/Makefile	(revision 25673)
+++ test/signal/Makefile	(revision 25674)
@@ -1,8 +1,7 @@
 # uClibc signal tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
-ifeq ($(UCLIBC_HAS_OBSOLETE_BSD_SIGNAL),)
-TESTS_DISABLED := tst-sigsimple
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
Index: test/termios/Makefile
===================================================================
--- test/termios/Makefile	(revision 25673)
+++ test/termios/Makefile	(revision 25674)
@@ -1,4 +1,7 @@
 # uClibc termios tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
Index: test/ctype/Makefile.in
===================================================================
--- test/ctype/Makefile.in	(revision 0)
+++ test/ctype/Makefile.in	(revision 25674)
@@ -0,0 +1,4 @@
+# uClibc ctype tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS := ctype
Index: test/ctype/Makefile
===================================================================
--- test/ctype/Makefile	(revision 25673)
+++ test/ctype/Makefile	(revision 25674)
@@ -1,6 +1,7 @@
 # uClibc ctype tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
-TESTS := ctype
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
Index: test/locale-mbwc/Makefile.in
===================================================================
--- test/locale-mbwc/Makefile.in	(revision 0)
+++ test/locale-mbwc/Makefile.in	(revision 25674)
@@ -0,0 +1,27 @@
+# uClibc locale tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#	 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm    \
+
+TESTS := tst_iswalnum tst_iswalpha tst_iswcntrl          \
+	 tst_iswctype tst_iswdigit tst_iswgraph          \
+	 tst_iswlower tst_iswprint tst_iswpunct          \
+	 tst_iswspace tst_iswupper tst_iswxdigit         \
+	 tst_mblen tst_mbrlen tst_mbrtowc tst_mbsrtowcs  \
+	 tst_mbstowcs tst_mbtowc tst_strcoll tst_strxfrm \
+	 tst_swscanf tst_towctrans tst_towlower          \
+	 tst_towupper tst_wcrtomb tst_wcscat tst_wcschr  \
+	 tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn   \
+	 tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy  \
+	 tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
+	 tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
+	 tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans    \
+	 tst_wctype tst_wcwidth tst_strfmon
+
+
+# NOTE: For now disabled tst_strfmon to avoid build failure.
+TESTS_DISABLED := tst_strfmon
+
+DODIFF_rint     := 1
+
+EXTRA_CFLAGS    := -D__USE_GNU -fno-builtin
+
Index: test/locale-mbwc/Makefile
===================================================================
--- test/locale-mbwc/Makefile	(revision 25673)
+++ test/locale-mbwc/Makefile	(revision 25674)
@@ -1,29 +1,7 @@
 # uClibc locale tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-#	 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm    \
 
-TESTS := tst_iswalnum tst_iswalpha tst_iswcntrl          \
-	 tst_iswctype tst_iswdigit tst_iswgraph          \
-	 tst_iswlower tst_iswprint tst_iswpunct          \
-	 tst_iswspace tst_iswupper tst_iswxdigit         \
-	 tst_mblen tst_mbrlen tst_mbrtowc tst_mbsrtowcs  \
-	 tst_mbstowcs tst_mbtowc tst_strcoll tst_strxfrm \
-	 tst_swscanf tst_towctrans tst_towlower          \
-	 tst_towupper tst_wcrtomb tst_wcscat tst_wcschr  \
-	 tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn   \
-	 tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy  \
-	 tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
-	 tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
-	 tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans    \
-	 tst_wctype tst_wcwidth tst_strfmon
-
-
-# NOTE: For now disabled tst_strfmon to avoid build failure.
-TESTS_DISABLED := tst_strfmon
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-DODIFF_rint     := 1
-
-EXTRA_CFLAGS    := -D__USE_GNU -fno-builtin
-
Index: test/mmap/Makefile
===================================================================
--- test/mmap/Makefile	(revision 25673)
+++ test/mmap/Makefile	(revision 25674)
@@ -1,4 +1,7 @@
 # uClibc mmap tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
Index: test/misc/Makefile.in
===================================================================
--- test/misc/Makefile.in	(revision 0)
+++ test/misc/Makefile.in	(revision 25674)
@@ -0,0 +1,12 @@
+# uClibc misc tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS_DISABLED := outb tst-fnmatch bug-glob1 tst-gnuglob
+
+CFLAGS_dirent64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+
+DODIFF_dirent    := 1
+DODIFF_dirent64  := 1
+
+OPTS_bug-glob1   := $(PWD)
+OPTS_tst-fnmatch := < tst-fnmatch.input
Index: test/misc/Makefile
===================================================================
--- test/misc/Makefile	(revision 25673)
+++ test/misc/Makefile	(revision 25674)
@@ -1,14 +1,7 @@
 # uClibc misc tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
-TESTS_DISABLED := outb tst-fnmatch bug-glob1 tst-gnuglob
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-CFLAGS_dirent64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-
-DODIFF_dirent    := 1
-DODIFF_dirent64  := 1
-
-OPTS_bug-glob1   := $(PWD)
-OPTS_tst-fnmatch := < tst-fnmatch.input
Index: test/args/Makefile.in
===================================================================
--- test/args/Makefile.in	(revision 0)
+++ test/args/Makefile.in	(revision 25674)
@@ -0,0 +1,9 @@
+# uClibc args tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+OPTS_arg_test = a b c d e f g h
+WRAPPER_arg_test = \
+	env -i \
+	ENVVAR=123 \
+	SOMETHING=sldajfasdf \
+	BLAHBLAH=" hi hi "
Index: test/args/Makefile
===================================================================
--- test/args/Makefile	(revision 25673)
+++ test/args/Makefile	(revision 25674)
@@ -1,11 +1,7 @@
 # uClibc args tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-OPTS_arg_test = a b c d e f g h
-WRAPPER_arg_test = \
-	env -i \
-	ENVVAR=123 \
-	SOMETHING=sldajfasdf \
-	BLAHBLAH=" hi hi "
Index: test/README
===================================================================
--- test/README	(revision 25673)
+++ test/README	(revision 25674)
@@ -36,19 +36,23 @@
 ----------------

 
 The structure of this test system is:
- test/                 toplevel dir containing common test code
- test/Rules.mak        Common build code
- test/Test.mak         Runtime test make code
- test/subdir/          code specific to a subsystem is stored in a subdir
- test/subdir/Makefile  describe the tests to run
- test/subdir/*.c       the tests
+ test/                    toplevel dir containing common test code
+ test/Rules.mak           Common build code
+ test/Test.mak            Runtime test make code
+ test/subdir/             code specific to a subsystem is stored in a subdir
+ test/subdir/Makefile.in  describe the tests to run
+ test/subdir/Makefile     test entry point, includes needed upper-level
+                          makefiles plus Makefile.in
+ test/subdir/*.c          the tests
 
-Each subdir Makefile must include the toplevel Test.mak file.  Before doing so,
-you may define the TESTS and TESTS_DISABLED variables.  If you do not, TESTS
+Each subdir has a Makefile (same for any subdir) that must include in strict order :
+  - the upper-level Rules.mak file.
+  - the Makefile.in .
+  - the upper-level Test.mak file.
+Makefile.in may be used to define the TESTS and TESTS_DISABLED variables.  If you do not, TESTS
 is built automatically based upon all the .c files in the subdir.
 TESTS := foo
 TESTS_DISABLED := bar
-include ../Test.mak
 Each test must use a similar .c name; so the "foo" test needs a "foo.c".
 
 Additionally, the following options further control specific test behavior:
Index: test/inet/Makefile
===================================================================
--- test/inet/Makefile	(revision 25673)
+++ test/inet/Makefile	(revision 25674)
@@ -1,4 +1,7 @@
 # uClibc inet tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
Index: test/build/Makefile
===================================================================
--- test/build/Makefile	(revision 25673)
+++ test/build/Makefile	(revision 25674)
@@ -1,4 +1,7 @@
 # uClibc build tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
Index: test/crypt/Makefile.in
===================================================================
--- test/crypt/Makefile.in	(revision 0)
+++ test/crypt/Makefile.in	(revision 25674)
@@ -0,0 +1,6 @@
+# uClibc crypt tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+EXTRA_LDFLAGS := -lcrypt
+
+OPTS_crypt = < crypt.input
Index: test/crypt/Makefile
===================================================================
--- test/crypt/Makefile	(revision 25673)
+++ test/crypt/Makefile	(revision 25674)
@@ -1,14 +1,7 @@
 # uClibc crypt tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
-include ../../.config
-
-ifneq ($(UCLIBC_HAS_CRYPT),y)
-TESTS_DISABLED := $(patsubst %.c,%,$(wildcard *.c))
-endif
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-EXTRA_LDFLAGS := -lcrypt
-
-OPTS_crypt = < crypt.input
Index: test/pwd_grp/Makefile.in
===================================================================
--- test/pwd_grp/Makefile.in	(revision 0)
+++ test/pwd_grp/Makefile.in	(revision 25674)
@@ -0,0 +1,8 @@
+# uClibc pwd_grp tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+DODIFF_test_pwd  := 1
+DODIFF_test_grp  := 1
+DODIFF_pwcat     := 1
+DODIFF_grcat     := 1
+DODIFF_getgroups := 1
Index: test/pwd_grp/Makefile
===================================================================
--- test/pwd_grp/Makefile	(revision 25673)
+++ test/pwd_grp/Makefile	(revision 25674)
@@ -1,10 +1,7 @@
 # uClibc pwd_grp tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-DODIFF_test_pwd  := 1
-DODIFF_test_grp  := 1
-DODIFF_pwcat     := 1
-DODIFF_grcat     := 1
-DODIFF_getgroups := 1
Index: test/string/Makefile.in
===================================================================
--- test/string/Makefile.in	(revision 0)
+++ test/string/Makefile.in	(revision 25674)
@@ -0,0 +1,4 @@
+# uClibc string tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+EXTRA_CFLAGS := -fno-builtin
Index: test/string/Makefile
===================================================================
--- test/string/Makefile	(revision 25673)
+++ test/string/Makefile	(revision 25674)
@@ -1,6 +1,7 @@
 # uClibc string tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-EXTRA_CFLAGS := -fno-builtin
Index: test/malloc/Makefile.in
===================================================================
--- test/malloc/Makefile.in	(revision 0)
+++ test/malloc/Makefile.in	(revision 25674)
@@ -0,0 +1,4 @@
+# uClibc malloc tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+TESTS_DISABLED := time_malloc
Index: test/malloc/Makefile
===================================================================
--- test/malloc/Makefile	(revision 25673)
+++ test/malloc/Makefile	(revision 25674)
@@ -1,6 +1,7 @@
 # uClibc malloc tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
-TESTS_DISABLED := time_malloc
-
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
Index: test/stat/Makefile.in
===================================================================
--- test/stat/Makefile.in	(revision 0)
+++ test/stat/Makefile.in	(revision 25674)
@@ -0,0 +1,10 @@
+# uClibc stat tests
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+
+CFLAGS_stat64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+
+DODIFF_stat   := 1
+DODIFF_stat64 := 1
+
+OPTS_stat   := Makefile
+OPTS_stat64 := Makefile
Index: test/stat/Makefile
===================================================================
--- test/stat/Makefile	(revision 25673)
+++ test/stat/Makefile	(revision 25674)
@@ -1,12 +1,7 @@
 # uClibc stat tests
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 
+top_builddir=../../
+include ../Rules.mak
+-include Makefile.in
 include ../Test.mak
-
-CFLAGS_stat64 := -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-
-DODIFF_stat   := 1
-DODIFF_stat64 := 1
-
-OPTS_stat   := Makefile
-OPTS_stat64 := Makefile

 ------------------------------------------------------------------------
r25673 | carmelo | 2009-03-16 08:33:27 -0500 (Mon, 16 Mar 2009) | 2 lines
Changed paths:
   M /trunk/uClibc/test/rpc/getrpcent_r.c

Added string.h header for strerr prototype.

 ------------------------------------------------------------------------

Index: test/rpc/getrpcent_r.c
===================================================================
--- test/rpc/getrpcent_r.c	(revision 25672)
+++ test/rpc/getrpcent_r.c	(revision 25673)
@@ -1,6 +1,7 @@
 #include 
 #include 
 #include 
+#include 
 
 int main(int argc, char *argv[])
 {

 ------------------------------------------------------------------------
r25670 | vapier | 2009-03-16 01:16:15 -0500 (Mon, 16 Mar 2009) | 1 line
Changed paths:
   M /trunk/uClibc/libc/sysdeps/linux/common/mprotect.c

enable mprotect() regardless of MMU as some systems have MPUs which allows memory protection
 ------------------------------------------------------------------------

Index: libc/sysdeps/linux/common/mprotect.c
===================================================================
--- libc/sysdeps/linux/common/mprotect.c	(revision 25669)
+++ libc/sysdeps/linux/common/mprotect.c	(revision 25670)
@@ -10,6 +10,6 @@
 #include 
 #include 
 
-#if defined __ARCH_USE_MMU__ && defined __NR_mprotect
+#if defined __NR_mprotect
 _syscall3(int, mprotect, void *, addr, size_t, len, int, prot)
 #endif

 ------------------------------------------------------------------------
r25669 | vapier | 2009-03-16 01:14:34 -0500 (Mon, 16 Mar 2009) | 1 line
Changed paths:
   A /trunk/uClibc/libc/sysdeps/linux/bfin/sys/user.h

import user.h from the kernel as it is no longer exported by the kernel
 ------------------------------------------------------------------------

Index: libc/sysdeps/linux/bfin/sys/user.h
===================================================================
--- libc/sysdeps/linux/bfin/sys/user.h	(revision 0)
+++ libc/sysdeps/linux/bfin/sys/user.h	(revision 25669)
@@ -0,0 +1,57 @@
+#ifndef _SYS_USER_H
+#define _SYS_USER_H
+
+struct user_bfinfp_struct {
+};
+
+/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
+   is still the layout used by user (the new pt_regs doesn't have
+   all registers). */
+struct user_regs_struct {
+	long r0, r1, r2, r3, r4, r5, r6, r7;
+	long p0, p1, p2, p3, p4, p5, usp, fp;
+	long i0, i1, i2, i3;
+	long l0, l1, l2, l3;
+	long b0, b1, b2, b3;
+	long m0, m1, m2, m3;
+	long a0w, a1w;
+	long a0x, a1x;
+	unsigned long rets;
+	unsigned long astat;
+	unsigned long pc;
+	unsigned long orig_p0;
+};
+
+/* When the kernel dumps core, it starts by dumping the user struct -
+   this will be used by gdb to figure out where the data and stack segments
+   are within the file, and what virtual addresses to use. */
+
+struct user {
+/* We start with the registers, to mimic the way that "memory" is returned
+   from the ptrace(3,...) function.  */
+
+	struct user_regs_struct regs;	/* Where the registers are actually stored */
+
+/* The rest of this junk is to help gdb figure out what goes where */
+	unsigned long int u_tsize;	/* Text segment size (pages). */
+	unsigned long int u_dsize;	/* Data segment size (pages). */
+	unsigned long int u_ssize;	/* Stack segment size (pages). */
+	unsigned long start_code;	/* Starting virtual address of text. */
+	unsigned long start_stack;	/* Starting virtual address of stack area.
+					   This is actually the bottom of the stack,
+					   the top of the stack is always found in the
+					   esp register.  */
+	long int signal;	/* Signal that caused the core dump. */
+	int reserved;		/* No longer used */
+	unsigned long u_ar0;
+	/* Used by gdb to help find the values for */
+	/* the registers. */
+	unsigned long magic;	/* To uniquely identify a core file */
+	char u_comm[32];	/* User command that was responsible */
+};
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif

 ------------------------------------------------------------------------
r25668 | kraj | 2009-03-16 01:02:47 -0500 (Mon, 16 Mar 2009) | 2 lines
Changed paths:
   M /trunk/uClibc/libc/sysdeps/linux/common/creat.c

Update copyright header.

 ------------------------------------------------------------------------

Index: libc/sysdeps/linux/common/creat.c
===================================================================
--- libc/sysdeps/linux/common/creat.c	(revision 25667)
+++ libc/sysdeps/linux/common/creat.c	(revision 25668)
@@ -2,7 +2,7 @@
 /*
  * creat() for uClibc
  *
- * Copyright (C) 2009 
+ * Copyright (C) 2000-2006 Erik Andersen 
  *
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */

 ------------------------------------------------------------------------
r25667 | vda | 2009-03-15 21:56:27 -0500 (Sun, 15 Mar 2009) | 3 lines
Changed paths:
   A /trunk/uClibc/docs/pthreads_hacking.txt

docs/pthreads_hacking.txt: new file


 ------------------------------------------------------------------------

Index: docs/pthreads_hacking.txt
===================================================================
--- docs/pthreads_hacking.txt	(revision 0)
+++ docs/pthreads_hacking.txt	(revision 25667)
@@ -0,0 +1,748 @@
+# Run me as a shell script in uclibc lib/*
+
+
+# Dump the list of dynamic symbols from libpthread
+# and compare libpthread's exported symbols of uclibc with glibc
+# (adjust /lib64/libpthread-*.*.so as needed).
+# The resulting diff is suspiciously large.
+# We export a lot of stuff which glibc does not.
+
+readelf -sDW libpthread-*.*.so \
+| grep '^ *[0-9]' \
+| sed 's/^[0-9a-f: ]*[^ ]\(  *[A-Z]\)/\1/' \
+| sed 's/ [0-9] / N /' | sed 's/ [0-9][0-9] /  N /' | sed 's/ [0-9][0-9][0-9] /   N /' \
+| sort -k5 | uniq \
+>uclibc.lst
+
+readelf -sDW /lib64/libpthread-*.*.so \
+| grep '^ *[0-9]' \
+| sed 's/^[0-9a-f: ]*[^ ]\(  *[A-Z]\)/\1/' \
+| sed 's/ [0-9] / N /' | sed 's/ [0-9][0-9] /  N /' | sed 's/ [0-9][0-9][0-9] /   N /' \
+| sort -k5 | uniq \
+>glibc.lst
+diff -u uclibc.lst glibc.lst >ug.diff
+
+
+# Check which exported symbols from libpthread are never referenced
+# from other libraries. Generally, I'd expect a very few __functions
+# with two underscores to be exported and not used by e.g. libc-X.X.X.so,
+# as these names are supposed to be internal, i.e. external programs
+# usually don't call them. On my system, I got 141 such __functions.
+# Examples:
+# __flockfilelist - NOP function (why do we need it at all?)
+# __pthread_perform_cleanup - called only from within libpthread
+
+echo *-*.*.*.so | xargs -n1 | grep -v libpthread | xargs readelf -aW >full_dump.lst
+>uclibc_unrefd.lst
+>uclibc_refd.lst
+sed 's/^.* //g' uclibc.lst \
+| while read symbol; do
+	if grep -F -- "$symbol" full_dump.lst >/dev/null 2>&1; then
+		echo "$symbol" >>uclibc_refd.lst
+	else
+		echo "$symbol" >>uclibc_unrefd.lst
+	fi
+done
+
+exit
+
+
+In case you don't have a glibc system to try it,
+ug.diff from vda's system is below.
+
+--- uclibc.lst	2009-03-16 03:07:58.000000000 +0100
++++ glibc.lst	2009-03-16 03:07:58.000000000 +0100
+@@ -1,188 +1,173 @@
+-  NOTYPE GLOBAL DEFAULT ABS __bss_start
+-    FUNC GLOBAL DEFAULT   N __compare_and_swap
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.2.5
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.2.6
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.3.2
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.3.3
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.3.4
++  OBJECT GLOBAL DEFAULT ABS GLIBC_2.4
++  OBJECT GLOBAL DEFAULT ABS GLIBC_PRIVATE
++    FUNC GLOBAL DEFAULT   N _IO_flockfile
++    FUNC GLOBAL DEFAULT   N _IO_ftrylockfile
++    FUNC GLOBAL DEFAULT   N _IO_funlockfile
++  NOTYPE   WEAK DEFAULT UND _Jv_RegisterClasses
++    FUNC GLOBAL DEFAULT UND __clone
++    FUNC   WEAK DEFAULT   N __close
++    FUNC   WEAK DEFAULT   N __connect
++    FUNC   WEAK DEFAULT UND __cxa_finalize
++    FUNC GLOBAL DEFAULT UND __endmntent
+     FUNC GLOBAL DEFAULT   N __errno_location
+-    FUNC GLOBAL DEFAULT   N __flockfilelist
+-    FUNC GLOBAL DEFAULT   N __fresetlockfiles
+-    FUNC GLOBAL DEFAULT   N __funlockfilelist
++    FUNC   WEAK DEFAULT   N __fcntl
++    FUNC GLOBAL DEFAULT   N __fork
++    FUNC GLOBAL DEFAULT UND __fxstat64
++    FUNC GLOBAL DEFAULT UND __getdelim
++    FUNC GLOBAL DEFAULT UND __getmntent_r
++    FUNC GLOBAL DEFAULT UND __getpagesize
++    FUNC GLOBAL DEFAULT UND __gettimeofday
+     FUNC GLOBAL DEFAULT   N __h_errno_location
+-    FUNC GLOBAL DEFAULT   N __linuxthreads_create_event
+-    FUNC GLOBAL DEFAULT   N __linuxthreads_death_event
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_initial_report_events
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_pthread_key_2ndlevel_size
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_pthread_keys_max
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_pthread_sizeof_descr
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_pthread_threads_max
+-    FUNC GLOBAL DEFAULT   N __linuxthreads_reap_event
+-  OBJECT GLOBAL DEFAULT   N __linuxthreads_version
+-    FUNC GLOBAL DEFAULT   N __pthread_alt_lock
+-    FUNC GLOBAL DEFAULT   N __pthread_alt_timedlock
+-    FUNC GLOBAL DEFAULT   N __pthread_alt_unlock
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getdetachstate
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getguardsize
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getinheritsched
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getschedparam
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getschedpolicy
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getscope
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getstack
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_getstacksize
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_init
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setdetachstate
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setguardsize
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setinheritsched
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setschedparam
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setschedpolicy
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setscope
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setstack
+-    FUNC GLOBAL DEFAULT   N __pthread_attr_setstacksize
+-    FUNC GLOBAL DEFAULT   N __pthread_barrierattr_getpshared
+-    FUNC GLOBAL DEFAULT   N __pthread_compare_and_swap
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_broadcast
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_init
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_signal
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_timedwait
+-    FUNC GLOBAL DEFAULT   N __pthread_cond_wait
+-    FUNC GLOBAL DEFAULT   N __pthread_condattr_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_condattr_init
+-    FUNC GLOBAL DEFAULT   N __pthread_create
+-    FUNC GLOBAL DEFAULT   N __pthread_destroy_specifics
+-    FUNC GLOBAL DEFAULT   N __pthread_do_exit
+-    FUNC GLOBAL DEFAULT   N __pthread_equal
+-    FUNC GLOBAL DEFAULT   N __pthread_exit
+-  OBJECT GLOBAL DEFAULT   N __pthread_exit_code
+-  OBJECT GLOBAL DEFAULT   N __pthread_exit_requested
+-    FUNC GLOBAL DEFAULT   N __pthread_find_self
+-  OBJECT GLOBAL DEFAULT   N __pthread_functions
+-    FUNC GLOBAL DEFAULT   N __pthread_getconcurrency
+-    FUNC GLOBAL DEFAULT   N __pthread_getschedparam
+-    FUNC   WEAK DEFAULT   N __pthread_getspecific
+-  OBJECT GLOBAL DEFAULT   N __pthread_handles
+-  OBJECT GLOBAL DEFAULT   N __pthread_handles_num
+-  OBJECT GLOBAL DEFAULT   N __pthread_has_cas
+-    FUNC GLOBAL DEFAULT   N __pthread_init_max_stacksize
+-  OBJECT GLOBAL DEFAULT   N __pthread_initial_thread
+-  OBJECT GLOBAL DEFAULT   N __pthread_initial_thread_bos
+-    FUNC GLOBAL DEFAULT   N __pthread_initialize
+-    FUNC GLOBAL DEFAULT   N __pthread_initialize_manager
++    FUNC GLOBAL DEFAULT   N __libc_allocate_rtsig
++    FUNC GLOBAL DEFAULT UND __libc_allocate_rtsig_private
++    FUNC GLOBAL DEFAULT   N __libc_current_sigrtmax
++    FUNC GLOBAL DEFAULT UND __libc_current_sigrtmax_private
++    FUNC GLOBAL DEFAULT   N __libc_current_sigrtmin
++    FUNC GLOBAL DEFAULT UND __libc_current_sigrtmin_private
++    FUNC GLOBAL DEFAULT UND __libc_dl_error_tsd
++    FUNC GLOBAL DEFAULT UND __libc_dlopen_mode
++    FUNC GLOBAL DEFAULT UND __libc_dlsym
++    FUNC GLOBAL DEFAULT UND __libc_fatal
++    FUNC GLOBAL DEFAULT UND __libc_fork
++    FUNC GLOBAL DEFAULT UND __libc_longjmp
++    FUNC GLOBAL DEFAULT UND __libc_pthread_init
++  OBJECT GLOBAL DEFAULT UND __libc_stack_end
++    FUNC GLOBAL DEFAULT UND __libc_system
++    FUNC GLOBAL DEFAULT UND __libc_thread_freeres
++    FUNC   WEAK DEFAULT   N __lseek
++    FUNC   WEAK DEFAULT   N __nanosleep
++    FUNC   WEAK DEFAULT   N __open
++    FUNC   WEAK DEFAULT   N __open64
++    FUNC   WEAK DEFAULT   N __pread64
++    FUNC GLOBAL DEFAULT   N __pthread_cleanup_routine
++    FUNC GLOBAL DEFAULT   N __pthread_clock_gettime
++    FUNC GLOBAL DEFAULT   N __pthread_clock_settime
++    FUNC GLOBAL DEFAULT   N __pthread_getspecific
+     FUNC GLOBAL DEFAULT   N __pthread_initialize_minimal
+-    FUNC GLOBAL DEFAULT   N __pthread_internal_tsd_address
+-    FUNC GLOBAL DEFAULT   N __pthread_internal_tsd_get
+-    FUNC GLOBAL DEFAULT   N __pthread_internal_tsd_set
+-    FUNC   WEAK DEFAULT   N __pthread_key_create
+-    FUNC GLOBAL DEFAULT   N __pthread_kill_other_threads_np
+-  OBJECT GLOBAL DEFAULT   N __pthread_last_event
+-    FUNC GLOBAL DEFAULT   N __pthread_lock
+-  OBJECT GLOBAL DEFAULT   N __pthread_main_thread
+-    FUNC GLOBAL DEFAULT   N __pthread_manager
+-    FUNC GLOBAL DEFAULT   N __pthread_manager_adjust_prio
+-    FUNC GLOBAL DEFAULT   N __pthread_manager_event
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_reader
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_request
+-    FUNC GLOBAL DEFAULT   N __pthread_manager_sighandler
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_thread
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_thread_bos
+-  OBJECT GLOBAL DEFAULT   N __pthread_manager_thread_tos
+-  OBJECT GLOBAL DEFAULT   N __pthread_max_stacksize
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_destroy
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_init
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_lock
+-    FUNC GLOBAL DEFAULT   N __pthread_mutex_timedlock
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_trylock
+-    FUNC   WEAK DEFAULT   N __pthread_mutex_unlock
+-    FUNC   WEAK DEFAULT   N __pthread_mutexattr_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_getkind_np
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_getpshared
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_gettype
+-    FUNC   WEAK DEFAULT   N __pthread_mutexattr_init
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_setkind_np
+-    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_setpshared
+-    FUNC   WEAK DEFAULT   N __pthread_mutexattr_settype
+-  OBJECT GLOBAL DEFAULT   N __pthread_nonstandard_stacks
+-    FUNC GLOBAL DEFAULT   N __pthread_null_sighandler
+-  OBJECT GLOBAL DEFAULT   N __pthread_offsetof_descr
+-  OBJECT GLOBAL DEFAULT   N __pthread_offsetof_pid
+-    FUNC   WEAK DEFAULT   N __pthread_once
+-    FUNC GLOBAL DEFAULT   N __pthread_once_fork_child
+-    FUNC GLOBAL DEFAULT   N __pthread_once_fork_parent
+-    FUNC GLOBAL DEFAULT   N __pthread_once_fork_prepare
+-    FUNC GLOBAL DEFAULT   N __pthread_perform_cleanup
+-    FUNC GLOBAL DEFAULT   N __pthread_raise
+-    FUNC GLOBAL DEFAULT   N __pthread_reset_main_thread
+-    FUNC GLOBAL DEFAULT   N __pthread_restart_new
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_destroy
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_init
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_rdlock
+-    FUNC GLOBAL DEFAULT   N __pthread_rwlock_timedrdlock
+-    FUNC GLOBAL DEFAULT   N __pthread_rwlock_timedwrlock
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_tryrdlock
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_trywrlock
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_unlock
+-    FUNC   WEAK DEFAULT   N __pthread_rwlock_wrlock
+-    FUNC GLOBAL DEFAULT   N __pthread_rwlockattr_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_self
+-    FUNC GLOBAL DEFAULT   N __pthread_setcancelstate
+-    FUNC GLOBAL DEFAULT   N __pthread_setcanceltype
+-    FUNC GLOBAL DEFAULT   N __pthread_setconcurrency
+-    FUNC GLOBAL DEFAULT   N __pthread_setschedparam
+-    FUNC   WEAK DEFAULT   N __pthread_setspecific
+-  OBJECT GLOBAL DEFAULT   N __pthread_sig_cancel
+-  OBJECT GLOBAL DEFAULT   N __pthread_sig_debug
+-  OBJECT GLOBAL DEFAULT   N __pthread_sig_restart
+-    FUNC GLOBAL DEFAULT   N __pthread_sigaction
+-    FUNC GLOBAL DEFAULT   N __pthread_sighandler
+-    FUNC GLOBAL DEFAULT   N __pthread_sighandler_rt
+-    FUNC GLOBAL DEFAULT   N __pthread_sigwait
+-  OBJECT GLOBAL DEFAULT   N __pthread_sizeof_handle
+-  OBJECT GLOBAL DEFAULT   N __pthread_smp_kernel
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_destroy
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_init
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_lock
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_trylock
+-    FUNC GLOBAL DEFAULT   N __pthread_spin_unlock
+-    FUNC GLOBAL DEFAULT   N __pthread_thread_self
+-  OBJECT GLOBAL DEFAULT   N __pthread_threads_debug
+-  OBJECT GLOBAL DEFAULT   N __pthread_threads_events
+-  OBJECT GLOBAL DEFAULT   N __pthread_threads_max
+-    FUNC GLOBAL DEFAULT   N __pthread_timedsuspend_new
+-    FUNC GLOBAL DEFAULT   N __pthread_unlock
+-    FUNC GLOBAL DEFAULT   N __pthread_wait_for_restart_signal
+-    FUNC GLOBAL DEFAULT   N __register_atfork
++    FUNC GLOBAL DEFAULT   N __pthread_key_create
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_destroy
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_init
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_lock
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_trylock
++    FUNC GLOBAL DEFAULT   N __pthread_mutex_unlock
++    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_destroy
++    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_init
++    FUNC GLOBAL DEFAULT   N __pthread_mutexattr_settype
++    FUNC GLOBAL DEFAULT   N __pthread_once
++    FUNC GLOBAL DEFAULT   N __pthread_register_cancel
++    FUNC GLOBAL DEFAULT   N __pthread_register_cancel_defer
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_destroy
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_init
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_rdlock
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_tryrdlock
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_trywrlock
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_unlock
++    FUNC GLOBAL DEFAULT   N __pthread_rwlock_wrlock
++    FUNC GLOBAL DEFAULT   N __pthread_setspecific
++    FUNC GLOBAL DEFAULT   N __pthread_unregister_cancel
++    FUNC GLOBAL DEFAULT   N __pthread_unregister_cancel_restore
++    FUNC GLOBAL DEFAULT   N __pthread_unwind
++    FUNC GLOBAL DEFAULT   N __pthread_unwind_next
++    FUNC   WEAK DEFAULT   N __pwrite64
++    FUNC   WEAK DEFAULT   N __read
++    FUNC GLOBAL DEFAULT UND __register_atfork
++    FUNC GLOBAL DEFAULT   N __res_state
++     TLS GLOBAL DEFAULT UND __resp
++    FUNC GLOBAL DEFAULT UND __sched_getparam
++    FUNC GLOBAL DEFAULT UND __sched_getscheduler
++    FUNC GLOBAL DEFAULT UND __sched_setscheduler
++    FUNC   WEAK DEFAULT   N __send
++    FUNC GLOBAL DEFAULT UND __setmntent
+     FUNC GLOBAL DEFAULT   N __sigaction
+-  OBJECT GLOBAL DEFAULT   N __sighandler
+-  NOTYPE GLOBAL DEFAULT ABS _edata
+-  NOTYPE GLOBAL DEFAULT ABS _end
+-    FUNC GLOBAL DEFAULT   N _fini
+-    FUNC GLOBAL DEFAULT   N _init
++    FUNC GLOBAL DEFAULT UND __statfs
++    FUNC GLOBAL DEFAULT UND __sysconf
++    FUNC GLOBAL DEFAULT UND __tls_get_addr
++  OBJECT GLOBAL DEFAULT UND __vdso_clock_gettime
++    FUNC GLOBAL DEFAULT   N __vfork
++    FUNC   WEAK DEFAULT   N __wait
++    FUNC   WEAK DEFAULT   N __write
++    FUNC GLOBAL DEFAULT UND _dl_allocate_tls
++    FUNC GLOBAL DEFAULT UND _dl_allocate_tls_init
++    FUNC GLOBAL DEFAULT UND _dl_deallocate_tls
++    FUNC GLOBAL DEFAULT UND _dl_get_tls_static_info
++    FUNC GLOBAL DEFAULT UND _dl_make_stack_executable
++    FUNC GLOBAL DEFAULT UND _exit
+     FUNC GLOBAL DEFAULT   N _pthread_cleanup_pop
+     FUNC GLOBAL DEFAULT   N _pthread_cleanup_pop_restore
+     FUNC GLOBAL DEFAULT   N _pthread_cleanup_push
+     FUNC GLOBAL DEFAULT   N _pthread_cleanup_push_defer
+-    FUNC GLOBAL DEFAULT   N compare_and_swap_is_available
+-    FUNC GLOBAL DEFAULT   N get_eflags
++  OBJECT GLOBAL DEFAULT UND _rtld_global
++    FUNC GLOBAL DEFAULT UND _setjmp
++    FUNC GLOBAL DEFAULT UND abort
++    FUNC   WEAK DEFAULT   N accept
++    FUNC GLOBAL DEFAULT UND calloc
++    FUNC   WEAK DEFAULT   N close
++    FUNC   WEAK DEFAULT   N connect
++     TLS GLOBAL DEFAULT UND errno
++    FUNC GLOBAL DEFAULT UND exit
++    FUNC GLOBAL DEFAULT UND fclose
++    FUNC   WEAK DEFAULT   N fcntl
++    FUNC   WEAK DEFAULT   N flockfile
++    FUNC GLOBAL DEFAULT UND fopen
++    FUNC GLOBAL DEFAULT   N fork
++    FUNC GLOBAL DEFAULT UND free
++    FUNC   WEAK DEFAULT   N fsync
++    FUNC   WEAK DEFAULT   N ftrylockfile
++    FUNC   WEAK DEFAULT   N funlockfile
++    FUNC GLOBAL DEFAULT UND getrlimit
++     TLS GLOBAL DEFAULT UND h_errno
++    FUNC GLOBAL DEFAULT UND link
+     FUNC GLOBAL DEFAULT   N longjmp
++    FUNC   WEAK DEFAULT   N lseek
++    FUNC   WEAK DEFAULT   N lseek64
++    FUNC GLOBAL DEFAULT UND malloc
++    FUNC GLOBAL DEFAULT UND memcpy
++    FUNC GLOBAL DEFAULT UND mempcpy
++    FUNC GLOBAL DEFAULT UND memset
++    FUNC GLOBAL DEFAULT UND mktemp
++    FUNC GLOBAL DEFAULT UND mmap
++    FUNC GLOBAL DEFAULT UND mprotect
++    FUNC   WEAK DEFAULT   N msync
++    FUNC GLOBAL DEFAULT UND munmap
++    FUNC   WEAK DEFAULT   N nanosleep
++    FUNC   WEAK DEFAULT   N open
++    FUNC   WEAK DEFAULT   N open64
++    FUNC   WEAK DEFAULT   N pause
++    FUNC   WEAK DEFAULT   N pread
++    FUNC   WEAK DEFAULT   N pread64
++    FUNC GLOBAL DEFAULT   N pthread_atfork
+     FUNC GLOBAL DEFAULT   N pthread_attr_destroy
++    FUNC GLOBAL DEFAULT   N pthread_attr_getaffinity_np
+     FUNC GLOBAL DEFAULT   N pthread_attr_getdetachstate
+-    FUNC   WEAK DEFAULT   N pthread_attr_getguardsize
++    FUNC GLOBAL DEFAULT   N pthread_attr_getguardsize
+     FUNC GLOBAL DEFAULT   N pthread_attr_getinheritsched
+     FUNC GLOBAL DEFAULT   N pthread_attr_getschedparam
+     FUNC GLOBAL DEFAULT   N pthread_attr_getschedpolicy
+     FUNC GLOBAL DEFAULT   N pthread_attr_getscope
+-    FUNC   WEAK DEFAULT   N pthread_attr_getstack
+-    FUNC   WEAK DEFAULT   N pthread_attr_getstacksize
++    FUNC GLOBAL DEFAULT   N pthread_attr_getstack
++    FUNC GLOBAL DEFAULT   N pthread_attr_getstackaddr
++    FUNC GLOBAL DEFAULT   N pthread_attr_getstacksize
+     FUNC GLOBAL DEFAULT   N pthread_attr_init
++    FUNC GLOBAL DEFAULT   N pthread_attr_setaffinity_np
+     FUNC GLOBAL DEFAULT   N pthread_attr_setdetachstate
+-    FUNC   WEAK DEFAULT   N pthread_attr_setguardsize
++    FUNC GLOBAL DEFAULT   N pthread_attr_setguardsize
+     FUNC GLOBAL DEFAULT   N pthread_attr_setinheritsched
+     FUNC GLOBAL DEFAULT   N pthread_attr_setschedparam
+     FUNC GLOBAL DEFAULT   N pthread_attr_setschedpolicy
+     FUNC GLOBAL DEFAULT   N pthread_attr_setscope
+-    FUNC   WEAK DEFAULT   N pthread_attr_setstack
+-    FUNC   WEAK DEFAULT   N pthread_attr_setstacksize
++    FUNC GLOBAL DEFAULT   N pthread_attr_setstack
++    FUNC GLOBAL DEFAULT   N pthread_attr_setstackaddr
++    FUNC GLOBAL DEFAULT   N pthread_attr_setstacksize
+     FUNC GLOBAL DEFAULT   N pthread_barrier_destroy
+     FUNC GLOBAL DEFAULT   N pthread_barrier_init
+     FUNC GLOBAL DEFAULT   N pthread_barrier_wait
+     FUNC GLOBAL DEFAULT   N pthread_barrierattr_destroy
++    FUNC GLOBAL DEFAULT   N pthread_barrierattr_getpshared
+     FUNC GLOBAL DEFAULT   N pthread_barrierattr_init
+     FUNC GLOBAL DEFAULT   N pthread_barrierattr_setpshared
+     FUNC GLOBAL DEFAULT   N pthread_cancel
+@@ -193,36 +178,49 @@
+     FUNC GLOBAL DEFAULT   N pthread_cond_timedwait
+     FUNC GLOBAL DEFAULT   N pthread_cond_wait
+     FUNC GLOBAL DEFAULT   N pthread_condattr_destroy
++    FUNC GLOBAL DEFAULT   N pthread_condattr_getclock
+     FUNC GLOBAL DEFAULT   N pthread_condattr_getpshared
+     FUNC GLOBAL DEFAULT   N pthread_condattr_init
++    FUNC GLOBAL DEFAULT   N pthread_condattr_setclock
+     FUNC GLOBAL DEFAULT   N pthread_condattr_setpshared
+     FUNC GLOBAL DEFAULT   N pthread_create
+     FUNC GLOBAL DEFAULT   N pthread_detach
+     FUNC GLOBAL DEFAULT   N pthread_equal
+     FUNC GLOBAL DEFAULT   N pthread_exit
++    FUNC GLOBAL DEFAULT   N pthread_getaffinity_np
+     FUNC GLOBAL DEFAULT   N pthread_getattr_np
+-    FUNC   WEAK DEFAULT   N pthread_getconcurrency
++    FUNC GLOBAL DEFAULT   N pthread_getconcurrency
++    FUNC GLOBAL DEFAULT   N pthread_getcpuclockid
+     FUNC GLOBAL DEFAULT   N pthread_getschedparam
+     FUNC GLOBAL DEFAULT   N pthread_getspecific
+     FUNC GLOBAL DEFAULT   N pthread_join
+     FUNC GLOBAL DEFAULT   N pthread_key_create
+     FUNC GLOBAL DEFAULT   N pthread_key_delete
+     FUNC GLOBAL DEFAULT   N pthread_kill
+-    FUNC   WEAK DEFAULT   N pthread_kill_other_threads_np
++    FUNC GLOBAL DEFAULT   N pthread_kill_other_threads_np
++    FUNC GLOBAL DEFAULT   N pthread_mutex_consistent_np
+     FUNC GLOBAL DEFAULT   N pthread_mutex_destroy
++    FUNC GLOBAL DEFAULT   N pthread_mutex_getprioceiling
+     FUNC GLOBAL DEFAULT   N pthread_mutex_init
+     FUNC GLOBAL DEFAULT   N pthread_mutex_lock
++    FUNC GLOBAL DEFAULT   N pthread_mutex_setprioceiling
+     FUNC GLOBAL DEFAULT   N pthread_mutex_timedlock
+     FUNC GLOBAL DEFAULT   N pthread_mutex_trylock
+     FUNC GLOBAL DEFAULT   N pthread_mutex_unlock
+     FUNC GLOBAL DEFAULT   N pthread_mutexattr_destroy
+     FUNC   WEAK DEFAULT   N pthread_mutexattr_getkind_np
+-    FUNC   WEAK DEFAULT   N pthread_mutexattr_getpshared
+-    FUNC   WEAK DEFAULT   N pthread_mutexattr_gettype
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_getprioceiling
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_getprotocol
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_getpshared
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_getrobust_np
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_gettype
+     FUNC GLOBAL DEFAULT   N pthread_mutexattr_init
+     FUNC   WEAK DEFAULT   N pthread_mutexattr_setkind_np
+-    FUNC   WEAK DEFAULT   N pthread_mutexattr_setpshared
+-    FUNC   WEAK DEFAULT   N pthread_mutexattr_settype
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_setprioceiling
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_setprotocol
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_setpshared
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_setrobust_np
++    FUNC GLOBAL DEFAULT   N pthread_mutexattr_settype
+     FUNC GLOBAL DEFAULT   N pthread_once
+     FUNC GLOBAL DEFAULT   N pthread_rwlock_destroy
+     FUNC GLOBAL DEFAULT   N pthread_rwlock_init
+@@ -240,27 +238,35 @@
+     FUNC GLOBAL DEFAULT   N pthread_rwlockattr_setkind_np
+     FUNC GLOBAL DEFAULT   N pthread_rwlockattr_setpshared
+     FUNC GLOBAL DEFAULT   N pthread_self
++    FUNC GLOBAL DEFAULT   N pthread_setaffinity_np
+     FUNC GLOBAL DEFAULT   N pthread_setcancelstate
+     FUNC GLOBAL DEFAULT   N pthread_setcanceltype
+-    FUNC   WEAK DEFAULT   N pthread_setconcurrency
+-    FUNC GLOBAL DEFAULT   N pthread_setegid_np
+-    FUNC GLOBAL DEFAULT   N pthread_seteuid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setgid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setregid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setresgid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setresuid_np
+-    FUNC GLOBAL DEFAULT   N pthread_setreuid_np
++    FUNC GLOBAL DEFAULT   N pthread_setconcurrency
+     FUNC GLOBAL DEFAULT   N pthread_setschedparam
++    FUNC GLOBAL DEFAULT   N pthread_setschedprio
+     FUNC GLOBAL DEFAULT   N pthread_setspecific
+-    FUNC GLOBAL DEFAULT   N pthread_setuid_np
+     FUNC GLOBAL DEFAULT   N pthread_sigmask
+-    FUNC   WEAK DEFAULT   N pthread_spin_destroy
+-    FUNC   WEAK DEFAULT   N pthread_spin_init
+-    FUNC   WEAK DEFAULT   N pthread_spin_lock
+-    FUNC   WEAK DEFAULT   N pthread_spin_trylock
+-    FUNC   WEAK DEFAULT   N pthread_spin_unlock
++    FUNC GLOBAL DEFAULT   N pthread_spin_destroy
++    FUNC GLOBAL DEFAULT   N pthread_spin_init
++    FUNC GLOBAL DEFAULT   N pthread_spin_lock
++    FUNC GLOBAL DEFAULT   N pthread_spin_trylock
++    FUNC GLOBAL DEFAULT   N pthread_spin_unlock
+     FUNC GLOBAL DEFAULT   N pthread_testcancel
++    FUNC GLOBAL DEFAULT   N pthread_timedjoin_np
++    FUNC GLOBAL DEFAULT   N pthread_tryjoin_np
++    FUNC GLOBAL DEFAULT   N pthread_yield
++    FUNC   WEAK DEFAULT   N pwrite
++    FUNC   WEAK DEFAULT   N pwrite64
+     FUNC GLOBAL DEFAULT   N raise
++    FUNC   WEAK DEFAULT   N read
++    FUNC GLOBAL DEFAULT UND realloc
++    FUNC   WEAK DEFAULT   N recv
++    FUNC   WEAK DEFAULT   N recvfrom
++    FUNC   WEAK DEFAULT   N recvmsg
++    FUNC GLOBAL DEFAULT UND sched_get_priority_max
++    FUNC GLOBAL DEFAULT UND sched_get_priority_min
++    FUNC GLOBAL DEFAULT UND sched_setparam
++    FUNC GLOBAL DEFAULT UND sched_yield
+     FUNC GLOBAL DEFAULT   N sem_close
+     FUNC GLOBAL DEFAULT   N sem_destroy
+     FUNC GLOBAL DEFAULT   N sem_getvalue
+@@ -271,8 +277,23 @@
+     FUNC GLOBAL DEFAULT   N sem_trywait
+     FUNC GLOBAL DEFAULT   N sem_unlink
+     FUNC GLOBAL DEFAULT   N sem_wait
+-    FUNC GLOBAL DEFAULT   N set_eflags
+-    FUNC GLOBAL DEFAULT   N sigaction
+-    FUNC GLOBAL DEFAULT   N siglongjmp
+-    FUNC GLOBAL DEFAULT   N sigwait
+-    FUNC GLOBAL DEFAULT   N testandset
++    FUNC   WEAK DEFAULT   N send
++    FUNC   WEAK DEFAULT   N sendmsg
++    FUNC   WEAK DEFAULT   N sendto
++    FUNC   WEAK DEFAULT   N sigaction
++    FUNC   WEAK DEFAULT   N siglongjmp
++    FUNC   WEAK DEFAULT   N sigwait
++    FUNC GLOBAL DEFAULT UND sscanf
++    FUNC GLOBAL DEFAULT UND strcmp
++    FUNC GLOBAL DEFAULT UND strlen
++    FUNC GLOBAL DEFAULT   N system
++    FUNC   WEAK DEFAULT   N tcdrain
++    FUNC GLOBAL DEFAULT UND tdelete
++    FUNC GLOBAL DEFAULT UND tfind
++    FUNC GLOBAL DEFAULT UND tsearch
++    FUNC GLOBAL DEFAULT UND twalk
++    FUNC GLOBAL DEFAULT UND unlink
++    FUNC   WEAK DEFAULT   N vfork
++    FUNC   WEAK DEFAULT   N wait
++    FUNC   WEAK DEFAULT   N waitpid
++    FUNC   WEAK DEFAULT   N write
+
+
+And uclibc_unrefd.lst is:
+
+__compare_and_swap
+__flockfilelist
+__fresetlockfiles
+__funlockfilelist
+__linuxthreads_create_event
+__linuxthreads_death_event
+__linuxthreads_initial_report_events
+__linuxthreads_pthread_key_2ndlevel_size
+__linuxthreads_pthread_keys_max
+__linuxthreads_pthread_sizeof_descr
+__linuxthreads_pthread_threads_max
+__linuxthreads_reap_event
+__linuxthreads_version
+__pthread_alt_lock
+__pthread_alt_timedlock
+__pthread_alt_unlock
+__pthread_attr_destroy
+__pthread_attr_getdetachstate
+__pthread_attr_getguardsize
+__pthread_attr_getinheritsched
+__pthread_attr_getschedparam
+__pthread_attr_getschedpolicy
+__pthread_attr_getscope
+__pthread_attr_getstack
+__pthread_attr_getstacksize
+__pthread_attr_init
+__pthread_attr_setdetachstate
+__pthread_attr_setguardsize
+__pthread_attr_setinheritsched
+__pthread_attr_setschedparam
+__pthread_attr_setschedpolicy
+__pthread_attr_setscope
+__pthread_attr_setstack
+__pthread_attr_setstacksize
+__pthread_barrierattr_getpshared
+__pthread_compare_and_swap
+__pthread_cond_broadcast
+__pthread_cond_destroy
+__pthread_cond_init
+__pthread_cond_signal
+__pthread_cond_timedwait
+__pthread_cond_wait
+__pthread_condattr_destroy
+__pthread_condattr_init
+__pthread_create
+__pthread_destroy_specifics
+__pthread_do_exit
+__pthread_equal
+__pthread_exit_code
+__pthread_exit_requested
+__pthread_find_self
+__pthread_functions
+__pthread_getconcurrency
+__pthread_getschedparam
+__pthread_getspecific
+__pthread_handles
+__pthread_handles_num
+__pthread_has_cas
+__pthread_init_max_stacksize
+__pthread_initial_thread
+__pthread_initial_thread_bos
+__pthread_initialize_manager
+__pthread_internal_tsd_address
+__pthread_internal_tsd_get
+__pthread_internal_tsd_set
+__pthread_key_create
+__pthread_kill_other_threads_np
+__pthread_last_event
+__pthread_lock
+__pthread_main_thread
+__pthread_manager
+__pthread_manager_adjust_prio
+__pthread_manager_event
+__pthread_manager_reader
+__pthread_manager_request
+__pthread_manager_sighandler
+__pthread_manager_thread
+__pthread_manager_thread_bos
+__pthread_manager_thread_tos
+__pthread_max_stacksize
+__pthread_mutex_destroy
+__pthread_mutex_timedlock
+__pthread_mutexattr_destroy
+__pthread_mutexattr_getkind_np
+__pthread_mutexattr_getpshared
+__pthread_mutexattr_gettype
+__pthread_mutexattr_init
+__pthread_mutexattr_setkind_np
+__pthread_mutexattr_setpshared
+__pthread_mutexattr_settype
+__pthread_nonstandard_stacks
+__pthread_null_sighandler
+__pthread_offsetof_descr
+__pthread_offsetof_pid
+__pthread_once_fork_child
+__pthread_once_fork_parent
+__pthread_once_fork_prepare
+__pthread_perform_cleanup
+__pthread_raise
+__pthread_reset_main_thread
+__pthread_restart_new
+__pthread_rwlock_destroy
+__pthread_rwlock_init
+__pthread_rwlock_rdlock
+__pthread_rwlock_timedrdlock
+__pthread_rwlock_timedwrlock
+__pthread_rwlock_tryrdlock
+__pthread_rwlock_trywrlock
+__pthread_rwlock_unlock
+__pthread_rwlock_wrlock
+__pthread_rwlockattr_destroy
+__pthread_self
+__pthread_setcancelstate
+__pthread_setcanceltype
+__pthread_setconcurrency
+__pthread_setschedparam
+__pthread_setspecific
+__pthread_sig_cancel
+__pthread_sig_debug
+__pthread_sig_restart
+__pthread_sigaction
+__pthread_sighandler
+__pthread_sighandler_rt
+__pthread_sigwait
+__pthread_sizeof_handle
+__pthread_smp_kernel
+__pthread_spin_destroy
+__pthread_spin_init
+__pthread_spin_lock
+__pthread_spin_trylock
+__pthread_spin_unlock
+__pthread_thread_self
+__pthread_threads_debug
+__pthread_threads_events
+__pthread_threads_max
+__pthread_timedsuspend_new
+__pthread_unlock
+__pthread_wait_for_restart_signal
+__register_atfork
+__sigaction
+__sighandler
+compare_and_swap_is_available
+get_eflags
+pthread_attr_getguardsize
+pthread_attr_getstack
+pthread_attr_getstacksize
+pthread_attr_setguardsize
+pthread_attr_setstack
+pthread_attr_setstacksize
+pthread_barrier_destroy
+pthread_barrier_init
+pthread_barrier_wait
+pthread_barrierattr_destroy
+pthread_barrierattr_init
+pthread_barrierattr_setpshared
+pthread_cancel
+pthread_condattr_getpshared
+pthread_condattr_setpshared
+pthread_create
+pthread_detach
+pthread_getattr_np
+pthread_getconcurrency
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_kill
+pthread_kill_other_threads_np
+pthread_mutex_timedlock
+pthread_mutexattr_destroy
+pthread_mutexattr_getkind_np
+pthread_mutexattr_getpshared
+pthread_mutexattr_gettype
+pthread_mutexattr_init
+pthread_mutexattr_setkind_np
+pthread_mutexattr_setpshared
+pthread_mutexattr_settype
+pthread_rwlock_destroy
+pthread_rwlock_init
+pthread_rwlock_rdlock
+pthread_rwlock_timedrdlock
+pthread_rwlock_timedwrlock
+pthread_rwlock_tryrdlock
+pthread_rwlock_trywrlock
+pthread_rwlock_unlock
+pthread_rwlock_wrlock
+pthread_rwlockattr_destroy
+pthread_rwlockattr_getkind_np
+pthread_rwlockattr_getpshared
+pthread_rwlockattr_init
+pthread_rwlockattr_setkind_np
+pthread_rwlockattr_setpshared
+pthread_setconcurrency
+pthread_setegid_np
+pthread_seteuid_np
+pthread_setgid_np
+pthread_setregid_np
+pthread_setresgid_np
+pthread_setresuid_np
+pthread_setreuid_np
+pthread_setspecific
+pthread_setuid_np
+pthread_sigmask
+pthread_spin_destroy
+pthread_spin_init
+pthread_spin_lock
+pthread_spin_trylock
+pthread_spin_unlock
+pthread_testcancel
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_post
+sem_timedwait
+sem_trywait
+sem_unlink
+sem_wait
+set_eflags
+testandset

 ------------------------------------------------------------------------
r25650 | vapier | 2009-03-14 06:30:56 -0500 (Sat, 14 Mar 2009) | 1 line
Changed paths:
   M /trunk/uClibc/extra/Configs/Config.in

default linux-2.4 module support to off for Blackfin targets
 ------------------------------------------------------------------------

Index: extra/Configs/Config.in
===================================================================
--- extra/Configs/Config.in	(revision 25649)
+++ extra/Configs/Config.in	(revision 25650)
@@ -790,12 +790,13 @@
 
 config UCLIBC_LINUX_MODULE_24
 	bool "Linux kernel module functions"
-	default y
+	default !(TARGET_bfin)
 	help
 	  create_module, query_module
 	  are used in linux (prior to 2.6) for loadable kernel modules.
 
-	  Say N if you do not use kernel modules.
+	  Say N if you do not use kernel modules, or you only support
+	  Linux 2.6+.
 
 config UCLIBC_LINUX_SPECIFIC
 	bool "Linux specific functions"

 ------------------------------------------------------------------------
r25649 | vapier | 2009-03-14 06:23:28 -0500 (Sat, 14 Mar 2009) | 1 line
Changed paths:
   M /trunk/uClibc/extra/Configs/Config.in.arch

force DOPIC for FDPIC ELF targets
 ------------------------------------------------------------------------

Index: extra/Configs/Config.in.arch
===================================================================
--- extra/Configs/Config.in.arch	(revision 25648)
+++ extra/Configs/Config.in.arch	(revision 25649)
@@ -16,6 +16,7 @@
 config UCLIBC_FORMAT_FDPIC_ELF
 	bool "FDPIC ELF"
 	depends on !ARCH_USE_MMU
+	select DOPIC
 config UCLIBC_FORMAT_FLAT
 	bool "STATIC FLAT"
 	depends on !ARCH_USE_MMU

 ------------------------------------------------------------------------
r25642 | vapier | 2009-03-13 01:17:48 -0500 (Fri, 13 Mar 2009) | 1 line
Changed paths:
   M /trunk/uClibc/libc/sysdeps/linux/common/select.c

add GNU extension for select timeouts where the sub-second field is actually longer than one second
 ------------------------------------------------------------------------

Index: libc/sysdeps/linux/common/select.c
===================================================================
--- libc/sysdeps/linux/common/select.c	(revision 25641)
+++ libc/sysdeps/linux/common/select.c	(revision 25642)
@@ -9,9 +9,12 @@
 
 #include 
 #include 
+#include 
 
 extern __typeof(select) __libc_select;
 
+#define USEC_PER_SEC 1000000L
+
 #if !defined(__NR__newselect) && !defined(__NR_select) && defined __USE_XOPEN2K
 # define __NR___libc_pselect6 __NR_pselect6
 _syscall6(int, __libc_pselect6, int, n, fd_set *, readfds, fd_set *, writefds,
@@ -23,10 +26,26 @@
 {
 	struct timespec _ts, *ts = 0;
 	if (timeout) {
+		uint32_t usec;
 		_ts.tv_sec = timeout->tv_sec;
-		_ts.tv_nsec = timeout->tv_usec * 1000;
+
+		/* GNU extension: allow for timespec values where the sub-sec
+		 * field is equal to or more than 1 second.  The kernel will
+		 * reject this on us, so take care of the time shift ourself.
+		 * Some applications (like readline and linphone) do this.
+		 * See 'clarification on select() type calls and invalid timeouts'
+		 * on the POSIX general list for more information.
+		 */
+		usec = timeout->tv_usec;
+		if (usec >= USEC_PER_SEC) {
+			_ts.tv_sec += usec / USEC_PER_SEC;
+			usec %= USEC_PER_SEC;
+		}
+		_ts.tv_nsec = usec * 1000;
+
 		ts = &_ts;
 	}
+
 	return __libc_pselect6(n, readfds, writefds, exceptfds, ts, 0);
 }
 

 ------------------------------------------------------------------------
r25640 | vda | 2009-03-12 18:04:19 -0500 (Thu, 12 Mar 2009) | 3 lines
Changed paths:
   A /trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm
   A /trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
   A /trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S

add linuxthreads support for arm. By Will Newton (will.newton AT gmail.com)


 ------------------------------------------------------------------------

Index: libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
===================================================================
--- libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h	(revision 0)
+++ libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h	(revision 25640)
@@ -0,0 +1,130 @@
+/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Phil Blundell , 2003.
+
+   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 
+#include 
+#ifndef __ASSEMBLER__
+# include 
+#endif
+
+#if !defined NOT_IN_libc || defined IS_IN_libpthread
+
+/* We push lr onto the stack, so we have to use ldmib instead of ldmia
+   to find the saved arguments.  */
+# ifdef PIC
+#  undef DOARGS_5
+#  undef DOARGS_6
+#  undef DOARGS_7
+#  define DOARGS_5 str r4, [sp, $-4]!; ldr r4, [sp, $8];
+#  define DOARGS_6 mov ip, sp; stmfd sp!, {r4, r5}; ldmib ip, {r4, r5};
+#  define DOARGS_7 mov ip, sp; stmfd sp!, {r4, r5, r6}; ldmib ip, {r4, r5, r6};
+# endif
+
+# undef PSEUDO_RET
+# define PSEUDO_RET						        \
+    ldrcc pc, [sp], $4;						        \
+    ldr	lr, [sp], $4;							\
+    b PLTJMP(SYSCALL_ERROR)
+
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args)				\
+  .section ".text";							\
+    PSEUDO_PROLOGUE;							\
+  ENTRY (name);								\
+    SINGLE_THREAD_P;							\
+    bne .Lpseudo_cancel;						\
+    DO_CALL (syscall_name, args);					\
+    cmn r0, $4096;							\
+    RETINSTR(cc, lr);							\
+    b PLTJMP(SYSCALL_ERROR);						\
+  .Lpseudo_cancel:							\
+    str lr, [sp, $-4]!;							\
+    DOCARGS_##args;	/* save syscall args around CENABLE.  */	\
+    CENABLE;								\
+    mov ip, r0;		/* put mask in safe place.  */			\
+    UNDOCARGS_##args;	/* restore syscall args.  */			\
+    swi SYS_ify (syscall_name);	/* do the call.  */			\
+    str r0, [sp, $-4]!; /* save syscall return value.  */		\
+    mov r0, ip;		/* get mask back.  */				\
+    CDISABLE;								\
+    ldr r0, [sp], $4;	/* retrieve return value.  */			\
+    UNDOC2ARGS_##args;	/* fix register damage.  */			\
+    cmn r0, $4096;
+
+# define DOCARGS_0
+# define UNDOCARGS_0
+# define UNDOC2ARGS_0
+
+# define DOCARGS_1	str r0, [sp, #-4]!;
+# define UNDOCARGS_1	ldr r0, [sp], #4;
+# define UNDOC2ARGS_1
+
+# define DOCARGS_2	str r1, [sp, #-4]!; str r0, [sp, #-4]!;
+# define UNDOCARGS_2	ldr r0, [sp], #4; ldr r1, [sp], #4;
+# define UNDOC2ARGS_2
+
+# define DOCARGS_3	str r2, [sp, #-4]!; str r1, [sp, #-4]!; str r0, [sp, #-4]!;
+# define UNDOCARGS_3	ldr r0, [sp], #4; ldr r1, [sp], #4; ldr r2, [sp], #4
+# define UNDOC2ARGS_3
+
+# define DOCARGS_4	stmfd sp!, {r0-r3}
+# define UNDOCARGS_4	ldmfd sp!, {r0-r3}
+# define UNDOC2ARGS_4
+
+# define DOCARGS_5	stmfd sp!, {r0-r3}
+# define UNDOCARGS_5	ldmfd sp, {r0-r3}; str r4, [sp, #-4]!; ldr r4, [sp, #24]
+# define UNDOC2ARGS_5   ldr r4, [sp], #20
+
+# ifdef IS_IN_libpthread
+#  define CENABLE	bl PLTJMP(__pthread_enable_asynccancel)
+#  define CDISABLE	bl PLTJMP(__pthread_disable_asynccancel)
+#  define __local_multiple_threads __pthread_multiple_threads
+# else
+#  define CENABLE	bl PLTJMP(__libc_enable_asynccancel)
+#  define CDISABLE	bl PLTJMP(__libc_disable_asynccancel)
+#  define __local_multiple_threads __libc_multiple_threads
+# endif
+
+# ifndef __ASSEMBLER__
+extern int __local_multiple_threads attribute_hidden;
+#  define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
+# else
+#  if !defined PIC
+#   define SINGLE_THREAD_P						\
+  ldr ip, =__local_multiple_threads;					\
+  ldr ip, [ip];								\
+  teq ip, #0;
+#   define PSEUDO_PROLOGUE
+#  else
+#   define SINGLE_THREAD_P						\
+  ldr ip, 1b;								\
+2:									\
+  ldr ip, [pc, ip];							\
+  teq ip, #0;
+#   define PSEUDO_PROLOGUE						\
+  1:  .word __local_multiple_threads - 2f - 8;
+#  endif
+# endif
+
+#elif !defined __ASSEMBLER__
+
+/* This code should never be used but we define it anyhow.  */
+# define SINGLE_THREAD_P (1)
+
+#endif
Index: libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S
===================================================================
--- libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S	(revision 0)
+++ libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S	(revision 25640)
@@ -0,0 +1,78 @@
+/* Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Philip Blundell .
+
+   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 
+#define _ERRNO_H	1
+#include 
+#include 
+
+/* Clone the calling process, but without copying the whole address space.
+   The calling process is suspended until the new process exits or is
+   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
+   and the process ID of the new process to the old process.  */
+
+ENTRY (__vfork)
+
+#ifdef __NR_vfork
+
+#ifdef SHARED
+	ldr	ip, 1f
+	ldr	r0, 2f
+3:	add	ip, pc, ip
+	ldr	r0, [ip, r0]
+#else
+	ldr	r0, 1f
+#endif
+	movs	r0, r0
+	bne	HIDDEN_JUMPTARGET (__fork)
+
+	DO_CALL (vfork, 0)
+	cmn	a1, #4096
+	RETINSTR(cc, lr)
+
+#ifndef __ASSUME_VFORK_SYSCALL
+	/* Check if vfork syscall is known at all.  */
+	cmn	a1, #ENOSYS
+	bne	PLTJMP(C_SYMBOL_NAME(__syscall_error))
+#endif
+
+#endif
+
+#ifndef __ASSUME_VFORK_SYSCALL
+	/* If we don't have vfork, fork is close enough.  */
+	DO_CALL (fork, 0)
+	cmn	a1, #4096
+	RETINSTR(cc, lr)
+#elif !defined __NR_vfork
+# error "__NR_vfork not available and __ASSUME_VFORK_SYSCALL defined"
+#endif
+    	b	PLTJMP(C_SYMBOL_NAME(__syscall_error))
+
+#ifdef SHARED
+1:	.word	_GLOBAL_OFFSET_TABLE_ - 3b - 8
+2:	.word	__libc_pthread_functions(GOTOFF)
+#else
+	.weak	pthread_create
+1:	.word	pthread_create
+#endif
+
+PSEUDO_END (__vfork)
+libc_hidden_def (__vfork)
+
+weak_alias (__vfork, vfork)

 ------------------------------------------------------------------------
r25638 | vda | 2009-03-12 15:56:59 -0500 (Thu, 12 Mar 2009) | 10 lines
Changed paths:
   M /trunk/uClibc/libpthread/linuxthreads/descr.h
   M /trunk/uClibc/libpthread/linuxthreads/manager.c
   M /trunk/uClibc/libpthread/linuxthreads/pthread.c
   M /trunk/uClibc/libpthread/linuxthreads/specific.c
   M /trunk/uClibc/libpthread/linuxthreads/spinlock.c
   M /trunk/uClibc/libpthread/linuxthreads/spinlock.h
   M /trunk/uClibc/libpthread/linuxthreads/sysdeps/i386/tls.h

linuxthreads fixes from Will Newton (will.newton AT gmail.com):
* share Sys V semaphores in order to get appropriate SEM_UNDO semantics.
* correct guardaddr in pthread_free() for TLS case
* move spinlock unlocking before restart()
* When exit was called from a signal handler, the restart
  from the manager processing the exit request instead restarted the thread
  in pthread_cond_timedwait.
  (see http://sources.redhat.com/ml/libc-ports/2006-05/msg00000.html)


 ------------------------------------------------------------------------

Index: libpthread/linuxthreads/manager.c
===================================================================
--- libpthread/linuxthreads/manager.c	(revision 25637)
+++ libpthread/linuxthreads/manager.c	(revision 25638)
@@ -742,15 +742,15 @@
 	  pid = __clone2(pthread_start_thread_event,
   		 (void **)new_thread_bottom,
 			 (char *)stack_addr - new_thread_bottom,
-			 CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+			 CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
 			 __pthread_sig_cancel, new_thread);
 #elif _STACK_GROWS_UP
 	  pid = __clone(pthread_start_thread_event, (void *) new_thread_bottom,
-			CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+			CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
 			__pthread_sig_cancel, new_thread);
 #else
 	  pid = __clone(pthread_start_thread_event, stack_addr,
-			CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+			CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
 			__pthread_sig_cancel, new_thread);
 #endif
 	  saved_errno = errno;
@@ -783,15 +783,15 @@
       pid = __clone2(pthread_start_thread,
 		     (void **)new_thread_bottom,
                      (char *)stack_addr - new_thread_bottom,
-		     CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+		     CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
 		     __pthread_sig_cancel, new_thread);
 #elif _STACK_GROWS_UP
       pid = __clone(pthread_start_thread, (void *) new_thread_bottom,
-		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
 		    __pthread_sig_cancel, new_thread);
 #else
       pid = __clone(pthread_start_thread, stack_addr,
-		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
+		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM |
 		    __pthread_sig_cancel, new_thread);
 #endif /* !NEED_SEPARATE_REGISTER_STACK */
       saved_errno = errno;
@@ -892,10 +892,11 @@
 #ifdef _STACK_GROWS_UP
 # ifdef USE_TLS
       size_t stacksize = guardaddr - th->p_stackaddr;
+      guardaddr = th->p_stackaddr;
 # else
       size_t stacksize = guardaddr - (char *)th;
+      guardaddr = (char *)th;
 # endif
-      guardaddr = (char *)th;
 #else
       /* Guardaddr is always set, even if guardsize is 0.  This allows
 	 us to compute everything else.  */
Index: libpthread/linuxthreads/spinlock.c
===================================================================
--- libpthread/linuxthreads/spinlock.c	(revision 25637)
+++ libpthread/linuxthreads/spinlock.c	(revision 25638)
@@ -637,8 +637,20 @@
 #if defined HAS_COMPARE_AND_SWAP
 	wait_node_dequeue(pp_head, pp_max_prio, p_max_prio);
 #endif
+
+      /* Release the spinlock *before* restarting.  */
+#if defined TEST_FOR_COMPARE_AND_SWAP
+      if (!__pthread_has_cas)
+#endif
+#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP
+	{
+	  __pthread_release(&lock->__spinlock);
+	}
+#endif
+
       restart(p_max_prio->thr);
-      break;
+
+      return;
     }
   }
 
Index: libpthread/linuxthreads/specific.c
===================================================================
--- libpthread/linuxthreads/specific.c	(revision 25637)
+++ libpthread/linuxthreads/specific.c	(revision 25638)
@@ -104,13 +104,14 @@
      that if the key is reallocated later by pthread_key_create, its
      associated values will be NULL in all threads.
 
-     If no threads have been created yet, clear it just in the
-     current thread.  */
+     If no threads have been created yet, or if we are exiting, clear
+     it just in the current thread.  */
 
   struct pthread_key_delete_helper_args args;
   args.idx1st = key / PTHREAD_KEY_2NDLEVEL_SIZE;
   args.idx2nd = key % PTHREAD_KEY_2NDLEVEL_SIZE;
-  if (__pthread_manager_request != -1)
+  if (__pthread_manager_request != -1
+      && !(__builtin_expect (__pthread_exit_requested, 0)))
     {
       struct pthread_request request;
 
@@ -203,8 +204,9 @@
   __pthread_lock(THREAD_GETMEM(self, p_lock), self);
   for (i = 0; i < PTHREAD_KEY_1STLEVEL_SIZE; i++) {
     if (THREAD_GETMEM_NC(self, p_specific[i]) != NULL) {
-      free(THREAD_GETMEM_NC(self, p_specific[i]));
+      void *p = THREAD_GETMEM_NC(self, p_specific[i]);
       THREAD_SETMEM_NC(self, p_specific[i], NULL);
+      free(p);
     }
   }
   __pthread_unlock(THREAD_GETMEM(self, p_lock));
Index: libpthread/linuxthreads/spinlock.h
===================================================================
--- libpthread/linuxthreads/spinlock.h	(revision 25637)
+++ libpthread/linuxthreads/spinlock.h	(revision 25638)
@@ -172,7 +172,8 @@
 
 /* Operations on pthread_atomic, which is defined in internals.h */
 
-static __inline__ long atomic_increment(struct pthread_atomic *pa)
+static __inline__ long
+pthread_atomic_increment (struct pthread_atomic *pa)
 {
     long oldval;
 
@@ -184,7 +185,8 @@
 }
 
 
-static __inline__ long atomic_decrement(struct pthread_atomic *pa)
+static __inline__ long
+pthread_atomic_decrement (struct pthread_atomic *pa)
 {
     long oldval;
 
Index: libpthread/linuxthreads/pthread.c
===================================================================
--- libpthread/linuxthreads/pthread.c	(revision 25637)
+++ libpthread/linuxthreads/pthread.c	(revision 25638)
@@ -740,17 +740,17 @@
 	  pid = __clone2(__pthread_manager_event,
 			 (void **) __pthread_manager_thread_bos,
 			 THREAD_MANAGER_STACK_SIZE,
-			 CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
+			 CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM,
 			 mgr);
 #elif _STACK_GROWS_UP
 	  pid = __clone(__pthread_manager_event,
 			(void **) __pthread_manager_thread_bos,
-			CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
+			CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM,
 			mgr);
 #else
 	  pid = __clone(__pthread_manager_event,
 			(void **) __pthread_manager_thread_tos,
-			CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
+			CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM,
 			mgr);
 #endif
 
@@ -780,13 +780,13 @@
 #ifdef NEED_SEPARATE_REGISTER_STACK
       pid = __clone2(__pthread_manager, (void **) __pthread_manager_thread_bos,
 		     THREAD_MANAGER_STACK_SIZE,
-		     CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, mgr);
+		     CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM, mgr);
 #elif _STACK_GROWS_UP
       pid = __clone(__pthread_manager, (void **) __pthread_manager_thread_bos,
-		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, mgr);
+		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM, mgr);
 #else
       pid = __clone(__pthread_manager, (void **) __pthread_manager_thread_tos,
-		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, mgr);
+		    CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_SYSVSEM, mgr);
 #endif
     }
   if (__builtin_expect (pid, 0) == -1) {
@@ -972,6 +972,10 @@
     struct pthread_request request;
     pthread_descr self = thread_self();
 
+    /* Make sure we come back here after suspend(), in case we entered
+       from a signal handler.  */
+    THREAD_SETMEM(self, p_signal_jmp, NULL);
+
     request.req_thread = self;
     request.req_kind = REQ_PROCESS_EXIT;
     request.req_args.exit.code = retcode;
@@ -1201,13 +1205,13 @@
 
 void __pthread_restart_old(pthread_descr th)
 {
-  if (atomic_increment(&th->p_resume_count) == -1)
+  if (pthread_atomic_increment(&th->p_resume_count) == -1)
     kill(th->p_pid, __pthread_sig_restart);
 }
 
 void __pthread_suspend_old(pthread_descr self)
 {
-  if (atomic_decrement(&self->p_resume_count) <= 0)
+  if (pthread_atomic_decrement(&self->p_resume_count) <= 0)
     __pthread_wait_for_restart_signal(self);
 }
 
@@ -1218,7 +1222,7 @@
   int was_signalled = 0;
   sigjmp_buf jmpbuf;
 
-  if (atomic_decrement(&self->p_resume_count) == 0) {
+  if (pthread_atomic_decrement(&self->p_resume_count) == 0) {
     /* Set up a longjmp handler for the restart signal, unblock
        the signal and sleep. */
 
@@ -1275,9 +1279,9 @@
      being delivered. */
 
   if (!was_signalled) {
-    if (atomic_increment(&self->p_resume_count) != -1) {
+    if (pthread_atomic_increment(&self->p_resume_count) != -1) {
       __pthread_wait_for_restart_signal(self);
-      atomic_decrement(&self->p_resume_count); /* should be zero now! */
+      pthread_atomic_decrement(&self->p_resume_count); /* should be zero now! */
       /* woke spontaneously and consumed restart signal */
       return 1;
     }
Index: libpthread/linuxthreads/descr.h
===================================================================
--- libpthread/linuxthreads/descr.h	(revision 25637)
+++ libpthread/linuxthreads/descr.h	(revision 25638)
@@ -123,9 +123,7 @@
       union dtv *dtvp;
       pthread_descr self;	/* Pointer to this structure */
       int multiple_threads;
-# ifdef NEED_DL_SYSINFO
       uintptr_t sysinfo;
-# endif
     } data;
     void *__padding[16];
   } p_header;
Index: libpthread/linuxthreads/sysdeps/i386/tls.h
===================================================================
--- libpthread/linuxthreads/sysdeps/i386/tls.h	(revision 25637)
+++ libpthread/linuxthreads/sysdeps/i386/tls.h	(revision 25638)
@@ -46,9 +46,7 @@
   dtv_t *dtv;
   void *self;		/* Pointer to the thread descriptor.  */
   int multiple_threads;
-#ifdef NEED_DL_SYSINFO
   uintptr_t sysinfo;
-#endif
 } tcbhead_t;
 
 #else /* __ASSEMBLER__ */

 ------------------------------------------------------------------------
r25595 | vda | 2009-03-10 09:42:54 -0500 (Tue, 10 Mar 2009) | 6 lines
Changed paths:
   M /trunk/uClibc/libc/inet/resolv.c

resolver:
res_query: do not unconditionally set h_errno to TRY_AGAIN (closes bug 173).
cleanups: s/__dn_expand/dn_expand/, remove superfluous dn_expand declaration,
remove libc_hidden_proto junk


 ------------------------------------------------------------------------

Index: libc/inet/resolv.c
===================================================================
--- libc/inet/resolv.c	(revision 25594)
+++ libc/inet/resolv.c	(revision 25595)
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
 /* resolv.c: DNS Resolver
  *
  * Copyright (C) 1998  Kenneth Albanowski ,
@@ -173,61 +174,6 @@
 # define USE_SELECT
 #endif
 
-/* Experimentally off - libc_hidden_proto(memcpy) */
-/* Experimentally off - libc_hidden_proto(memset) */
-/* Experimentally off - libc_hidden_proto(memmove) */
-/* Experimentally off - libc_hidden_proto(strchr) */
-/* Experimentally off - libc_hidden_proto(strcmp) */
-/* Experimentally off - libc_hidden_proto(strcpy) */
-/* Experimentally off - libc_hidden_proto(strdup) */
-/* Experimentally off - libc_hidden_proto(strlen) */
-/* Experimentally off - libc_hidden_proto(strncat) */
-/* Experimentally off - libc_hidden_proto(strncpy) */
-/* libc_hidden_proto(strnlen) */
-/* Experimentally off - libc_hidden_proto(strstr) */
-/* Experimentally off - libc_hidden_proto(strcasecmp) */
-/* libc_hidden_proto(socket) */
-/* libc_hidden_proto(close) */
-/* libc_hidden_proto(fopen) */
-/* libc_hidden_proto(fclose) */
-/* libc_hidden_proto(random) */
-/* libc_hidden_proto(getservbyport) */
-/* libc_hidden_proto(gethostname) */
-/* libc_hidden_proto(uname) */
-/* libc_hidden_proto(inet_addr) */
-/* libc_hidden_proto(inet_aton) */
-/* libc_hidden_proto(inet_pton) */
-/* libc_hidden_proto(inet_ntop) */
-/* libc_hidden_proto(connect) */
-/* libc_hidden_proto(poll) */
-/* libc_hidden_proto(select) */
-/* libc_hidden_proto(recv) */
-/* libc_hidden_proto(send) */
-/* libc_hidden_proto(printf) */
-/* libc_hidden_proto(sprintf) */
-/* libc_hidden_proto(snprintf) */
-/* libc_hidden_proto(fgets) */
-/* libc_hidden_proto(getnameinfo) */
-/* libc_hidden_proto(gethostbyname) */
-/* libc_hidden_proto(gethostbyname_r) */
-/* libc_hidden_proto(gethostbyname2_r) */
-/* libc_hidden_proto(gethostbyaddr) */
-/* libc_hidden_proto(gethostbyaddr_r) */
-/* libc_hidden_proto(ns_name_uncompress) */
-/* libc_hidden_proto(ns_name_unpack) */
-/* libc_hidden_proto(ns_name_ntop) */
-/* libc_hidden_proto(res_init) */
-/* libc_hidden_proto(res_query) */
-/* libc_hidden_proto(res_querydomain) */
-/* libc_hidden_proto(gethostent_r) */
-/* libc_hidden_proto(fprintf) */
-/* libc_hidden_proto(__h_errno_location) */
-#ifdef __UCLIBC_HAS_XLOCALE__
-/* libc_hidden_proto(__ctype_b_loc) */
-#elif defined __UCLIBC_HAS_CTYPE_TABLES__
-/* libc_hidden_proto(__ctype_b) */
-#endif
-
 #if defined __UCLIBC_HAS_IPV4__ && defined __UCLIBC_HAS_IPV6__
 #define IF_HAS_BOTH(...) __VA_ARGS__
 #else
@@ -364,8 +310,6 @@
 extern int __length_question(const unsigned char * const message, int offset) attribute_hidden;
 extern void __open_nameservers(void) attribute_hidden;
 extern void __close_nameservers(void) attribute_hidden;
-extern int __dn_expand(const u_char *, const u_char *, const u_char *,
-			char *, int);
 
 /*
  * Theory of operation.
@@ -2485,7 +2429,7 @@
  * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
  * Return size of compressed name or -1 if there was an error.
  */
-int __dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
+int dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
 				char *dst, int dstsiz)
 {
 	int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
@@ -2875,7 +2819,8 @@
 	i = __dns_lookup(dname, type, &packet, &a);
 
 	if (i < 0) {
-		h_errno = TRY_AGAIN;
+		if (!h_errno) /* TODO: can this ever happen? */
+			h_errno = TRY_AGAIN;
 		return -1;
 	}
 
@@ -3107,10 +3052,9 @@
 	return res_query(longname, class, type, answer, anslen);
 }
 libc_hidden_def(res_querydomain)
+#endif
+
+/* Unimplemented: */
 /* res_mkquery */
 /* res_send */
 /* dn_comp */
-/* dn_expand */
-#endif
-
-/* vi: set sw=4 ts=4: */

 ------------------------------------------------------------------------
r25556 | kraj | 2009-03-05 13:07:01 -0600 (Thu, 05 Mar 2009) | 1 line
Changed paths:
   A /trunk/uClibc/libc/sysdeps/linux/common/creat.c
   M /trunk/uClibc/libc/sysdeps/linux/common/open.c

Define creat in an independent file
 ------------------------------------------------------------------------

Index: libc/sysdeps/linux/common/creat.c
===================================================================
--- libc/sysdeps/linux/common/creat.c	(revision 0)
+++ libc/sysdeps/linux/common/creat.c	(revision 25556)
@@ -0,0 +1,15 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * creat() for uClibc
+ *
+ * Copyright (C) 2009 
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include 
+
+int creat(const char *file, mode_t mode)
+{
+	return open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
+}
Index: libc/sysdeps/linux/common/open.c
===================================================================
--- libc/sysdeps/linux/common/open.c	(revision 25555)
+++ libc/sysdeps/linux/common/open.c	(revision 25556)
@@ -37,8 +37,3 @@
 libc_hidden_weak(open)
 strong_alias(open,__libc_open)
 #endif
-
-int creat(const char *file, mode_t mode)
-{
-	return open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
-}

 ------------------------------------------------------------------------
r25540 | carmelo | 2009-03-05 07:28:55 -0600 (Thu, 05 Mar 2009) | 2 lines
Changed paths:
   M /trunk/uClibc/ldso/ldso/arm/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/bfin/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/cris/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/i386/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/m68k/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/mips/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/powerpc/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/sh/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/sh64/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/sparc/dl-sysdep.h
   M /trunk/uClibc/ldso/ldso/xtensa/dl-sysdep.h

Use __always_inline instead of __inline__

 ------------------------------------------------------------------------

Index: ldso/ldso/powerpc/dl-sysdep.h
===================================================================
--- ldso/ldso/powerpc/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/powerpc/dl-sysdep.h	(revision 25540)
@@ -85,7 +85,7 @@
 #define ELF_MACHINE_PLTREL_OVERLAP 1
 
 /* Return the value of the GOT pointer.  */
-static __inline__ Elf32_Addr * __attribute__ ((const))
+static __always_inline Elf32_Addr * __attribute__ ((const))
 ppc_got (void)
 {
 	Elf32_Addr *got;
@@ -104,14 +104,14 @@
 
 /* Return the link-time address of _DYNAMIC, stored as
    the first value in the GOT. */
-static __inline__ Elf32_Addr __attribute__ ((const))
+static __always_inline Elf32_Addr __attribute__ ((const))
 elf_machine_dynamic (void)
 {
 	return *ppc_got();
 }
 
 /* Return the run-time load address of the shared object.  */
-static __inline__ Elf32_Addr __attribute__ ((const))
+static __always_inline Elf32_Addr __attribute__ ((const))
 elf_machine_load_address (void)
 {
   Elf32_Addr *branchaddr;
@@ -159,7 +159,7 @@
   return runtime_dynamic - elf_machine_dynamic ();
 }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
 		      Elf32_Word relative_count)
 {
Index: ldso/ldso/arm/dl-sysdep.h
===================================================================
--- ldso/ldso/arm/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/arm/dl-sysdep.h	(revision 25540)
@@ -15,7 +15,7 @@
   GOT_BASE[1] = (unsigned long) MODULE; \
 }
 
-static __inline__ unsigned long arm_modulus(unsigned long m, unsigned long p)
+static __always_inline unsigned long arm_modulus(unsigned long m, unsigned long p)
 {
 	unsigned long i,t,inc;
 	i=p; t=0;
@@ -67,7 +67,7 @@
    first element of the GOT.  We used to use the PIC register to do this
    without a constant pool reference, but GCC 4.2 will use a pseudo-register
    for the PIC base, so it may not be in r10.  */
-static __inline__ Elf32_Addr __attribute__ ((unused))
+static __always_inline Elf32_Addr __attribute__ ((unused))
 elf_machine_dynamic (void)
 {
   Elf32_Addr dynamic;
@@ -99,7 +99,7 @@
 }
 
 /* Return the run-time load address of the shared object.  */
-static __inline__ Elf32_Addr __attribute__ ((unused))
+static __always_inline Elf32_Addr __attribute__ ((unused))
 elf_machine_load_address (void)
 {
 	extern void __dl_start __asm__ ("_dl_start");
@@ -123,7 +123,7 @@
 	return pcrel_addr - got_addr;
 }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
 		      Elf32_Word relative_count)
 {
Index: ldso/ldso/sh64/dl-sysdep.h
===================================================================
--- ldso/ldso/sh64/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/sh64/dl-sysdep.h	(revision 25540)
@@ -41,7 +41,7 @@
 /* Return the link-time address of _DYNAMIC.  Conveniently, this is the
    first element of the GOT.  This must be inlined in a function which
    uses global data.  */
-static __inline__ Elf32_Addr elf_machine_dynamic(void)
+static __always_inline Elf32_Addr elf_machine_dynamic(void)
 {
 	register Elf32_Addr *got;
 
@@ -69,7 +69,7 @@
 }
 
 /* Return the run-time load address of the shared object.  */
-static __inline__ Elf32_Addr elf_machine_load_address(void)
+static __always_inline Elf32_Addr elf_machine_load_address(void)
 {
 	Elf32_Addr addr;
 
@@ -122,7 +122,7 @@
 	}						\
 }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative(Elf32_Addr load_off, const Elf32_Addr rel_addr,
 		     Elf32_Word relative_count)
 {
Index: ldso/ldso/m68k/dl-sysdep.h
===================================================================
--- ldso/ldso/m68k/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/m68k/dl-sysdep.h	(revision 25540)
@@ -39,7 +39,7 @@
 /* Return the link-time address of _DYNAMIC.  Conveniently, this is the
    first element of the GOT.  This must be inlined in a function which
    uses global data.  */
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr
 elf_machine_dynamic (void)
 {
 	register Elf32_Addr *got __asm__ ("%a5");
@@ -48,7 +48,7 @@
 
 
 /* Return the run-time load address of the shared object.  */
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr
 elf_machine_load_address (void)
 {
 	Elf32_Addr addr;
@@ -58,7 +58,7 @@
 	return addr;
 }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
 		      Elf32_Word relative_count)
 {
Index: ldso/ldso/i386/dl-sysdep.h
===================================================================
--- ldso/ldso/i386/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/i386/dl-sysdep.h	(revision 25540)
@@ -37,8 +37,8 @@
 /* Return the link-time address of _DYNAMIC.  Conveniently, this is the
    first element of the GOT.  This must be inlined in a function which
    uses global data.  */
-static __inline__ Elf32_Addr elf_machine_dynamic (void) attribute_unused;
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr elf_machine_dynamic (void) attribute_unused;
+static __always_inline Elf32_Addr
 elf_machine_dynamic (void)
 {
 	register Elf32_Addr *got __asm__ ("%ebx");
@@ -47,8 +47,8 @@
 
 
 /* Return the run-time load address of the shared object.  */
-static __inline__ Elf32_Addr elf_machine_load_address (void) attribute_unused;
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr elf_machine_load_address (void) attribute_unused;
+static __always_inline Elf32_Addr
 elf_machine_load_address (void)
 {
 	/* It doesn't matter what variable this is, the reference never makes
@@ -61,7 +61,7 @@
 	return addr;
 }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
 		      Elf32_Word relative_count)
 {
Index: ldso/ldso/cris/dl-sysdep.h
===================================================================
--- ldso/ldso/cris/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/cris/dl-sysdep.h	(revision 25540)
@@ -37,7 +37,7 @@
      || ((type) == R_CRIS_GLOB_DAT)) * ELF_RTYPE_CLASS_PLT)	\
    | (((type) == R_CRIS_COPY) * ELF_RTYPE_CLASS_COPY))
 
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr
 elf_machine_dynamic(void)
 {
 	/* Don't just set this to an asm variable "r0" since that's not logical
@@ -59,7 +59,7 @@
    there's some other symbol we could use, that we don't *have* to force a
    GOT entry for.  */
 
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr
 elf_machine_load_address(void)
 {
 	Elf32_Addr gotaddr_diff;
@@ -93,7 +93,7 @@
 	return gotaddr_diff;
 }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative(Elf32_Addr load_off, const Elf32_Addr rel_addr,
                      Elf32_Word relative_count)
 {
Index: ldso/ldso/xtensa/dl-sysdep.h
===================================================================
--- ldso/ldso/xtensa/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/xtensa/dl-sysdep.h	(revision 25540)
@@ -85,7 +85,7 @@
   (((type) == R_XTENSA_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)
 
 /* Return the link-time address of _DYNAMIC.  */
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr
 elf_machine_dynamic (void)
 {
   /* This function is only used while bootstrapping the runtime linker.
@@ -95,7 +95,7 @@
 }
 
 /* Return the run-time load address of the shared object.  */
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr
 elf_machine_load_address (void)
 {
   Elf32_Addr addr, tmp;
@@ -116,7 +116,7 @@
   return addr - 3;
 }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
 		      Elf32_Word relative_count)
 {
Index: ldso/ldso/mips/dl-sysdep.h
===================================================================
--- ldso/ldso/mips/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/mips/dl-sysdep.h	(revision 25540)
@@ -169,7 +169,7 @@
 
 #define OFFSET_GP_GOT 0x7ff0
 
-static __inline__ ElfW(Addr) *
+static __always_inline ElfW(Addr) *
 elf_mips_got_from_gpreg (ElfW(Addr) gpreg)
 {
 	/* FIXME: the offset of gp from GOT may be system-dependent. */
@@ -179,7 +179,7 @@
 /* Return the link-time address of _DYNAMIC.  Conveniently, this is the
    first element of the GOT.  This must be inlined in a function which
    uses global data.  We assume its $gp points to the primary GOT.  */
-static __inline__ ElfW(Addr)
+static __always_inline ElfW(Addr)
 elf_machine_dynamic (void)
 {
 	register ElfW(Addr) gp __asm__ ("$28");
@@ -198,7 +198,7 @@
 #endif
 
 /* Return the run-time load address of the shared object.  */
-static __inline__ ElfW(Addr)
+static __always_inline ElfW(Addr)
 elf_machine_load_address (void)
 {
 	ElfW(Addr) addr;
@@ -214,7 +214,7 @@
 	return addr;
 }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative (ElfW(Addr) load_off, const ElfW(Addr) rel_addr,
 		      ElfW(Word) relative_count)
 {
Index: ldso/ldso/sparc/dl-sysdep.h
===================================================================
--- ldso/ldso/sparc/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/sparc/dl-sysdep.h	(revision 25540)
@@ -52,7 +52,7 @@
 
 #ifndef COMPILE_ASM
 /* Cheap modulo implementation, taken from arm/ld_sysdep.h. */
-static __inline__ unsigned long
+static __always_inline unsigned long
 sparc_mod(unsigned long m, unsigned long p)
 {
 	unsigned long i, t, inc;
@@ -118,7 +118,7 @@
 /* Return the link-time address of _DYNAMIC.  Conveniently, this is the
    first element of the GOT.  This must be inlined in a function which
    uses global data.  */
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr
 elf_machine_dynamic (void)
 {
 	register Elf32_Addr *got __asm__ ("%l7");
@@ -129,7 +129,7 @@
 }
 
 /* Return the run-time load address of the shared object.  */
-static __inline__ Elf32_Addr
+static __always_inline Elf32_Addr
 elf_machine_load_address (void)
 {
 	register Elf32_Addr *pc __asm__ ("%o7"), *got __asm__ ("%l7");
@@ -148,7 +148,7 @@
 	return (Elf32_Addr) got - *got + (pc[2] - pc[3]) * 4 - 4;
 }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
 		      Elf32_Word relative_count)
 {
Index: ldso/ldso/sh/dl-sysdep.h
===================================================================
--- ldso/ldso/sh/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/sh/dl-sysdep.h	(revision 25540)
@@ -25,7 +25,7 @@
 struct elf_resolve;
 extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
 
-static __inline__ unsigned int
+static __always_inline unsigned int
 _dl_urem(unsigned int n, unsigned int base)
 {
   int res;
@@ -95,7 +95,7 @@
 /* Return the link-time address of _DYNAMIC.  Conveniently, this is the
    first element of the GOT.  This must be inlined in a function which
    uses global data.  */
-static __inline__ Elf32_Addr __attribute__ ((unused))
+static __always_inline Elf32_Addr __attribute__ ((unused))
 elf_machine_dynamic (void)
 {
 	register Elf32_Addr *got;
@@ -104,7 +104,7 @@
 }
 
 /* Return the run-time load address of the shared object.  */
-static __inline__ Elf32_Addr __attribute__ ((unused))
+static __always_inline Elf32_Addr __attribute__ ((unused))
 elf_machine_load_address (void)
 {
 	Elf32_Addr addr;
@@ -146,7 +146,7 @@
     } \
   }
 
-static __inline__ void
+static __always_inline void
 elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
 		      Elf32_Word relative_count)
 {
Index: ldso/ldso/bfin/dl-sysdep.h
===================================================================
--- ldso/ldso/bfin/dl-sysdep.h	(revision 25539)
+++ ldso/ldso/bfin/dl-sysdep.h	(revision 25540)
@@ -210,7 +210,7 @@
 #endif
 
 #include 
-static __inline__ void
+static __always_inline void
 elf_machine_relative (DL_LOADADDR_TYPE load_off, const Elf32_Addr rel_addr,
 		      Elf32_Word relative_count)
 {

 ------------------------------------------------------------------------
r25539 | carmelo | 2009-03-05 07:08:35 -0600 (Thu, 05 Mar 2009) | 4 lines
Changed paths:
   M /trunk/uClibc/extra/Configs/Config.in.arch

Make long double support available for sh too.

Signed-off-by: Carmelo Amoroso 

 ------------------------------------------------------------------------

Index: extra/Configs/Config.in.arch
===================================================================
--- extra/Configs/Config.in.arch	(revision 25538)
+++ extra/Configs/Config.in.arch	(revision 25539)
@@ -174,7 +174,7 @@
 config UCLIBC_HAS_LONG_DOUBLE_MATH
 	bool "Enable long double support"
 	depends on DO_C99_MATH
-	depends on TARGET_i386 || TARGET_m68k || TARGET_sparc || TARGET_x86_64 || TARGET_powerpc
+	depends on TARGET_i386 || TARGET_m68k || TARGET_sparc || TARGET_x86_64 || TARGET_powerpc || TARGET_sh
 	default y
 	help
 	  If you want the uClibc math library to contain the full set of C99

 ------------------------------------------------------------------------
r25502 | vda | 2009-03-03 07:00:48 -0600 (Tue, 03 Mar 2009) | 8 lines
Changed paths:
   M /trunk/uClibc/libc/sysdeps/linux/arm/bits/kernel_stat.h
   M /trunk/uClibc/libc/sysdeps/linux/common/mknod.c
   M /trunk/uClibc/libc/sysdeps/linux/common/ustat.c
   M /trunk/uClibc/libc/sysdeps/linux/h8300/bits/kernel_stat.h
   M /trunk/uClibc/libc/sysdeps/linux/i386/bits/kernel_stat.h

mknod: widen the parameters to match kernel
ustat: same, + remove superfluous "conversion"
 which does nothing at best, loses high dev bits at worst
i386/bits/kernel_stat.h: update to reflect reality (wider dev_t)
h8300/bits/kernel_stat.h: same
arm/bits/kernel_stat.h: cosmetics to match kernel header to the letter


 ------------------------------------------------------------------------

Index: libc/sysdeps/linux/arm/bits/kernel_stat.h
===================================================================
--- libc/sysdeps/linux/arm/bits/kernel_stat.h	(revision 25501)
+++ libc/sysdeps/linux/arm/bits/kernel_stat.h	(revision 25502)
@@ -18,7 +18,7 @@
 #else
 	unsigned long  st_dev;
 #endif
-	unsigned long st_ino;
+	unsigned long  st_ino;
 	unsigned short st_mode;
 	unsigned short st_nlink;
 	unsigned short st_uid;
Index: libc/sysdeps/linux/common/ustat.c
===================================================================
--- libc/sysdeps/linux/common/ustat.c	(revision 25501)
+++ libc/sysdeps/linux/common/ustat.c	(revision 25502)
@@ -12,14 +12,15 @@
 #include 
 
 #define __NR___syscall_ustat __NR_ustat
+/* Kernel's fs/super.c defines this:
+ * long sys_ustat(unsigned dev, struct ustat __user * ubuf),
+ * thus we use unsigned, not __kernel_dev_t.
+ */
 static __inline__ _syscall2(int, __syscall_ustat,
-		unsigned short int, kdev_t, struct ustat *, ubuf)
+		unsigned, kdev_t,
+		struct ustat *, ubuf)
 
 int ustat(dev_t dev, struct ustat *ubuf)
 {
-	/* We must convert the dev_t value to a __kernel_dev_t */
-	__kernel_dev_t k_dev;
-
-	k_dev = ((major(dev) & 0xff) << 8) | (minor(dev) & 0xff);
-	return __syscall_ustat(k_dev, ubuf);
+	return __syscall_ustat(dev, ubuf);
 }
Index: libc/sysdeps/linux/common/mknod.c
===================================================================
--- libc/sysdeps/linux/common/mknod.c	(revision 25501)
+++ libc/sysdeps/linux/common/mknod.c	(revision 25502)
@@ -11,14 +11,18 @@
 #include 
 #include 
 
-/* libc_hidden_proto(mknod) */
-
 #define __NR___syscall_mknod __NR_mknod
-static __inline__ _syscall3(int, __syscall_mknod, const char *, path,
-		__kernel_mode_t, mode, __kernel_dev_t, dev)
+/* kernel's fs/namei.c defines this:
+ * long sys_mknod(const char __user *filename, int mode, unsigned dev),
+ * so, no __kernel_mode_t and no __kernel_dev_t, please.
+ */
+static __inline__ _syscall3(int, __syscall_mknod,
+		const char *, path,
+		int /* __kernel_mode_t */, mode,
+		unsigned /* __kernel_dev_t */, dev)
 
 int mknod(const char *path, mode_t mode, dev_t dev)
 {
-	return __syscall_mknod(path, mode, (__kernel_dev_t)dev);
+	return __syscall_mknod(path, mode, dev);
 }
 libc_hidden_def(mknod)
Index: libc/sysdeps/linux/i386/bits/kernel_stat.h
===================================================================
--- libc/sysdeps/linux/i386/bits/kernel_stat.h	(revision 25501)
+++ libc/sysdeps/linux/i386/bits/kernel_stat.h	(revision 25502)
@@ -10,8 +10,7 @@
  * different opinion on the subject... */
 
 struct kernel_stat {
-	unsigned short st_dev;
-	unsigned short __pad1;
+	unsigned long st_dev;
 	unsigned long st_ino;
 	unsigned short st_mode;
 	unsigned short st_nlink;
@@ -33,8 +32,8 @@
 };
 
 struct kernel_stat64 {
-	unsigned short	st_dev;
-	unsigned char	__pad0[10];
+	unsigned long long st_dev;
+	unsigned char	__pad0[4];
 #define _HAVE_STAT64___ST_INO
 	unsigned long	__st_ino;
 	unsigned int	st_mode;
Index: libc/sysdeps/linux/h8300/bits/kernel_stat.h
===================================================================
--- libc/sysdeps/linux/h8300/bits/kernel_stat.h	(revision 25501)
+++ libc/sysdeps/linux/h8300/bits/kernel_stat.h	(revision 25502)
@@ -33,8 +33,7 @@
 };
 
 struct kernel_stat64 {
-	unsigned char	__pad0[6];
-	unsigned short	st_dev;
+	unsigned long long st_dev;
 	unsigned char	__pad1[2];
 #define _HAVE_STAT64___ST_INO
 	unsigned long	__st_ino;

 ------------------------------------------------------------------------
r25493 | vda | 2009-03-02 15:10:01 -0600 (Mon, 02 Mar 2009) | 3 lines
Changed paths:
   M /trunk/uClibc/libc/sysdeps/linux/common/sys/epoll.h

Add EPOLLRDHUP constant


 ------------------------------------------------------------------------

Index: libc/sysdeps/linux/common/sys/epoll.h
===================================================================
--- libc/sysdeps/linux/common/sys/epoll.h	(revision 25492)
+++ libc/sysdeps/linux/common/sys/epoll.h	(revision 25493)
@@ -45,6 +45,8 @@
 #define EPOLLERR EPOLLERR
     EPOLLHUP = 0x010,
 #define EPOLLHUP EPOLLHUP
+    EPOLLRDHUP = 0x2000,
+#define EPOLLRDHUP EPOLLRDHUP
     EPOLLONESHOT = (1 << 30),
 #define EPOLLONESHOT EPOLLONESHOT
     EPOLLET = (1 << 31)

 ------------------------------------------------------------------------
r25469 | vda | 2009-02-27 16:51:07 -0600 (Fri, 27 Feb 2009) | 3 lines
Changed paths:
   M /trunk/uClibc/include/libc-symbols.h
   M /trunk/uClibc/libc/sysdeps/linux/common/fstat.c
   M /trunk/uClibc/libc/sysdeps/linux/common/getdents.c
   M /trunk/uClibc/libc/sysdeps/linux/common/getdents64.c
   M /trunk/uClibc/libc/sysdeps/linux/common/lstat.c
   M /trunk/uClibc/libc/sysdeps/linux/common/posix_fadvise.c
   M /trunk/uClibc/libc/sysdeps/linux/common/sendfile.c
   M /trunk/uClibc/libc/sysdeps/linux/common/stat.c

fix breakage in x86_64 defconfig


 ------------------------------------------------------------------------

Index: include/libc-symbols.h
===================================================================
--- include/libc-symbols.h	(revision 25468)
+++ include/libc-symbols.h	(revision 25469)
@@ -177,6 +177,12 @@
 # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
 # define _strong_alias(name, aliasname) \
   extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+/* Same, but does not check for type match. Use sparingly.
+   Example: strong_alias(stat,stat64) may fail, this one works: */
+# define strong_alias_untyped(name, aliasname) \
+  _strong_alias_untyped(name, aliasname)
+# define _strong_alias_untyped(name, aliasname) \
+  extern __typeof (aliasname) aliasname __attribute__ ((alias (#name)));
 
 /* This comes between the return type and function name in
    a function definition to make that definition weak.  */
Index: libc/sysdeps/linux/common/fstat.c
===================================================================
--- libc/sysdeps/linux/common/fstat.c	(revision 25468)
+++ libc/sysdeps/linux/common/fstat.c	(revision 25469)
@@ -7,19 +7,11 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_fstat64 doesnt exist */
-#define fstat64 __hidefstat64
-
 #include 
 #include 
 #include 
 #include "xstatconv.h"
 
-#undef fstat64
-
-/* libc_hidden_proto(fstat) */
-
 #define __NR___syscall_fstat __NR_fstat
 static __inline__ _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf)
 
@@ -37,8 +29,6 @@
 libc_hidden_def(fstat)
 
 #if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__
-extern __typeof(fstat) fstat64;
-/* libc_hidden_proto(fstat64) */
-strong_alias(fstat,fstat64)
+strong_alias_untyped(fstat,fstat64)
 libc_hidden_def(fstat64)
 #endif
Index: libc/sysdeps/linux/common/sendfile.c
===================================================================
--- libc/sysdeps/linux/common/sendfile.c	(revision 25468)
+++ libc/sysdeps/linux/common/sendfile.c	(revision 25469)
@@ -7,16 +7,10 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_sendfile64 doesnt exist */
-#define sendfile64 __hidesendfile64
-
 #include 
 #include 
 #include 
 
-#undef sendfile64
-
 #ifdef __NR_sendfile
 
 _syscall4(ssize_t, sendfile, int, out_fd, int, in_fd, __off_t *, offset,
Index: libc/sysdeps/linux/common/stat.c
===================================================================
--- libc/sysdeps/linux/common/stat.c	(revision 25468)
+++ libc/sysdeps/linux/common/stat.c	(revision 25469)
@@ -7,19 +7,11 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_stat64 doesnt exist */
-#define stat64 __hidestat64
-
 #include 
 #include 
 #include 
 #include "xstatconv.h"
 
-#undef stat64
-
-/* libc_hidden_proto(stat) */
-
 #define __NR___syscall_stat __NR_stat
 #undef stat
 static __inline__ _syscall2(int, __syscall_stat,
@@ -39,8 +31,6 @@
 libc_hidden_def(stat)
 
 #if ! defined __NR_stat64 && defined __UCLIBC_HAS_LFS__
-extern __typeof(stat) stat64;
-/* libc_hidden_proto(stat64) */
-strong_alias(stat,stat64)
+strong_alias_untyped(stat,stat64)
 libc_hidden_def(stat64)
 #endif
Index: libc/sysdeps/linux/common/posix_fadvise.c
===================================================================
--- libc/sysdeps/linux/common/posix_fadvise.c	(revision 25468)
+++ libc/sysdeps/linux/common/posix_fadvise.c	(revision 25469)
@@ -8,15 +8,9 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_fadvise64_64 doesnt exist */
-#define posix_fadvise64 __hideposix_fadvise64
-
 #include 
 #include 
 
-#undef posix_fadvise64
-
 #ifdef __NR_fadvise64
 #define __NR_posix_fadvise __NR_fadvise64
 /* get rid of following conditional when
@@ -49,7 +43,6 @@
 #endif
 
 #if defined __UCLIBC_HAS_LFS__ && (!defined __NR_fadvise64_64 || !defined _syscall6)
-extern __typeof(posix_fadvise) posix_fadvise64;
 strong_alias(posix_fadvise,posix_fadvise64)
 #endif
 
Index: libc/sysdeps/linux/common/getdents.c
===================================================================
--- libc/sysdeps/linux/common/getdents.c	(revision 25468)
+++ libc/sysdeps/linux/common/getdents.c	(revision 25469)
@@ -18,6 +18,11 @@
 #include 
 #include 
 
+#if !(defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 && __WORDSIZE == 64)
+/* If the condition above is met, __getdents is defined as an alias
+ * for __getdents64 (see getdents64.c). Otherwise...
+ */
+
 /* With newer versions of linux, the getdents syscall returns d_type
  * information after the name field.
  *
@@ -42,7 +47,8 @@
 #define __NR___syscall_getdents __NR_getdents
 static __always_inline _syscall3(int, __syscall_getdents, int, fd, unsigned char *, kdirp, size_t, count)
 
-#ifdef __ASSUME_GETDENTS32_D_TYPE
+#if defined __ASSUME_GETDENTS32_D_TYPE
+
 ssize_t __getdents (int fd, char *buf, size_t nbytes)
 {
 	ssize_t retval;
@@ -72,9 +78,6 @@
 
 #elif ! defined __UCLIBC_HAS_LFS__ || ! defined __NR_getdents64
 
-/* Experimentally off - libc_hidden_proto(memcpy) */
-/* libc_hidden_proto(lseek) */
-
 ssize_t __getdents (int fd, char *buf, size_t nbytes)
 {
     struct dirent *dp;
@@ -136,8 +139,6 @@
 
 #elif __WORDSIZE == 32
 
-/* Experimentally off - libc_hidden_proto(memmove) */
-
 extern __typeof(__getdents) __getdents64 attribute_hidden;
 ssize_t __getdents (int fd, char *buf, size_t nbytes)
 {
@@ -165,3 +166,5 @@
 }
 
 #endif
+
+#endif
Index: libc/sysdeps/linux/common/getdents64.c
===================================================================
--- libc/sysdeps/linux/common/getdents64.c	(revision 25468)
+++ libc/sysdeps/linux/common/getdents64.c	(revision 25469)
@@ -20,9 +20,6 @@
 
 #if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64
 
-/* Experimentally off - libc_hidden_proto(memcpy) */
-/* libc_hidden_proto(lseek64) */
-
 # ifndef offsetof
 #  define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 # endif
@@ -36,7 +33,6 @@
     char		d_name[256];
 };
 
-
 # define __NR___syscall_getdents64 __NR_getdents64
 static __inline__ _syscall3(int, __syscall_getdents64, int, fd, unsigned char *, dirp, size_t, count)
 
@@ -102,4 +98,4 @@
 attribute_hidden strong_alias(__getdents64,__getdents)
 #endif
 
-#endif /* __UCLIBC_HAS_LFS__ */
+#endif
Index: libc/sysdeps/linux/common/lstat.c
===================================================================
--- libc/sysdeps/linux/common/lstat.c	(revision 25468)
+++ libc/sysdeps/linux/common/lstat.c	(revision 25469)
@@ -7,19 +7,11 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-/* need to hide the 64bit prototype or the strong_alias()
- * will fail when __NR_lstat64 doesnt exist */
-#define lstat64 __hidelstat64
-
 #include 
 #include 
 #include 
 #include "xstatconv.h"
 
-#undef lstat64
-
-/* libc_hidden_proto(lstat) */
-
 #define __NR___syscall_lstat __NR_lstat
 static __inline__ _syscall2(int, __syscall_lstat,
 		const char *, file_name, struct kernel_stat *, buf)
@@ -38,8 +30,6 @@
 libc_hidden_def(lstat)
 
 #if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__
-extern __typeof(lstat) lstat64;
-/* libc_hidden_proto(lstat64) */
-strong_alias(lstat,lstat64)
+strong_alias_untyped(lstat,lstat64)
 libc_hidden_def(lstat64)
 #endif

 ------------------------------------------------------------------------
r25449 | vda | 2009-02-25 05:06:29 -0600 (Wed, 25 Feb 2009) | 4 lines
Changed paths:
   M /trunk/uClibc/libc/inet/socketcalls.c
   M /trunk/uClibc/libc/sysdeps/linux/common/__syscall_fcntl.c
   M /trunk/uClibc/libc/sysdeps/linux/common/close.c
   M /trunk/uClibc/libc/sysdeps/linux/common/fsync.c
   M /trunk/uClibc/libc/sysdeps/linux/common/llseek.c
   M /trunk/uClibc/libc/sysdeps/linux/common/lseek.c
   M /trunk/uClibc/libc/sysdeps/linux/common/msync.c
   M /trunk/uClibc/libc/sysdeps/linux/common/nanosleep.c
   M /trunk/uClibc/libc/sysdeps/linux/common/open.c
   M /trunk/uClibc/libc/sysdeps/linux/common/open64.c
   M /trunk/uClibc/libc/sysdeps/linux/common/pause.c
   M /trunk/uClibc/libc/sysdeps/linux/common/poll.c
   M /trunk/uClibc/libc/sysdeps/linux/common/read.c
   M /trunk/uClibc/libc/sysdeps/linux/common/wait.c
   M /trunk/uClibc/libc/sysdeps/linux/common/waitpid.c
   M /trunk/uClibc/libc/sysdeps/linux/common/write.c
   M /trunk/uClibc/libc/termios/tcdrain.c
   M /trunk/uClibc/libpthread/linuxthreads.old/cancel.c
   M /trunk/uClibc/libpthread/linuxthreads.old/pthread.c
   M /trunk/uClibc/libpthread/linuxthreads.old/wrapsyscall.c

Reinstate __libc_foo's needed for linuxthreads.old.
Now they are only enabled if linuxthreads.old are selected.


 ------------------------------------------------------------------------

Index: libc/inet/socketcalls.c
===================================================================
--- libc/inet/socketcalls.c	(revision 25448)
+++ libc/inet/socketcalls.c	(revision 25449)
@@ -35,9 +35,9 @@
 
 
 #ifdef L_accept
-#ifdef __NR_accept
+# ifdef __NR_accept
 _syscall3(int, accept, int, call, struct sockaddr *, addr, socklen_t *,addrlen)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 int accept(int s, struct sockaddr *addr, socklen_t * addrlen)
 {
 	unsigned long args[3];
@@ -47,8 +47,13 @@
 	args[2] = (unsigned long) addrlen;
 	return __socketcall(SYS_ACCEPT, args);
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(accept)
+# else
+libc_hidden_weak(accept)
+strong_alias(accept,__libc_accept)
+# endif
 #endif
 
 #ifdef L_bind
@@ -70,9 +75,9 @@
 #endif
 
 #ifdef L_connect
-#ifdef __NR_connect
+# ifdef __NR_connect
 _syscall3(int, connect, int, sockfd, const struct sockaddr *, saddr, socklen_t, addrlen)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 int connect(int sockfd, const struct sockaddr *saddr, socklen_t addrlen)
 {
 	unsigned long args[3];
@@ -82,8 +87,13 @@
 	args[2] = addrlen;
 	return __socketcall(SYS_CONNECT, args);
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(connect)
+# else
+libc_hidden_weak(connect)
+strong_alias(connect,__libc_connect)
+# endif
 #endif
 
 #ifdef L_getpeername
@@ -157,10 +167,10 @@
 #endif
 
 #ifdef L_recv
-#ifdef __NR_recv
+# ifdef __NR_recv
 _syscall4(ssize_t, recv, int, sockfd, __ptr_t, buffer, size_t, len,
 	int, flags)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 /* recv, recvfrom added by bir7@leland.stanford.edu */
 ssize_t recv(int sockfd, __ptr_t buffer, size_t len, int flags)
 {
@@ -172,21 +182,25 @@
 	args[3] = flags;
 	return (__socketcall(SYS_RECV, args));
 }
-#elif defined(__NR_recvfrom)
-/* libc_hidden_proto(recvfrom) */
+# elif defined(__NR_recvfrom)
 ssize_t recv(int sockfd, __ptr_t buffer, size_t len, int flags)
 {
 	return (recvfrom(sockfd, buffer, len, flags, NULL, NULL));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(recv)
+# else
+libc_hidden_weak(recv)
+strong_alias(recv,__libc_recv)
+# endif
 #endif
 
 #ifdef L_recvfrom
-#ifdef __NR_recvfrom
+# ifdef __NR_recvfrom
 _syscall6(ssize_t, recvfrom, int, sockfd, __ptr_t, buffer, size_t, len,
 	int, flags, struct sockaddr *, to, socklen_t *, tolen)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 /* recv, recvfrom added by bir7@leland.stanford.edu */
 ssize_t recvfrom(int sockfd, __ptr_t buffer, size_t len, int flags,
 		 struct sockaddr *to, socklen_t * tolen)
@@ -201,14 +215,19 @@
 	args[5] = (unsigned long) tolen;
 	return (__socketcall(SYS_RECVFROM, args));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(recvfrom)
+# else
+libc_hidden_weak(recvfrom)
+strong_alias(recvfrom,__libc_recvfrom)
+# endif
 #endif
 
 #ifdef L_recvmsg
-#ifdef __NR_recvmsg
+# ifdef __NR_recvmsg
 _syscall3(ssize_t, recvmsg, int, sockfd, struct msghdr *, msg, int, flags)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags)
 {
 	unsigned long args[3];
@@ -218,14 +237,19 @@
 	args[2] = flags;
 	return (__socketcall(SYS_RECVMSG, args));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(recvmsg)
+# else
+libc_hidden_weak(recvmsg)
+strong_alias(recvmsg,__libc_recvmsg)
+# endif
 #endif
 
 #ifdef L_send
-#ifdef __NR_send
+# ifdef __NR_send
 _syscall4(ssize_t, send, int, sockfd, const void *, buffer, size_t, len, int, flags)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 /* send, sendto added by bir7@leland.stanford.edu */
 ssize_t send(int sockfd, const void *buffer, size_t len, int flags)
 {
@@ -237,21 +261,24 @@
 	args[3] = flags;
 	return (__socketcall(SYS_SEND, args));
 }
-#elif defined(__NR_sendto)
-/* libc_hidden_proto(sendto) */
+# elif defined(__NR_sendto)
 ssize_t send(int sockfd, const void *buffer, size_t len, int flags)
 {
 	return (sendto(sockfd, buffer, len, flags, NULL, 0));
 }
-#endif
-/* libc_hidden_proto(send) */
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(send)
+# else
+libc_hidden_weak(send)
+strong_alias(send,__libc_send)
+# endif
 #endif
 
 #ifdef L_sendmsg
-#ifdef __NR_sendmsg
+# ifdef __NR_sendmsg
 _syscall3(ssize_t, sendmsg, int, sockfd, const struct msghdr *, msg, int, flags)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags)
 {
 	unsigned long args[3];
@@ -261,15 +288,20 @@
 	args[2] = flags;
 	return (__socketcall(SYS_SENDMSG, args));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(sendmsg)
+# else
+libc_hidden_weak(sendmsg)
+strong_alias(sendmsg,__libc_sendmsg)
+# endif
 #endif
 
 #ifdef L_sendto
-#ifdef __NR_sendto
+# ifdef __NR_sendto
 _syscall6(ssize_t, sendto, int, sockfd, const void *, buffer,
 	size_t, len, int, flags, const struct sockaddr *, to, socklen_t, tolen)
-#elif defined(__NR_socketcall)
+# elif defined(__NR_socketcall)
 /* send, sendto added by bir7@leland.stanford.edu */
 ssize_t sendto(int sockfd, const void *buffer, size_t len, int flags,
 	   const struct sockaddr *to, socklen_t tolen)
@@ -284,8 +316,13 @@
 	args[5] = tolen;
 	return (__socketcall(SYS_SENDTO, args));
 }
-#endif
+# endif
+# ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(sendto)
+# else
+libc_hidden_weak(sendto)
+strong_alias(sendto,__libc_sendto)
+# endif
 #endif
 
 #ifdef L_setsockopt
Index: libc/termios/tcdrain.c
===================================================================
--- libc/termios/tcdrain.c	(revision 25448)
+++ libc/termios/tcdrain.c	(revision 25449)
@@ -20,10 +20,13 @@
 #include 
 #include 
 
-/* libc_hidden_proto(ioctl) */
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(tcdrain) weak_function tcdrain;
+strong_alias(tcdrain,__libc_tcdrain)
+#endif
 
 /* Wait for pending output to be written on FD.  */
 int tcdrain(int fd)
 {
-      return ioctl(fd, TCSBRK, 1);
+	return ioctl(fd, TCSBRK, 1);
 }
Index: libc/sysdeps/linux/common/close.c
===================================================================
--- libc/sysdeps/linux/common/close.c	(revision 25448)
+++ libc/sysdeps/linux/common/close.c	(revision 25449)
@@ -11,4 +11,10 @@
 #include 
 
 _syscall1(int, close, int, fd)
+
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(close)
+#else
+libc_hidden_weak(close)
+strong_alias(close,__libc_close)
+#endif
Index: libc/sysdeps/linux/common/poll.c
===================================================================
--- libc/sysdeps/linux/common/poll.c	(revision 25448)
+++ libc/sysdeps/linux/common/poll.c	(revision 25449)
@@ -20,18 +20,14 @@
 #include 
 #include 
 
-extern __typeof(poll) __libc_poll;
-
 #ifdef __NR_poll
 
-# define __NR___libc_poll __NR_poll
-_syscall3(int, __libc_poll, struct pollfd *, fds,
+_syscall3(int, poll, struct pollfd *, fds,
 	unsigned long int, nfds, int, timeout)
 
 #elif defined(__NR_ppoll) && defined __UCLIBC_LINUX_SPECIFIC__
 
-/* libc_hidden_proto(ppoll) */
-int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
 {
 	struct timespec *ts = NULL, tval;
 	if (timeout > 0) {
@@ -57,11 +53,6 @@
 #include 
 #include 
 
-/* Experimentally off - libc_hidden_proto(memcpy) */
-/* Experimentally off - libc_hidden_proto(memset) */
-/* libc_hidden_proto(getdtablesize) */
-/* libc_hidden_proto(select) */
-
 /* uClinux 2.0 doesn't have poll, emulate it using select */
 
 /* Poll the file descriptors described by the NFDS structures starting at
@@ -70,7 +61,7 @@
    Returns the number of file descriptors with events, zero if timed out,
    or -1 for errors.  */
 
-int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
 {
     static int max_fd_size;
     struct timeval tv;
@@ -229,6 +220,10 @@
 }
 
 #endif
-/* libc_hidden_proto(poll) */
-weak_alias(__libc_poll,poll)
+
+#ifndef __LINUXTHREADS_OLD__
+libc_hidden_def(poll)
+#else
 libc_hidden_weak(poll)
+strong_alias(poll,__libc_poll)
+#endif
Index: libc/sysdeps/linux/common/read.c
===================================================================
--- libc/sysdeps/linux/common/read.c	(revision 25448)
+++ libc/sysdeps/linux/common/read.c	(revision 25449)
@@ -11,4 +11,9 @@
 #include 
 
 _syscall3(ssize_t, read, int, fd, __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(read)
+#else
+libc_hidden_weak(read)
+strong_alias(read,__libc_read)
+#endif
Index: libc/sysdeps/linux/common/write.c
===================================================================
--- libc/sysdeps/linux/common/write.c	(revision 25448)
+++ libc/sysdeps/linux/common/write.c	(revision 25449)
@@ -11,7 +11,13 @@
 #include 
 
 _syscall3(ssize_t, write, int, fd, const __ptr_t, buf, size_t, count)
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(write)
+#else
+libc_hidden_weak(write)
+strong_alias(write,__libc_write)
+#endif
+
 #if 0
 /* Stupid libgcc.a from gcc 2.95.x uses __write in pure.o
  * which is a blatant GNU libc-ism... */
Index: libc/sysdeps/linux/common/wait.c
===================================================================
--- libc/sysdeps/linux/common/wait.c	(revision 25448)
+++ libc/sysdeps/linux/common/wait.c	(revision 25449)
@@ -10,11 +10,14 @@
 #include 
 #include 
 
-/* libc_hidden_proto(wait4) */
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(wait) weak_function wait;
+strong_alias(wait,__libc_wait)
+#endif
 
 /* Wait for a child to die.  When one does, put its status in *STAT_LOC
  * and return its process ID.  For errors, return (pid_t) -1.  */
-__pid_t wait (__WAIT_STATUS_DEFN stat_loc)
+__pid_t wait(__WAIT_STATUS_DEFN stat_loc)
 {
-      return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
+	return wait4(WAIT_ANY, stat_loc, 0, NULL);
 }
Index: libc/sysdeps/linux/common/llseek.c
===================================================================
--- libc/sysdeps/linux/common/llseek.c	(revision 25448)
+++ libc/sysdeps/linux/common/llseek.c	(revision 25449)
@@ -36,4 +36,9 @@
 
 #endif
 
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(lseek64)
+#else
+libc_hidden_weak(lseek64)
+strong_alias(lseek64,__libc_lseek64)
+#endif
Index: libc/sysdeps/linux/common/fsync.c
===================================================================
--- libc/sysdeps/linux/common/fsync.c	(revision 25448)
+++ libc/sysdeps/linux/common/fsync.c	(revision 25449)
@@ -10,4 +10,9 @@
 #include 
 #include 
 
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(fsync) weak_function fsync;
+strong_alias(fsync,__libc_fsync)
+#endif
+
 _syscall1(int, fsync, int, fd)
Index: libc/sysdeps/linux/common/lseek.c
===================================================================
--- libc/sysdeps/linux/common/lseek.c	(revision 25448)
+++ libc/sysdeps/linux/common/lseek.c	(revision 25449)
@@ -19,4 +19,9 @@
 	return lseek64(fildes, offset, whence);
 }
 #endif
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(lseek)
+#else
+libc_hidden_weak(lseek)
+strong_alias(lseek,__libc_lseek)
+#endif
Index: libc/sysdeps/linux/common/msync.c
===================================================================
--- libc/sysdeps/linux/common/msync.c	(revision 25448)
+++ libc/sysdeps/linux/common/msync.c	(revision 25449)
@@ -14,6 +14,11 @@
 
 #include 
 
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(msync) weak_function msync;
+strong_alias(msync,__libc_msync)
+#endif
+
 _syscall3(int, msync, void *, addr, size_t, length, int, flags)
 
 #endif
Index: libc/sysdeps/linux/common/open.c
===================================================================
--- libc/sysdeps/linux/common/open.c	(revision 25448)
+++ libc/sysdeps/linux/common/open.c	(revision 25449)
@@ -31,7 +31,12 @@
 
 	return __syscall_open(file, oflag, mode);
 }
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(open)
+#else
+libc_hidden_weak(open)
+strong_alias(open,__libc_open)
+#endif
 
 int creat(const char *file, mode_t mode)
 {
Index: libc/sysdeps/linux/common/waitpid.c
===================================================================
--- libc/sysdeps/linux/common/waitpid.c	(revision 25448)
+++ libc/sysdeps/linux/common/waitpid.c	(revision 25449)
@@ -10,10 +10,13 @@
 #include 
 #include 
 
-/* libc_hidden_proto(wait4) */
-
 __pid_t waitpid(__pid_t pid, int *wait_stat, int options)
 {
 	return wait4(pid, wait_stat, options, NULL);
 }
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(waitpid)
+#else
+libc_hidden_weak(waitpid)
+strong_alias(waitpid,__libc_waitpid)
+#endif
Index: libc/sysdeps/linux/common/__syscall_fcntl.c
===================================================================
--- libc/sysdeps/linux/common/__syscall_fcntl.c	(revision 25448)
+++ libc/sysdeps/linux/common/__syscall_fcntl.c	(revision 25449)
@@ -38,7 +38,12 @@
 
 	return (__syscall_fcntl(fd, cmd, arg));
 }
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(fcntl)
+#else
+libc_hidden_weak(fcntl)
+strong_alias(fcntl,__libc_fcntl)
+#endif
 
 #if ! defined __NR_fcntl64 && defined __UCLIBC_HAS_LFS__
 strong_alias(fcntl,fcntl64)
Index: libc/sysdeps/linux/common/open64.c
===================================================================
--- libc/sysdeps/linux/common/open64.c	(revision 25448)
+++ libc/sysdeps/linux/common/open64.c	(revision 25449)
@@ -30,6 +30,11 @@
 
     return open(file, oflag | O_LARGEFILE, mode);
 }
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(open64)
+#else
+libc_hidden_weak(open64)
+strong_alias(open64,__libc_open64)
+#endif
 
 #endif /* __UCLIBC_HAS_LFS__ */
Index: libc/sysdeps/linux/common/pause.c
===================================================================
--- libc/sysdeps/linux/common/pause.c	(revision 25448)
+++ libc/sysdeps/linux/common/pause.c	(revision 25449)
@@ -10,17 +10,18 @@
 #define __UCLIBC_HIDE_DEPRECATED__
 #include 
 #include 
+#include 
 
+#ifdef __LINUXTHREADS_OLD__
+extern __typeof(pause) weak_function pause;
+strong_alias(pause,__libc_pause)
+#endif
+
 #ifdef __NR_pause
-
 _syscall0(int, pause)
-
 #else
-
-#include 
 int pause(void)
 {
 	return (__sigpause(sigblock(0), 0));
 }
-
 #endif
Index: libc/sysdeps/linux/common/nanosleep.c
===================================================================
--- libc/sysdeps/linux/common/nanosleep.c	(revision 25448)
+++ libc/sysdeps/linux/common/nanosleep.c	(revision 25449)
@@ -13,5 +13,10 @@
 #if defined __USE_POSIX199309 && defined __NR_nanosleep
 _syscall2(int, nanosleep, const struct timespec *, req,
 		  struct timespec *, rem)
+#ifndef __LINUXTHREADS_OLD__
 libc_hidden_def(nanosleep)
+#else
+libc_hidden_weak(nanosleep)
+strong_alias(nanosleep,__libc_nanosleep)
 #endif
+#endif
Index: libpthread/linuxthreads.old/wrapsyscall.c
===================================================================
--- libpthread/linuxthreads.old/wrapsyscall.c	(revision 25448)
+++ libpthread/linuxthreads.old/wrapsyscall.c	(revision 25449)
@@ -37,12 +37,13 @@
 #ifndef __PIC__
 /* We need a hook to force this file to be linked in when static
    libpthread is used.  */
-const int __pthread_provide_wrappers = 0;
+const char __pthread_provide_wrappers = 0;
 #endif
 
-
+/* Using private interface to libc (__libc_foo) to implement
+ * cancellable versions of some libc functions */
 #define CANCELABLE_SYSCALL(res_type, name, param_list, params)			\
-res_type name param_list;							\
+res_type __libc_##name param_list;						\
 res_type									\
 __attribute__ ((weak))								\
 name param_list									\
@@ -50,13 +51,13 @@
   res_type result;								\
   int oldtype;									\
   pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);		\
-  result = name params;								\
+  result = __libc_##name params;						\
   pthread_setcanceltype (oldtype, NULL);					\
   return result;								\
 }
 
 #define CANCELABLE_SYSCALL_VA(res_type, name, param_list, params, last_arg)	\
-res_type name param_list;							\
+res_type __libc_##name param_list;						\
 res_type									\
 __attribute__ ((weak))								\
 name param_list									\
@@ -66,7 +67,7 @@
   va_list ap;									\
   pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);		\
   va_start (ap, last_arg);							\
-  result = name params;								\
+  result = __libc_##name params;						\
   va_end (ap);									\
   pthread_setcanceltype (oldtype, NULL);					\
   return result;								\
Index: libpthread/linuxthreads.old/pthread.c
===================================================================
--- libpthread/linuxthreads.old/pthread.c	(revision 25448)
+++ libpthread/linuxthreads.old/pthread.c	(revision 25449)
@@ -1156,7 +1156,7 @@
 #ifndef __PIC__
 /* We need a hook to force the cancelation wrappers to be linked in when
    static libpthread is used.  */
-extern const int __pthread_provide_wrappers;
-static const int *const __pthread_require_wrappers =
+extern const char __pthread_provide_wrappers;
+static const char *const __pthread_require_wrappers =
   &__pthread_provide_wrappers;
 #endif
Index: libpthread/linuxthreads.old/cancel.c
===================================================================
--- libpthread/linuxthreads.old/cancel.c	(revision 25448)
+++ libpthread/linuxthreads.old/cancel.c	(revision 25449)
@@ -215,7 +215,7 @@
 #ifndef __PIC__
 /* We need a hook to force the cancelation wrappers to be linked in when
    static libpthread is used.  */
-extern const int __pthread_provide_wrappers;
-static const int * const __pthread_require_wrappers =
+extern const char __pthread_provide_wrappers;
+static const char *const __pthread_require_wrappers =
   &__pthread_provide_wrappers;
 #endif

 ------------------------------------------------------------------------
r25448 | landley | 2009-02-24 12:42:38 -0600 (Tue, 24 Feb 2009) | 2 lines
Changed paths:
   M /trunk/uClibc/extra/Configs/Config.in

Fix thinko in svn 25434.

 ------------------------------------------------------------------------

Index: extra/Configs/Config.in
===================================================================
--- extra/Configs/Config.in	(revision 25447)
+++ extra/Configs/Config.in	(revision 25448)
@@ -1813,7 +1813,7 @@
 	  'make install' will install /usr/include/
. config HARDWIRED_ABSPATH - string "Hardwire absolute paths into linker scripts" + bool "Hardwire absolute paths into linker scripts" default y help This prepends absolute paths to the libraries mentioned in linker ------------------------------------------------------------------------ r25434 | landley | 2009-02-24 01:20:53 -0600 (Tue, 24 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/Makefile.in M /trunk/uClibc/extra/Configs/Config.in Make HARDWIRED_ABSPATH a config option. ------------------------------------------------------------------------ Index: Makefile.in =================================================================== --- Makefile.in (revision 25433) +++ Makefile.in (revision 25434) @@ -402,6 +402,7 @@ $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)$$i.$(MAJOR_VERSION) \ $(PREFIX)$(DEVEL_PREFIX)lib/$$i; \ done +ifeq ($(HARDWIRED_ABSPATH),y) if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME) ] ; then \ $(RM) $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \ $(SED) -e 's:$(NONSHARED_LIBNAME):$(DEVEL_PREFIX)lib/$(NONSHARED_LIBNAME):' \ @@ -409,16 +410,23 @@ -e 's:$(UCLIBC_LDSO):$(RUNTIME_PREFIX)lib/$(UCLIBC_LDSO):' \ $(top_builddir)lib/libc.so > $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \ fi +else + -$(INSTALL) -m 644 lib/libc.so $(PREFIX)$(DEVEL_PREFIX)lib/ +endif ifeq ($(UCLIBC_HAS_THREADS),y) ifneq ($(LINUXTHREADS_OLD),y) +ifeq ($(HARDWIRED_ABSPATH),y) if [ -f $(top_builddir)lib/libpthread.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/libpthread.so.$(MAJOR_VERSION) ] ; then \ $(RM) $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \ cp $(top_srcdir)extra/scripts/format.lds $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \ echo "GROUP ( $(RUNTIME_PREFIX)lib/libpthread.so.$(MAJOR_VERSION) $(DEVEL_PREFIX)lib/libpthread_nonshared.a )" \ >> $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \ fi +else + -$(INSTALL) -m 644 lib/libpthread.so $(PREFIX)$(DEVEL_PREFIX)lib/ endif endif +endif ifeq ($(PTHREADS_DEBUG_SUPPORT),y) $(LN) -sf $(RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB)libthread_db.so.1 \ $(PREFIX)$(DEVEL_PREFIX)lib/libthread_db.so Index: extra/Configs/Config.in =================================================================== --- extra/Configs/Config.in (revision 25433) +++ extra/Configs/Config.in (revision 25434) @@ -1812,6 +1812,26 @@ For a typical target system this should be set to "/usr", such that 'make install' will install /usr/include/
. +config HARDWIRED_ABSPATH + string "Hardwire absolute paths into linker scripts" + default y + help + This prepends absolute paths to the libraries mentioned in linker + scripts such as libc.so. + + This is a build time optimization. It has no impact on dynamic + linking at runtime, which doesn't use linker scripts. + + You must disable this to use uClibc with a relocatable toolchain, + such as the prebuilt binary cross compilers at + http://uclibc.org/downloads/binaries which may be installed at an + arbitrary location (such as in a user's home directory). + + The amount of time saved by this optimization is actually too small to + measure. The linker just had to search the library path to find the + linker script, so the dentries are cache hot if it has to search the + same path again. But it's what glibc does, so we do it too. + endmenu ------------------------------------------------------------------------ r25432 | landley | 2009-02-23 18:27:33 -0600 (Mon, 23 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/include/unistd.h Fix __attribute__ (( __attribute__ ((noreturn)))), which doesn't compile. ------------------------------------------------------------------------ Index: include/unistd.h =================================================================== --- include/unistd.h (revision 25431) +++ include/unistd.h (revision 25432) @@ -771,7 +771,7 @@ #endif /* Use BSD. */ /* Special exit function which only terminates the current thread. */ -extern void __exit_thread (int val) __attribute__ ((noreturn)); +extern void __exit_thread (int val) __attribute__ ((__noreturn__)); /* Return the pathname of the terminal FD is open on, or NULL on errors. The returned storage is good only until the next call to this function. */ ------------------------------------------------------------------------ r25426 | aldot | 2009-02-23 05:18:30 -0600 (Mon, 23 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/test/math/Makefile - remove superfluous $(strip) ------------------------------------------------------------------------ Index: test/math/Makefile =================================================================== --- test/math/Makefile (revision 25425) +++ test/math/Makefile (revision 25426) @@ -4,7 +4,7 @@ include ../../.config TESTS := basic-test rint tst-definitions test-fpucw test-float test-ifloat test-double test-idouble -ifeq ($(strip $(UCLIBC_HAS_LONG_DOUBLE_MATH)),y) +ifeq ($(UCLIBC_HAS_LONG_DOUBLE_MATH),y) TESTS += test-ldouble test-ildoubl compile_test else CFLAGS_basic-test := -DNO_LONG_DOUBLE ------------------------------------------------------------------------ r25424 | aldot | 2009-02-23 04:54:15 -0600 (Mon, 23 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/test/malloc/tst-calloc.c - remove dependency on GNU error functionality ------------------------------------------------------------------------ Index: test/malloc/tst-calloc.c =================================================================== --- test/malloc/tst-calloc.c (revision 25423) +++ test/malloc/tst-calloc.c (revision 25424) @@ -18,12 +18,12 @@ 02111-1307 USA. */ #include -#include #include #include #include #include +static int errors = 0; /* Number of samples per size. */ #define N 50000 @@ -46,10 +46,11 @@ for (j = 0; j < size; ++j) { - if (ptrs[i][j] != '\0') - error (EXIT_FAILURE, 0, - "byte not cleared (size %d, element %d, byte %d)", + if (ptrs[i][j] != '\0') { + ++errors; + printf("byte not cleared (size %d, element %d, byte %d)", size, i, j); + } ptrs[i][j] = '\xff'; } } @@ -79,10 +80,11 @@ for (j = 0; j < size; ++j) { - if (ptrs[i][j] != '\0') - error (EXIT_FAILURE, 0, - "byte not cleared (size %d, element %d, byte %d)", + if (ptrs[i][j] != '\0') { + ++errors; + printf("byte not cleared (size %d, element %d, byte %d)", size, i, j); + } ptrs[i][j] = '\xff'; } } @@ -122,5 +124,5 @@ null_test (); - return 0; + return errors != 0; } ------------------------------------------------------------------------ r25422 | aldot | 2009-02-23 04:50:49 -0600 (Mon, 23 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/test/crypt/Makefile - disable libcrypt tests if we have no libcrypt ------------------------------------------------------------------------ Index: test/crypt/Makefile =================================================================== --- test/crypt/Makefile (revision 25421) +++ test/crypt/Makefile (revision 25422) @@ -1,6 +1,12 @@ # uClibc crypt tests # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +include ../../.config + +ifneq ($(UCLIBC_HAS_CRYPT),y) +TESTS_DISABLED := $(patsubst %.c,%,$(wildcard *.c)) +endif + include ../Test.mak EXTRA_LDFLAGS := -lcrypt ------------------------------------------------------------------------ r25420 | aldot | 2009-02-23 03:23:17 -0600 (Mon, 23 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/Rules.mak - also filter out headers-y ------------------------------------------------------------------------ Index: Rules.mak =================================================================== --- Rules.mak (revision 25419) +++ Rules.mak (revision 25420) @@ -567,7 +567,7 @@ # Be sure that binutils support it LDFLAGS_GNUHASH:=$(call check_ld,--hash-style=gnu) ifeq ($(LDFLAGS_GNUHASH),) -ifneq ($(filter-out install_headers,$(MAKECMDGOALS)),) +ifneq ($(filter-out install_headers headers-y,$(MAKECMDGOALS)),) $(error Your binutils don't support --hash-style option, while you want to use it) endif else ------------------------------------------------------------------------ r25417 | aldot | 2009-02-23 02:37:35 -0600 (Mon, 23 Feb 2009) | 4 lines Changed paths: M /trunk/uClibc/ldso/ldso/ldso.c - fix weak ssp symbol on some arches (Peter S. Mazinger) Work around alleged binutils glitch with weak symbols on some arches. See binutils ML, weak psm and vapier. ------------------------------------------------------------------------ Index: ldso/ldso/ldso.c =================================================================== --- ldso/ldso/ldso.c (revision 25416) +++ ldso/ldso/ldso.c (revision 25417) @@ -96,15 +96,13 @@ #ifdef __UCLIBC_HAS_SSP__ # include -uintptr_t stack_chk_guard; +static uintptr_t stack_chk_guard; # ifndef THREAD_SET_STACK_GUARD /* Only exported for architectures that don't store the stack guard canary * in local thread area. */ uintptr_t __stack_chk_guard attribute_relro; -# ifdef __UCLIBC_HAS_SSP_COMPAT__ -strong_alias(__stack_chk_guard,__guard) -# endif -# elif defined __UCLIBC_HAS_SSP_COMPAT__ +# endif +# ifdef __UCLIBC_HAS_SSP_COMPAT__ uintptr_t __guard attribute_relro; # endif #endif @@ -344,12 +342,12 @@ stack_chk_guard = _dl_setup_stack_chk_guard (); # ifdef THREAD_SET_STACK_GUARD THREAD_SET_STACK_GUARD (stack_chk_guard); -# ifdef __UCLIBC_HAS_SSP_COMPAT__ - __guard = stack_chk_guard; -# endif # else __stack_chk_guard = stack_chk_guard; # endif +# ifdef __UCLIBC_HAS_SSP_COMPAT__ + __guard = stack_chk_guard; +# endif #endif /* At this point we are now free to examine the user application, ------------------------------------------------------------------------ r25414 | carmelo | 2009-02-23 01:00:33 -0600 (Mon, 23 Feb 2009) | 12 lines Changed paths: M /trunk/uClibc/libc/sysdeps/linux/sh/___fpscr_values.S M /trunk/uClibc/libc/sysdeps/linux/sh/bits/syscalls.h M /trunk/uClibc/libc/sysdeps/linux/sh/bits/uClibc_arch_features.h M /trunk/uClibc/libc/sysdeps/linux/sh/clone.S M /trunk/uClibc/libc/sysdeps/linux/sh/sys/ucontext.h M /trunk/uClibc/libc/sysdeps/linux/sh/vfork.S Use gcc built-in defines for detecting SH cores instead of uclibc config option macros (aligning SH to all other archs). Changes applied as below: __CONFIG_SH4__ -> __SH4__ __CONFIG_SH2__ -> __sh2__ __CONFIG_SH2A__ -> __SH2A__ Note: pay attention to capital letters Signed-off-by: Carmelo Amoroso ------------------------------------------------------------------------ Index: libc/sysdeps/linux/sh/vfork.S =================================================================== --- libc/sysdeps/linux/sh/vfork.S (revision 25413) +++ libc/sysdeps/linux/sh/vfork.S (revision 25414) @@ -41,7 +41,7 @@ mov.w .L2, r3 trapa #__SH_SYSCALL_TRAP_BASE mov r0, r1 -#ifdef __CONFIG_SH2__ +#ifdef __sh2__ /* 12 arithmetic shifts for the crappy sh2, because shad doesn't exist! */ shar r1 shar r1 @@ -72,7 +72,7 @@ mov.w .L3, r3 trapa #__SH_SYSCALL_TRAP_BASE mov r0, r1 -#ifdef __CONFIG_SH2__ +#ifdef __sh2__ /* 12 arithmetic shifts for the crappy sh2, because shad doesn't exist! */ shar r1 shar r1 Index: libc/sysdeps/linux/sh/___fpscr_values.S =================================================================== --- libc/sysdeps/linux/sh/___fpscr_values.S (revision 25413) +++ libc/sysdeps/linux/sh/___fpscr_values.S (revision 25414) @@ -21,7 +21,7 @@ #include .data -#if defined(__CONFIG_SH4__) +#ifdef __SH4__ .global ___fpscr_values .type ___fpscr_values,@object .size ___fpscr_values,8 Index: libc/sysdeps/linux/sh/bits/uClibc_arch_features.h =================================================================== --- libc/sysdeps/linux/sh/bits/uClibc_arch_features.h (revision 25413) +++ libc/sysdeps/linux/sh/bits/uClibc_arch_features.h (revision 25414) @@ -6,7 +6,7 @@ #define _BITS_UCLIBC_ARCH_FEATURES_H /* instruction used when calling abort() to kill yourself */ -#if defined(__CONFIG_SH2__) +#ifdef __sh2__ # define __UCLIBC_ABORT_INSTRUCTION__ "trapa #32" #else # define __UCLIBC_ABORT_INSTRUCTION__ "trapa #0xff" Index: libc/sysdeps/linux/sh/bits/syscalls.h =================================================================== --- libc/sysdeps/linux/sh/bits/syscalls.h (revision 25413) +++ libc/sysdeps/linux/sh/bits/syscalls.h (revision 25414) @@ -5,7 +5,7 @@ #endif /* The Linux kernel uses different trap numbers on sh-2. */ -#if defined __CONFIG_SH2__ || defined __CONFIG_SH2A__ +#if defined __sh2__ || defined __SH2A__ # define __SH_SYSCALL_TRAP_BASE 0x20 #else # define __SH_SYSCALL_TRAP_BASE 0x10 Index: libc/sysdeps/linux/sh/clone.S =================================================================== --- libc/sysdeps/linux/sh/clone.S (revision 25413) +++ libc/sysdeps/linux/sh/clone.S (revision 25414) @@ -62,7 +62,7 @@ mov r6, r4 trapa #(__SH_SYSCALL_TRAP_BASE + 2) mov r0, r1 -#ifdef __CONFIG_SH2__ +#ifdef __sh2__ /* 12 arithmetic shifts for the crappy sh2, because shad doesn't exist! */ shar r1 shar r1 Index: libc/sysdeps/linux/sh/sys/ucontext.h =================================================================== --- libc/sysdeps/linux/sh/sys/ucontext.h (revision 25413) +++ libc/sysdeps/linux/sh/sys/ucontext.h (revision 25414) @@ -98,7 +98,7 @@ unsigned int mach; unsigned int macl; -#ifdef __CONFIG_SH4__ +#ifdef __SH4__ /* FPU registers */ fpregset_t fpregs; fpregset_t xfpregs; ------------------------------------------------------------------------ r25401 | carmelo | 2009-02-20 09:01:42 -0600 (Fri, 20 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/libc/sysdeps/linux/sh/bits/syscalls.h Fix my previous commit to use preprocessor in the right way ! ------------------------------------------------------------------------ Index: libc/sysdeps/linux/sh/bits/syscalls.h =================================================================== --- libc/sysdeps/linux/sh/bits/syscalls.h (revision 25400) +++ libc/sysdeps/linux/sh/bits/syscalls.h (revision 25401) @@ -5,7 +5,7 @@ #endif /* The Linux kernel uses different trap numbers on sh-2. */ -#ifdef __CONFIG_SH2__ || __CONFIG_SH2A__ +#if defined __CONFIG_SH2__ || defined __CONFIG_SH2A__ # define __SH_SYSCALL_TRAP_BASE 0x20 #else # define __SH_SYSCALL_TRAP_BASE 0x10 ------------------------------------------------------------------------ r25399 | carmelo | 2009-02-20 08:37:43 -0600 (Fri, 20 Feb 2009) | 8 lines Changed paths: M /trunk/uClibc/extra/Configs/Config.in Linuxthreads_old and NPTL must be mutually exclusive. TLS support cannot be enabled when using Linuxthreads_old (at least until Linuxthreads and Linuxthreads_old will not me merged togheter) Signed-off-by: Carmelo Amoroso ------------------------------------------------------------------------ Index: extra/Configs/Config.in =================================================================== --- extra/Configs/Config.in (revision 25398) +++ extra/Configs/Config.in (revision 25399) @@ -374,7 +374,7 @@ config UCLIBC_HAS_TLS bool "Thread-Local Storage" - depends on UCLIBC_HAS_THREADS + depends on UCLIBC_HAS_THREADS && !LINUXTHREADS_OLD default n help If you want to enable TLS support then answer Y. @@ -402,7 +402,7 @@ config LINUXTHREADS_OLD bool "Use the older (stable) version of linuxthreads" default y - depends on UCLIBC_HAS_THREADS + depends on UCLIBC_HAS_THREADS && !UCLIBC_HAS_THREADS_NATIVE help There are two versions of linuxthreads. The older (stable) version has been in uClibc for quite a long time but hasn't seen too many ------------------------------------------------------------------------ r25396 | carmelo | 2009-02-20 08:13:17 -0600 (Fri, 20 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/libc/sysdeps/linux/sh/bits/syscalls.h Fix typo. ------------------------------------------------------------------------ Index: libc/sysdeps/linux/sh/bits/syscalls.h =================================================================== --- libc/sysdeps/linux/sh/bits/syscalls.h (revision 25395) +++ libc/sysdeps/linux/sh/bits/syscalls.h (revision 25396) @@ -5,7 +5,7 @@ #endif /* The Linux kernel uses different trap numbers on sh-2. */ -#ifdef __CONFIG_SH2__ | __CONFIG_SH2A__ +#ifdef __CONFIG_SH2__ || __CONFIG_SH2A__ # define __SH_SYSCALL_TRAP_BASE 0x20 #else # define __SH_SYSCALL_TRAP_BASE 0x10 ------------------------------------------------------------------------ r25392 | carmelo | 2009-02-20 07:31:01 -0600 (Fri, 20 Feb 2009) | 4 lines Changed paths: M /trunk/uClibc/libc/sysdeps/linux/sh/bits/syscalls.h sh: Fix __SH_SYSCALL_TRAP_BASE for SH2A architecture Signed-off-by: Peter Griffin ------------------------------------------------------------------------ Index: libc/sysdeps/linux/sh/bits/syscalls.h =================================================================== --- libc/sysdeps/linux/sh/bits/syscalls.h (revision 25391) +++ libc/sysdeps/linux/sh/bits/syscalls.h (revision 25392) @@ -5,7 +5,7 @@ #endif /* The Linux kernel uses different trap numbers on sh-2. */ -#ifdef __CONFIG_SH2__ +#ifdef __CONFIG_SH2__ | __CONFIG_SH2A__ # define __SH_SYSCALL_TRAP_BASE 0x20 #else # define __SH_SYSCALL_TRAP_BASE 0x10 ------------------------------------------------------------------------ r25374 | vda | 2009-02-18 19:00:33 -0600 (Wed, 18 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/extra/scripts/install_kernel_headers.sh Install other linux kernel header subdirectories too ------------------------------------------------------------------------ Index: extra/scripts/install_kernel_headers.sh =================================================================== --- extra/scripts/install_kernel_headers.sh (revision 25373) +++ extra/scripts/install_kernel_headers.sh (revision 25374) @@ -6,6 +6,7 @@ die_if_not_dir() { + local dir for dir in "$@"; do test -d "$dir" && continue echo "Error: '$dir' is not a directory" @@ -29,7 +30,6 @@ eval `grep ^KERNEL_HEADERS "$top_builddir/.config"` if ! test "$KERNEL_HEADERS" \ || ! test -d "$KERNEL_HEADERS/asm" \ -|| ! test -d "$KERNEL_HEADERS/asm-generic" \ || ! test -d "$KERNEL_HEADERS/linux" \ ; then echo "Error: '$KERNEL_HEADERS' is not a directory containing kernel headers." @@ -60,6 +60,15 @@ die_if_not_dir "$2/asm-generic" cp -RHL "$KERNEL_HEADERS/asm-generic"/* "$2/asm-generic" || exit 1 fi + # For paranoid reasons, we use explicit list of directories + # which may be here. List last updated for linux-2.6.27: + for dir in drm mtd rdma sound video; do + if test -d "$KERNEL_HEADERS/$dir"; then + mkdir -p "$2/$dir" 2>/dev/null + die_if_not_dir "$2/$dir" + cp -RHL "$KERNEL_HEADERS/$dir"/* "$2/$dir" || exit 1 + fi + done if ! test -f "$2/linux/version.h"; then echo "Warning: '$KERNEL_HEADERS/linux/version.h' is not found" echo "in kernel headers directory specified in .config." ------------------------------------------------------------------------ r25370 | aldot | 2009-02-18 13:47:35 -0600 (Wed, 18 Feb 2009) | 5 lines Changed paths: M /trunk/uClibc/extra/Configs/Config.in - explicitely discourage to use pregenerated locale data. Rob Landley promised to provide them for all arches but didn't do that yet so disable it for now since they just do not exist right now (and furthermore cause more pain than gain). ------------------------------------------------------------------------ Index: extra/Configs/Config.in =================================================================== --- extra/Configs/Config.in (revision 25369) +++ extra/Configs/Config.in (revision 25370) @@ -1268,17 +1268,12 @@ depends on UCLIBC_HAS_LOCALE default n help - If you are selective and only want locale data for a few particular - locales, you can turn this option off. + Use pre-built locale data. - Mere mortals will answer Y and use the default set of pregenerated - locale data, which supports 169 UTF-8 locales, and 144 locales for - other codesets (for the complete list see extra/locale/LOCALES). - Note that these pregenerated locales are sensitive to your target architecture (endianess, bitcount). - Saying N here is recommended. + Saying N here is highly recommended. config UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA bool "Automagically Download the Pre-generated Locale Data (if necessary)" ------------------------------------------------------------------------ r25369 | vda | 2009-02-18 13:04:18 -0600 (Wed, 18 Feb 2009) | 6 lines Changed paths: M /trunk/uClibc/include/math.h M /trunk/uClibc/libc/sysdeps/linux/common/bits/mathcalls.h mathcalls.h: remove tons of redundant semicolons; better comment about macros math.h: make macro machinery a bit more understandable No code changes (verified with objdump) ------------------------------------------------------------------------ Index: include/math.h =================================================================== --- include/math.h (revision 25368) +++ include/math.h (revision 25369) @@ -63,7 +63,7 @@ #define __MATHDECLX(type,function,suffix,args,attrib) \ __MATHDECL_1(type,function,suffix,args) __attribute__ (attrib); \ - __MATHDECLI_MAINVARIANT(function) + __MATH_maybe_libm_hidden_proto(function) #define __MATHCALLX(function,suffix,args,attrib) \ __MATHDECLX(_Mdouble_,function,suffix,args,attrib) @@ -73,7 +73,7 @@ for the {l,f} variants. */ #define __MATHDECLI(type,function,suffix,args) \ __MATHDECL_1(type,function,suffix,args); \ - __MATHDECLI_MAINVARIANT(function) + __MATH_maybe_libm_hidden_proto(function) #define __MATHCALLI(function,suffix,args) \ __MATHDECLI(_Mdouble_,function,suffix,args) @@ -93,9 +93,9 @@ /* Include the file of declarations, declaring double versions */ #if defined _LIBC -# define __MATHDECLI_MAINVARIANT(x) libm_hidden_proto(x) +# define __MATH_maybe_libm_hidden_proto(x) libm_hidden_proto(x) #else -# define __MATHDECLI_MAINVARIANT(x) +# define __MATH_maybe_libm_hidden_proto(x) #endif #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) @@ -106,8 +106,7 @@ #undef _Mdouble_BEGIN_NAMESPACE #undef _Mdouble_END_NAMESPACE #undef __MATH_PRECNAME -#undef __MATHDECLI_MAINVARIANT -#define __MATHDECLI_MAINVARIANT(x) +#undef __MATH_maybe_libm_hidden_proto #if defined __USE_MISC || defined __USE_ISOC99 @@ -115,6 +114,7 @@ /* Include the file of declarations again, this time using `float' instead of `double' and appending f to each function name. */ +# define __MATH_maybe_libm_hidden_proto(x) # ifndef _Mfloat_ # define _Mfloat_ float # endif @@ -131,6 +131,7 @@ # undef _Mdouble_BEGIN_NAMESPACE # undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME +# undef __MATH_maybe_libm_hidden_proto # if (defined __STDC__ || defined __GNUC__) \ @@ -162,6 +163,7 @@ __MATHDECL_2(type,function,suffix,args,__CONCAT(function,suffix)) # endif +# define __MATH_maybe_libm_hidden_proto(x) # ifndef _Mlong_double_ # define _Mlong_double_ long double # endif @@ -178,6 +180,7 @@ # undef _Mdouble_BEGIN_NAMESPACE # undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME +# undef __MATH_maybe_libm_hidden_proto # endif /* __STDC__ || __GNUC__ */ Index: libc/sysdeps/linux/common/bits/mathcalls.h =================================================================== --- libc/sysdeps/linux/common/bits/mathcalls.h (revision 25368) +++ libc/sysdeps/linux/common/bits/mathcalls.h (revision 25369) @@ -24,7 +24,7 @@ This file provides prototype declarations for the math functions. Most functions are declared using the macro: - __MATHCALL (NAME,[_r], (ARGS...)); + __MATHCALL (NAME,[_r], (ARGS...)) This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the @@ -34,7 +34,7 @@ Functions returning other types like `int' are declared using the macro: - __MATHDECL (TYPE, NAME,[_r], (ARGS...)); + __MATHDECL (TYPE, NAME,[_r], (ARGS...)) This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still @@ -48,10 +48,11 @@ #endif -/* __MATHCALLX includes libm_hidden_def - * __MATHCALLI includes libm_hidden_def too - * __MATHCALL does not - * __MATHDECL_PRIV includes libm_hidden_def and declared only __foo, not foo +/* __MATHCALLX and __MATHCALLI include libm_hidden_def + * (for "double" versions only, xxxf and xxxl do not get this treatment). + * __MATHCALL does not. + * __MATHDECL_PRIV includes libm_hidden_def (always) + * and declares __foo, not foo. */ @@ -59,45 +60,45 @@ _Mdouble_BEGIN_NAMESPACE /* Arc cosine of X. */ -__MATHCALLI (acos,, (_Mdouble_ __x)); +__MATHCALLI (acos,, (_Mdouble_ __x)) /* Arc sine of X. */ -__MATHCALLI (asin,, (_Mdouble_ __x)); +__MATHCALLI (asin,, (_Mdouble_ __x)) /* Arc tangent of X. */ -__MATHCALLI (atan,, (_Mdouble_ __x)); +__MATHCALLI (atan,, (_Mdouble_ __x)) /* Arc tangent of Y/X. */ -__MATHCALLI (atan2,, (_Mdouble_ __y, _Mdouble_ __x)); +__MATHCALLI (atan2,, (_Mdouble_ __y, _Mdouble_ __x)) /* Cosine of X. */ -__MATHCALLI (cos,, (_Mdouble_ __x)); +__MATHCALLI (cos,, (_Mdouble_ __x)) /* Sine of X. */ -__MATHCALLI (sin,, (_Mdouble_ __x)); +__MATHCALLI (sin,, (_Mdouble_ __x)) /* Tangent of X. */ -__MATHCALLI (tan,, (_Mdouble_ __x)); +__MATHCALLI (tan,, (_Mdouble_ __x)) /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ -__MATHCALLI (cosh,, (_Mdouble_ __x)); +__MATHCALLI (cosh,, (_Mdouble_ __x)) /* Hyperbolic sine of X. */ -__MATHCALLI (sinh,, (_Mdouble_ __x)); +__MATHCALLI (sinh,, (_Mdouble_ __x)) /* Hyperbolic tangent of X. */ -__MATHCALLI (tanh,, (_Mdouble_ __x)); +__MATHCALLI (tanh,, (_Mdouble_ __x)) _Mdouble_END_NAMESPACE #if 0 /*def __USE_GNU*/ /* Cosine and sine of X. */ __MATHDECL (void,sincos,, - (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx)); + (_Mdouble_ __x, _Mdouble_ *__sinx, _Mdouble_ *__cosx)) #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Hyperbolic arc cosine of X. */ -__MATHCALLI (acosh,, (_Mdouble_ __x)); +__MATHCALLI (acosh,, (_Mdouble_ __x)) /* Hyperbolic arc sine of X. */ -__MATHCALLI (asinh,, (_Mdouble_ __x)); +__MATHCALLI (asinh,, (_Mdouble_ __x)) /* Hyperbolic arc tangent of X. */ -__MATHCALLI (atanh,, (_Mdouble_ __x)); +__MATHCALLI (atanh,, (_Mdouble_ __x)) __END_NAMESPACE_C99 #endif @@ -105,51 +106,51 @@ _Mdouble_BEGIN_NAMESPACE /* Exponential function of X. */ -__MATHCALLI (exp,, (_Mdouble_ __x)); +__MATHCALLI (exp,, (_Mdouble_ __x)) /* Break VALUE into a normalized fraction and an integral power of 2. */ -__MATHCALLI (frexp,, (_Mdouble_ __x, int *__exponent)); +__MATHCALLI (frexp,, (_Mdouble_ __x, int *__exponent)) /* X times (two to the EXP power). */ -__MATHCALLI (ldexp,, (_Mdouble_ __x, int __exponent)); +__MATHCALLI (ldexp,, (_Mdouble_ __x, int __exponent)) /* Natural logarithm of X. */ -__MATHCALLI (log,, (_Mdouble_ __x)); +__MATHCALLI (log,, (_Mdouble_ __x)) /* Base-ten logarithm of X. */ -__MATHCALLI (log10,, (_Mdouble_ __x)); +__MATHCALLI (log10,, (_Mdouble_ __x)) /* Break VALUE into integral and fractional parts. */ -__MATHCALLI (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)); +__MATHCALLI (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) _Mdouble_END_NAMESPACE #if 0 /*def __USE_GNU*/ /* A function missing in all standards: compute exponent to base ten. */ -__MATHCALL (exp10,, (_Mdouble_ __x)); +__MATHCALL (exp10,, (_Mdouble_ __x)) /* Another name occasionally used. */ -__MATHCALL (pow10,, (_Mdouble_ __x)); +__MATHCALL (pow10,, (_Mdouble_ __x)) #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return exp(X) - 1. */ -__MATHCALLI (expm1,, (_Mdouble_ __x)); +__MATHCALLI (expm1,, (_Mdouble_ __x)) /* Return log(1 + X). */ -__MATHCALLI (log1p,, (_Mdouble_ __x)); +__MATHCALLI (log1p,, (_Mdouble_ __x)) /* Return the base 2 signed integral exponent of X. */ -__MATHCALLI (logb,, (_Mdouble_ __x)); +__MATHCALLI (logb,, (_Mdouble_ __x)) __END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Compute base-2 exponential of X. */ -__MATHCALLI (exp2,, (_Mdouble_ __x)); +__MATHCALLI (exp2,, (_Mdouble_ __x)) /* Compute base-2 logarithm of X. */ -__MATHCALL (log2,, (_Mdouble_ __x)); +__MATHCALL (log2,, (_Mdouble_ __x)) __END_NAMESPACE_C99 #endif @@ -158,23 +159,23 @@ _Mdouble_BEGIN_NAMESPACE /* Return X to the Y power. */ -__MATHCALLI (pow,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALLI (pow,, (_Mdouble_ __x, _Mdouble_ __y)) /* Return the square root of X. */ -__MATHCALLI (sqrt,, (_Mdouble_ __x)); +__MATHCALLI (sqrt,, (_Mdouble_ __x)) _Mdouble_END_NAMESPACE #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return `sqrt(X*X + Y*Y)'. */ -__MATHCALLI (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALLI (hypot,, (_Mdouble_ __x, _Mdouble_ __y)) __END_NAMESPACE_C99 #endif #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return the cube root of X. */ -__MATHCALLI (cbrt,, (_Mdouble_ __x)); +__MATHCALLI (cbrt,, (_Mdouble_ __x)) __END_NAMESPACE_C99 #endif @@ -183,101 +184,102 @@ _Mdouble_BEGIN_NAMESPACE /* Smallest integral value not less than X. */ -__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__)); +__MATHCALLX (ceil,, (_Mdouble_ __x), (__const__)) /* Absolute value of X. */ -__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__)); +__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__)) /* Largest integer not greater than X. */ -__MATHCALLX (floor,, (_Mdouble_ __x), (__const__)); +__MATHCALLX (floor,, (_Mdouble_ __x), (__const__)) /* Floating-point modulo remainder of X/Y. */ -__MATHCALLI (fmod,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALLI (fmod,, (_Mdouble_ __x, _Mdouble_ __y)) /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__)); +__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__)) /* Return nonzero if VALUE is finite and not NaN. */ -__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__)); +__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__)) _Mdouble_END_NAMESPACE #ifdef __USE_MISC #if 0 /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__)); +__MATHDECL_PRIV (int,isinf,, (_Mdouble_ __value), (__const__)) /* Return nonzero if VALUE is finite and not NaN. */ -__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__)); +__MATHDECL_PRIV (int,finite,, (_Mdouble_ __value), (__const__)) #endif /* Return the remainder of X/Y. */ -__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)) /* Return the fractional part of X after dividing out `ilogb (X)'. */ -__MATHCALL (significand,, (_Mdouble_ __x)); +__MATHCALL (significand,, (_Mdouble_ __x)) #endif /* Use misc. */ #if defined __USE_MISC || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return X with its signed changed to Y's. */ -__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); +__MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)) __END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Return representation of NaN for double type. */ -__MATHCALLX (nan,, (__const char *__tagb), (__const__)); +__MATHCALLX (nan,, (__const char *__tagb), (__const__)) __END_NAMESPACE_C99 #endif /* Return nonzero if VALUE is not a number. */ -__MATHDECL_PRIV (int,__isnan,, (_Mdouble_ __value), (__const__)); +/* DELETE? __MATHDECL_PRIV adds another "__": so this is "____isnan"???! */ +/*__MATHDECL_PRIV (int,__isnan,, (_Mdouble_ __value), (__const__))*/ #if defined __USE_MISC || defined __USE_XOPEN /* Return nonzero if VALUE is not a number. */ -__MATHDECL_PRIV (int,isnan,, (_Mdouble_ __value), (__const__)); +__MATHDECL_PRIV (int,isnan,, (_Mdouble_ __value), (__const__)) /* Bessel functions. */ -__MATHCALL (j0,, (_Mdouble_)); -__MATHCALL (j1,, (_Mdouble_)); -__MATHCALL (jn,, (int, _Mdouble_)); -__MATHCALL (y0,, (_Mdouble_)); -__MATHCALL (y1,, (_Mdouble_)); -__MATHCALL (yn,, (int, _Mdouble_)); +__MATHCALL (j0,, (_Mdouble_)) +__MATHCALL (j1,, (_Mdouble_)) +__MATHCALL (jn,, (int, _Mdouble_)) +__MATHCALL (y0,, (_Mdouble_)) +__MATHCALL (y1,, (_Mdouble_)) +__MATHCALL (yn,, (int, _Mdouble_)) #endif #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Error and gamma functions. */ -__MATHCALLI (erf,, (_Mdouble_)); -__MATHCALLI (erfc,, (_Mdouble_)); -__MATHCALLI (lgamma,, (_Mdouble_)); +__MATHCALLI (erf,, (_Mdouble_)) +__MATHCALLI (erfc,, (_Mdouble_)) +__MATHCALLI (lgamma,, (_Mdouble_)) __END_NAMESPACE_C99 #endif #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* True gamma function. */ -__MATHCALLI (tgamma,, (_Mdouble_)); +__MATHCALLI (tgamma,, (_Mdouble_)) __END_NAMESPACE_C99 #endif #if defined __USE_MISC || defined __USE_XOPEN /* Obsolete alias for `lgamma'. */ -__MATHCALL (gamma,, (_Mdouble_)); +__MATHCALL (gamma,, (_Mdouble_)) #endif #ifdef __USE_MISC /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ -__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); +__MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)) #endif @@ -285,80 +287,80 @@ __BEGIN_NAMESPACE_C99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ -__MATHCALLI (rint,, (_Mdouble_ __x)); +__MATHCALLI (rint,, (_Mdouble_ __x)) /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ -__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); +__MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)) # if defined __USE_ISOC99 && !defined __LDBL_COMPAT -__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); +__MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)) # endif /* Return the remainder of integer divison X / Y with infinite precision. */ -__MATHCALLI (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALLI (remainder,, (_Mdouble_ __x, _Mdouble_ __y)) # if defined __USE_MISC || defined __USE_ISOC99 /* Return X times (2 to the Nth power). */ -__MATHCALLI (scalbn,, (_Mdouble_ __x, int __n)); +__MATHCALLI (scalbn,, (_Mdouble_ __x, int __n)) # endif /* Return the binary exponent of X, which must be nonzero. */ -__MATHDECLI (int,ilogb,, (_Mdouble_ __x)); +__MATHDECLI (int,ilogb,, (_Mdouble_ __x)) #endif #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ -__MATHCALLI (scalbln,, (_Mdouble_ __x, long int __n)); +__MATHCALLI (scalbln,, (_Mdouble_ __x, long int __n)) /* Round X to integral value in floating-point format using current rounding direction, but do not raise inexact exception. */ -__MATHCALLI (nearbyint,, (_Mdouble_ __x)); +__MATHCALLI (nearbyint,, (_Mdouble_ __x)) /* Round X to nearest integral value, rounding halfway cases away from zero. */ -__MATHCALLX (round,, (_Mdouble_ __x), (__const__)); +__MATHCALLX (round,, (_Mdouble_ __x), (__const__)) /* Round X to the integral value in floating-point format nearest but not larger in magnitude. */ -__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__)); +__MATHCALLX (trunc,, (_Mdouble_ __x), (__const__)) /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ -__MATHCALLI (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); +__MATHCALLI (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)) /* Conversion functions. */ /* Round X to nearest integral value according to current rounding direction. */ -__MATHDECLI (long int,lrint,, (_Mdouble_ __x)); -__MATHDECLI (long long int,llrint,, (_Mdouble_ __x)); +__MATHDECLI (long int,lrint,, (_Mdouble_ __x)) +__MATHDECLI (long long int,llrint,, (_Mdouble_ __x)) /* Round X to nearest integral value, rounding halfway cases away from zero. */ -__MATHDECLI (long int,lround,, (_Mdouble_ __x)); -__MATHDECLI (long long int,llround,, (_Mdouble_ __x)); +__MATHDECLI (long int,lround,, (_Mdouble_ __x)) +__MATHDECLI (long long int,llround,, (_Mdouble_ __x)) /* Return positive difference between X and Y. */ -__MATHCALLI (fdim,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALLI (fdim,, (_Mdouble_ __x, _Mdouble_ __y)) /* Return maximum numeric value from X and Y. */ -__MATHCALLI (fmax,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALLI (fmax,, (_Mdouble_ __x, _Mdouble_ __y)) /* Return minimum numeric value from X and Y. */ -__MATHCALLI (fmin,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHCALLI (fmin,, (_Mdouble_ __x, _Mdouble_ __y)) /* Classify given number. */ -__MATHDECL_PRIV (int, fpclassify,, (_Mdouble_ __value), (__const__)); +__MATHDECL_PRIV (int, fpclassify,, (_Mdouble_ __value), (__const__)) /* Test for negative number. */ -__MATHDECL_PRIV (int, signbit,, (_Mdouble_ __value), (__const__)); +__MATHDECL_PRIV (int, signbit,, (_Mdouble_ __value), (__const__)) /* Multiply-add function computed as a ternary operation. */ -__MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); +__MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)) #endif /* Use ISO C99. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 @@ -368,5 +370,5 @@ #if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \ && defined __UCLIBC_SUSV3_LEGACY__ /* Return X times (2 to the Nth power). */ -__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); +__MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)) #endif ------------------------------------------------------------------------ r25359 | vda | 2009-02-18 08:04:17 -0600 (Wed, 18 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/test/math/compile_test.c test/math/compile_test.c: make it exit with 0 always ------------------------------------------------------------------------ Index: test/math/compile_test.c =================================================================== --- test/math/compile_test.c (revision 25358) +++ test/math/compile_test.c (revision 25359) @@ -134,5 +134,6 @@ int main(int argc, char **argv) { - return (long) &testf + (long) &testl; + /* Always 0 but gcc hopefully won't be able to notice */ + return 5 & ((long)&testf) & ((long)&testl) & 2; } ------------------------------------------------------------------------ r25351 | vda | 2009-02-17 07:05:04 -0600 (Tue, 17 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/test/math/compile_test.c test/math/compile_test.c: add compile testing of (some) floats ------------------------------------------------------------------------ Index: test/math/compile_test.c =================================================================== --- test/math/compile_test.c (revision 25350) +++ test/math/compile_test.c (revision 25351) @@ -1,8 +1,73 @@ #include -int testl(long double long_double_x, int int_x, long long_x) +static int testf(float float_x, long double long_double_x, /*float complex float_complex_x,*/ int int_x, long long_x) { int r = 0; +r += acosf(float_x); +r += acoshf(float_x); +r += asinf(float_x); +r += asinhf(float_x); +r += atan2f(float_x, float_x); +r += atanf(float_x); +r += atanhf(float_x); +/*r += cargf(float_complex_x); - will fight with complex numbers later */ +r += cbrtf(float_x); +r += ceilf(float_x); +r += copysignf(float_x, float_x); +r += cosf(float_x); +r += coshf(float_x); +r += erfcf(float_x); +r += erff(float_x); +/*r += exp2f(float_x); - uclibc does not have it (yet?) */ +r += expf(float_x); +r += expm1f(float_x); +r += fabsf(float_x); +/*r += fdimf(float_x, float_x); - uclibc does not have it (yet?) */ +r += floorf(float_x); +/*r += fmaf(float_x, float_x, float_x); - uclibc does not have it (yet?) */ +/*r += fmaxf(float_x, float_x); - uclibc does not have it (yet?) */ +/*r += fminf(float_x, float_x); - uclibc does not have it (yet?) */ +r += fmodf(float_x, float_x); +r += frexpf(float_x, &int_x); +r += gammaf(float_x); +r += hypotf(float_x, float_x); +r += ilogbf(float_x); +r += ldexpf(float_x, int_x); +r += lgammaf(float_x); +r += llrintf(float_x); +r += llroundf(float_x); +r += log10f(float_x); +r += log1pf(float_x); +/*r += log2f(float_x); - uclibc does not have it (yet?) */ +r += logbf(float_x); +r += logf(float_x); +r += lrintf(float_x); +r += lroundf(float_x); +r += modff(float_x, &float_x); +/*r += nearbyintf(float_x); - uclibc does not have it (yet?) */ +/*r += nexttowardf(float_x, long_double_x); - uclibc does not have it (yet?) */ +r += powf(float_x, float_x); +r += remainderf(float_x, float_x); +/*r += remquof(float_x, float_x, &int_x); - uclibc does not have it (yet?) */ +r += rintf(float_x); +r += roundf(float_x); +r += scalbf(float_x, float_x); +/*r += scalblnf(float_x, long_x); - uclibc does not have it (yet?) */ +r += scalbnf(float_x, int_x); +r += significandf(float_x); +r += sinf(float_x); +r += sinhf(float_x); +r += sqrtf(float_x); +r += tanf(float_x); +r += tanhf(float_x); +/*r += tgammaf(float_x); - uclibc does not have it (yet?) */ +r += truncf(float_x); +return r; +} + +static int testl(long double long_double_x, int int_x, long long_x) +{ +int r = 0; r += __finitel(long_double_x); r += __fpclassifyl(long_double_x); r += __isinfl(long_double_x); @@ -69,5 +134,5 @@ int main(int argc, char **argv) { - return (long) &testl; + return (long) &testf + (long) &testl; } ------------------------------------------------------------------------ r25349 | vda | 2009-02-17 06:13:38 -0600 (Tue, 17 Feb 2009) | 14 lines Changed paths: M /trunk/uClibc/libm/Makefile.in M /trunk/uClibc/libm/ldouble_wrappers.c M /trunk/uClibc/test/math/compile_test.c libm/Makefile.in: reformat the list of wrappers so that it is easier to modify, sort, etc; use __ in filenames of wrappers which wrap __functions (it may be useful to have function and file names ALWAYS match); remove names of not implemented wrappers (it was generating useless empty .o files). libm/ldouble_wrappers.c: comment out the wrapper which is not compiled anyway test/math/compile_test.c: improve this test, it was optimizing out some calls, and we don't want that. No actual code changes. ------------------------------------------------------------------------ Index: test/math/compile_test.c =================================================================== --- test/math/compile_test.c (revision 25348) +++ test/math/compile_test.c (revision 25349) @@ -1,68 +1,70 @@ #include -void testl(long double long_double_x, int int_x, long long_x) +int testl(long double long_double_x, int int_x, long long_x) { -__finitel(long_double_x); -__fpclassifyl(long_double_x); -__isinfl(long_double_x); -__isnanl(long_double_x); -__signbitl(long_double_x); -acoshl(long_double_x); -acosl(long_double_x); -asinhl(long_double_x); -asinl(long_double_x); -atan2l(long_double_x, long_double_x); -atanhl(long_double_x); -atanl(long_double_x); -cbrtl(long_double_x); -ceill(long_double_x); -copysignl(long_double_x, long_double_x); -coshl(long_double_x); -cosl(long_double_x); -erfcl(long_double_x); -erfl(long_double_x); -exp2l(long_double_x); -expl(long_double_x); -expm1l(long_double_x); -fabsl(long_double_x); -fdiml(long_double_x, long_double_x); -floorl(long_double_x); -fmal(long_double_x, long_double_x, long_double_x); -fmaxl(long_double_x, long_double_x); -fminl(long_double_x, long_double_x); -fmodl(long_double_x, long_double_x); -frexpl(long_double_x, &int_x); -hypotl(long_double_x, long_double_x); -ilogbl(long_double_x); -ldexpl(long_double_x, int_x); -lgammal(long_double_x); -llrintl(long_double_x); -llroundl(long_double_x); -log10l(long_double_x); -log1pl(long_double_x); -log2l(long_double_x); -logbl(long_double_x); -logl(long_double_x); -lrintl(long_double_x); -lroundl(long_double_x); -modfl(long_double_x, &long_double_x); -nearbyintl(long_double_x); -nextafterl(long_double_x, long_double_x); -nexttowardl(long_double_x, long_double_x); -powl(long_double_x, long_double_x); -remainderl(long_double_x, long_double_x); -remquol(long_double_x, long_double_x, &int_x); -rintl(long_double_x); -roundl(long_double_x); -scalblnl(long_double_x, long_x); -scalbnl(long_double_x, int_x); -sinhl(long_double_x); -sinl(long_double_x); -sqrtl(long_double_x); -tanhl(long_double_x); -tanl(long_double_x); -tgammal(long_double_x); -truncl(long_double_x); +int r = 0; +r += __finitel(long_double_x); +r += __fpclassifyl(long_double_x); +r += __isinfl(long_double_x); +r += __isnanl(long_double_x); +r += __signbitl(long_double_x); +r += acoshl(long_double_x); +r += acosl(long_double_x); +r += asinhl(long_double_x); +r += asinl(long_double_x); +r += atan2l(long_double_x, long_double_x); +r += atanhl(long_double_x); +r += atanl(long_double_x); +r += cbrtl(long_double_x); +r += ceill(long_double_x); +r += copysignl(long_double_x, long_double_x); +r += coshl(long_double_x); +r += cosl(long_double_x); +r += erfcl(long_double_x); +r += erfl(long_double_x); +r += exp2l(long_double_x); +r += expl(long_double_x); +r += expm1l(long_double_x); +r += fabsl(long_double_x); +r += fdiml(long_double_x, long_double_x); +r += floorl(long_double_x); +r += fmal(long_double_x, long_double_x, long_double_x); +r += fmaxl(long_double_x, long_double_x); +r += fminl(long_double_x, long_double_x); +r += fmodl(long_double_x, long_double_x); +r += frexpl(long_double_x, &int_x); +r += hypotl(long_double_x, long_double_x); +r += ilogbl(long_double_x); +r += ldexpl(long_double_x, int_x); +r += lgammal(long_double_x); +r += llrintl(long_double_x); +r += llroundl(long_double_x); +r += log10l(long_double_x); +r += log1pl(long_double_x); +r += log2l(long_double_x); +r += logbl(long_double_x); +r += logl(long_double_x); +r += lrintl(long_double_x); +r += lroundl(long_double_x); +r += modfl(long_double_x, &long_double_x); +r += nearbyintl(long_double_x); +r += nextafterl(long_double_x, long_double_x); +/* r += nexttowardl(long_double_x, long_double_x); - uclibc doesn't provide this [yet?] */ +r += powl(long_double_x, long_double_x); +r += remainderl(long_double_x, long_double_x); +r += remquol(long_double_x, long_double_x, &int_x); +r += rintl(long_double_x); +r += roundl(long_double_x); +r += scalblnl(long_double_x, long_x); +r += scalbnl(long_double_x, int_x); +r += sinhl(long_double_x); +r += sinl(long_double_x); +r += sqrtl(long_double_x); +r += tanhl(long_double_x); +r += tanl(long_double_x); +r += tgammal(long_double_x); +r += truncl(long_double_x); +return r; } int main(int argc, char **argv) Index: libm/Makefile.in =================================================================== --- libm/Makefile.in (revision 25348) +++ libm/Makefile.in (revision 25349) @@ -71,25 +71,128 @@ s_isnan.c s_isnanf.c s_isinf.c s_isinff.c s_finitef.c \ s_fdim.c s_fma.c s_fmax.c s_fmin.c \ s_remquo.c w_exp2.c + +# Not implemented [yet?], see comment in float_wrappers.c: +# exp2f.o fdimf.o fmaf.o fmaxf.o fminf.o log2f.o +# nearbyintf.o remquof.o scalblnf.o tgammaf.o FL_MOBJ := \ - acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \ - ceilf.o copysignf.o cosf.o coshf.o erfcf.o erff.o exp2f.o expf.o \ - expm1f.o fabsf.o fdimf.o floorf.o fmaf.o fmaxf.o fminf.o fmodf.o \ - frexpf.o hypotf.o ilogbf.o ldexpf.o lgammaf.o llroundf.o log10f.o \ - log1pf.o log2f.o logbf.o logf.o lrintf.o lroundf.o modff.o nearbyintf.o \ - powf.o remainderf.o remquof.o rintf.o roundf.o \ - scalblnf.o scalbnf.o sinf.o sinhf.o sqrtf.o tanf.o tanhf.o \ - tgammaf.o truncf.o cargf.o llrintf.o scalbf.o gammaf.o significandf.o + acosf.o \ + acoshf.o \ + asinf.o \ + asinhf.o \ + atan2f.o \ + atanf.o \ + atanhf.o \ + cargf.o \ + cbrtf.o \ + ceilf.o \ + copysignf.o \ + cosf.o \ + coshf.o \ + erfcf.o \ + erff.o \ + expf.o \ + expm1f.o \ + fabsf.o \ + floorf.o \ + fmodf.o \ + frexpf.o \ + gammaf.o \ + hypotf.o \ + ilogbf.o \ + ldexpf.o \ + lgammaf.o \ + llrintf.o \ + llroundf.o \ + log10f.o \ + log1pf.o \ + logbf.o \ + logf.o \ + lrintf.o \ + lroundf.o \ + modff.o \ + powf.o \ + remainderf.o \ + rintf.o \ + roundf.o \ + scalbf.o \ + scalbnf.o \ + significandf.o \ + sinf.o \ + sinhf.o \ + sqrtf.o \ + tanf.o \ + tanhf.o \ + truncf.o \ -LD_MOBJ := acoshl.o acosl.o asinhl.o asinl.o atan2l.o atanhl.o atanl.o cargl.o cbrtl.o \ - ceill.o copysignl.o coshl.o cosl.o erfcl.o erfl.o exp2l.o expl.o \ - expm1l.o fabsl.o finitel.o fdiml.o floorl.o fmal.o fmaxl.o fminl.o fmodl.o fpclassifyl.o \ - frexpl.o gammal.o hypotl.o ilogbl.o isinfl.o isnanl.o ldexpl.o lgammal.o llrintl.o \ - llroundl.o log10l.o log1pl.o log2l.o logbl.o logl.o lrintl.o lroundl.o \ - modfl.o nearbyintl.o nextafterl.o XXXnexttowardl.o powl.o remainderl.o \ - remquol.o rintl.o roundl.o scalblnl.o scalbnl.o __signbitl.o sinhl.o sinl.o sqrtl.o \ - tanhl.o tanl.o tgammal.o truncl.o significandl.o +# Not implemented [yet?]: nexttowardl.o +LD_MOBJ := \ + __finitel.o \ + __fpclassifyl.o \ + __isinfl.o \ + __isnanl.o \ + __signbitl.o \ + acoshl.o \ + acosl.o \ + asinhl.o \ + asinl.o \ + atan2l.o \ + atanhl.o \ + atanl.o \ + cargl.o \ + cbrtl.o \ + ceill.o \ + copysignl.o \ + coshl.o \ + cosl.o \ + erfcl.o \ + erfl.o \ + exp2l.o \ + expl.o \ + expm1l.o \ + fabsl.o \ + fdiml.o \ + floorl.o \ + fmal.o \ + fmaxl.o \ + fminl.o \ + fmodl.o \ + frexpl.o \ + gammal.o \ + hypotl.o \ + ilogbl.o \ + ldexpl.o \ + lgammal.o \ + llrintl.o \ + llroundl.o \ + log10l.o \ + log1pl.o \ + log2l.o \ + logbl.o \ + logl.o \ + lrintl.o \ + lroundl.o \ + modfl.o \ + nearbyintl.o \ + nextafterl.o \ + powl.o \ + remainderl.o \ + remquol.o \ + rintl.o \ + roundl.o \ + scalblnl.o \ + scalbnl.o \ + significandl.o \ + sinhl.o \ + sinl.o \ + sqrtl.o \ + tanhl.o \ + tanl.o \ + tgammal.o \ + truncl.o \ + else + # This list of math functions was taken from POSIX/IEEE 1003.1b-1993 libm_CSRC := \ s_atan.c s_ceil.c s_cos.c \ Index: libm/ldouble_wrappers.c =================================================================== --- libm/ldouble_wrappers.c (revision 25348) +++ libm/ldouble_wrappers.c (revision 25349) @@ -401,11 +401,13 @@ } #endif -#ifdef L_nexttowardl +/* Disabled in Makefile.in */ +#if 0 /* def L_nexttowardl */ long double nexttowardl (long double x, long double y) { return (long double) nexttoward( (double)x, (double)y ); } +libm_hidden_def(nexttowardl) #endif #ifdef L_powl @@ -492,12 +494,12 @@ #ifdef __DO_C99_MATH__ -#ifdef L_fpclassifyl +#ifdef L___fpclassifyl int_WRAPPER1(__fpclassify) libm_hidden_def(__fpclassifyl) #endif -#ifdef L_finitel +#ifdef L___finitel int_WRAPPER1(__finite) libm_hidden_def(__finitel) #endif @@ -507,12 +509,12 @@ libm_hidden_def(__signbitl) #endif -#ifdef L_isnanl +#ifdef L___isnanl int_WRAPPER1(__isnan) libm_hidden_def(__isnanl) #endif -#ifdef L_isinfl +#ifdef L___isinfl int_WRAPPER1(__isinf) libm_hidden_def(__isinfl) #endif ------------------------------------------------------------------------ r25347 | vda | 2009-02-16 19:54:15 -0600 (Mon, 16 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/include/math.h fix typo in comment ------------------------------------------------------------------------ Index: include/math.h =================================================================== --- include/math.h (revision 25346) +++ include/math.h (revision 25347) @@ -90,7 +90,7 @@ #endif -/* Include the file of declarations, declaring souble versions */ +/* Include the file of declarations, declaring double versions */ #if defined _LIBC # define __MATHDECLI_MAINVARIANT(x) libm_hidden_proto(x) ------------------------------------------------------------------------ r25345 | vda | 2009-02-16 19:45:32 -0600 (Mon, 16 Feb 2009) | 4 lines Changed paths: M /trunk/uClibc/include/math.h M /trunk/uClibc/libc/sysdeps/linux/common/bits/mathcalls.h M /trunk/uClibc/libm/Makefile.in M /trunk/uClibc/libm/ldouble_wrappers.c M /trunk/uClibc/test/math/Makefile A /trunk/uClibc/test/math/compile_test.c M /trunk/uClibc/test/math/libm-test.inc test/math/compile_test.c: "are long double functions even compile/link?" test *: fix everything which prevents above from building ------------------------------------------------------------------------ Index: test/math/compile_test.c =================================================================== --- test/math/compile_test.c (revision 0) +++ test/math/compile_test.c (revision 25345) @@ -0,0 +1,71 @@ +#include + +void testl(long double long_double_x, int int_x, long long_x) +{ +__finitel(long_double_x); +__fpclassifyl(long_double_x); +__isinfl(long_double_x); +__isnanl(long_double_x); +__signbitl(long_double_x); +acoshl(long_double_x); +acosl(long_double_x); +asinhl(long_double_x); +asinl(long_double_x); +atan2l(long_double_x, long_double_x); +atanhl(long_double_x); +atanl(long_double_x); +cbrtl(long_double_x); +ceill(long_double_x); +copysignl(long_double_x, long_double_x); +coshl(long_double_x); +cosl(long_double_x); +erfcl(long_double_x); +erfl(long_double_x); +exp2l(long_double_x); +expl(long_double_x); +expm1l(long_double_x); +fabsl(long_double_x); +fdiml(long_double_x, long_double_x); +floorl(long_double_x); +fmal(long_double_x, long_double_x, long_double_x); +fmaxl(long_double_x, long_double_x); +fminl(long_double_x, long_double_x); +fmodl(long_double_x, long_double_x); +frexpl(long_double_x, &int_x); +hypotl(long_double_x, long_double_x); +ilogbl(long_double_x); +ldexpl(long_double_x, int_x); +lgammal(long_double_x); +llrintl(long_double_x); +llroundl(long_double_x); +log10l(long_double_x); +log1pl(long_double_x); +log2l(long_double_x); +logbl(long_double_x); +logl(long_double_x); +lrintl(long_double_x); +lroundl(long_double_x); +modfl(long_double_x, &long_double_x); +nearbyintl(long_double_x); +nextafterl(long_double_x, long_double_x); +nexttowardl(long_double_x, long_double_x); +powl(long_double_x, long_double_x); +remainderl(long_double_x, long_double_x); +remquol(long_double_x, long_double_x, &int_x); +rintl(long_double_x); +roundl(long_double_x); +scalblnl(long_double_x, long_x); +scalbnl(long_double_x, int_x); +sinhl(long_double_x); +sinl(long_double_x); +sqrtl(long_double_x); +tanhl(long_double_x); +tanl(long_double_x); +tgammal(long_double_x); +truncl(long_double_x); +} + +int main(int argc, char **argv) +{ + return (long) &testl; +} Index: test/math/libm-test.inc =================================================================== --- test/math/libm-test.inc (revision 25344) +++ test/math/libm-test.inc (revision 25345) @@ -4231,8 +4231,8 @@ static void scalb_test (void) { - START (scalb); +#ifndef TEST_LDOUBLE /* uclibc doesn't have scalbl */ TEST_ff_f (scalb, 2.0, 0.5, nan_value, INVALID_EXCEPTION); TEST_ff_f (scalb, 3.0, -2.5, nan_value, INVALID_EXCEPTION); @@ -4283,7 +4283,7 @@ TEST_ff_f (scalb, 0.8L, 4, 12.8L); TEST_ff_f (scalb, -0.854375L, 5, -27.34L); - +#endif END (scalb); } Index: test/math/Makefile =================================================================== --- test/math/Makefile (revision 25344) +++ test/math/Makefile (revision 25345) @@ -1,9 +1,11 @@ # uClibc math tests # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +include ../../.config + TESTS := basic-test rint tst-definitions test-fpucw test-float test-ifloat test-double test-idouble ifeq ($(strip $(UCLIBC_HAS_LONG_DOUBLE_MATH)),y) -TESTS += test-ldouble test-ildouble +TESTS += test-ldouble test-ildoubl compile_test else CFLAGS_basic-test := -DNO_LONG_DOUBLE endif Index: libm/Makefile.in =================================================================== --- libm/Makefile.in (revision 25344) +++ libm/Makefile.in (revision 25345) @@ -85,10 +85,10 @@ ceill.o copysignl.o coshl.o cosl.o erfcl.o erfl.o exp2l.o expl.o \ expm1l.o fabsl.o finitel.o fdiml.o floorl.o fmal.o fmaxl.o fminl.o fmodl.o fpclassifyl.o \ frexpl.o gammal.o hypotl.o ilogbl.o isinfl.o isnanl.o ldexpl.o lgammal.o llrintl.o \ - llroundl.o log10l.o log1pl.o XXXlog2l.o logbl.o logl.o lrintl.o lroundl.o \ + llroundl.o log10l.o log1pl.o log2l.o logbl.o logl.o lrintl.o lroundl.o \ modfl.o nearbyintl.o nextafterl.o XXXnexttowardl.o powl.o remainderl.o \ remquol.o rintl.o roundl.o scalblnl.o scalbnl.o __signbitl.o sinhl.o sinl.o sqrtl.o \ - tanhl.o tanl.o tgammal.o truncl.o + tanhl.o tanl.o tgammal.o truncl.o significandl.o else # This list of math functions was taken from POSIX/IEEE 1003.1b-1993 libm_CSRC := \ Index: libm/ldouble_wrappers.c =================================================================== --- libm/ldouble_wrappers.c (revision 25344) +++ libm/ldouble_wrappers.c (revision 25345) @@ -309,6 +309,15 @@ } #endif +#ifdef L_gammal +/* WRAPPER1(gamma) won't work, tries to call __GI_xxx, + * and gamma() hasn't got one. */ +long double gammal(long double x) +{ + return (long double) gamma((double) x); +} +#endif + #ifdef L_hypotl long double hypotl (long double x, long double y) { @@ -348,7 +357,11 @@ #endif #ifdef L_log2l -WRAPPER1(log2) +/* WRAPPER1(log2) won't work */ +long double log2l(long double x) +{ + return (long double) log2((double)x); +} #endif #ifdef L_logbl @@ -438,6 +451,8 @@ } #endif +/* scalb is an obsolete function */ + #ifdef L_sinhl WRAPPER1(sinh) #endif @@ -466,18 +481,30 @@ WRAPPER1(trunc) #endif +#ifdef L_significandl +/* WRAPPER1(significand) won't work, tries to call __GI_xxx, + * and significand() hasn't got one. */ +long double significandl(long double x) +{ + return (long double) significand((double) x); +} +#endif + #ifdef __DO_C99_MATH__ #ifdef L_fpclassifyl -int_WRAPPER1(__fpclassify); +int_WRAPPER1(__fpclassify) +libm_hidden_def(__fpclassifyl) #endif #ifdef L_finitel int_WRAPPER1(__finite) +libm_hidden_def(__finitel) #endif #ifdef L___signbitl int_WRAPPER1(__signbit) +libm_hidden_def(__signbitl) #endif #ifdef L_isnanl Index: include/math.h =================================================================== --- include/math.h (revision 25344) +++ include/math.h (revision 25345) @@ -52,38 +52,46 @@ so we can easily declare each function as both `name' and `__name', and can declare the float versions `namef' and `__namef'. */ -#define __MATHCALL(function,suffix, args) \ - __MATHDECL (_Mdouble_,function,suffix, args) -#define __MATHDECL(type, function,suffix, args) \ - __MATHDECL_1(type, function,suffix, args); +#define __MATHDECL_1(type,function,suffix,args) \ + extern type __MATH_PRECNAME(function,suffix) args __THROW -#define __MATHCALLX(function,suffix, args, attrib) \ - __MATHDECLX (_Mdouble_,function,suffix, args, attrib) -#define __MATHDECL_1(type, function,suffix, args) \ - extern type __MATH_PRECNAME(function,suffix) args __THROW -#define __MATHDECLX(type, function,suffix, args, attrib) \ - __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ +#define __MATHDECL(type,function,suffix,args) \ + __MATHDECL_1(type,function,suffix,args); + +#define __MATHCALL(function,suffix,args) \ + __MATHDECL(_Mdouble_,function,suffix,args) + +#define __MATHDECLX(type,function,suffix,args,attrib) \ + __MATHDECL_1(type,function,suffix,args) __attribute__ (attrib); \ __MATHDECLI_MAINVARIANT(function) +#define __MATHCALLX(function,suffix,args,attrib) \ + __MATHDECLX(_Mdouble_,function,suffix,args,attrib) + /* Decls which are also used internally in libm. Only the main variant is used internally, no need to try to avoid relocs for the {l,f} variants. */ -#define __MATHCALLI(function,suffix, args) \ - __MATHDECLI (_Mdouble_,function,suffix, args) -#define __MATHDECLI(type, function,suffix, args) \ - __MATHDECL_1(type, function,suffix, args); \ +#define __MATHDECLI(type,function,suffix,args) \ + __MATHDECL_1(type,function,suffix,args); \ __MATHDECLI_MAINVARIANT(function) + +#define __MATHCALLI(function,suffix,args) \ + __MATHDECLI(_Mdouble_,function,suffix,args) + /* Private helpers for purely macro impls below. Only make __foo{,f,l} visible but not (the macro-only) foo. */ #if defined _LIBC -# define __MATHDECL_PRIV(type, function,suffix, args, attrib) \ - __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib); \ +# define __MATHDECL_PRIV(type,function,suffix,args,attrib) \ + __MATHDECL_1(type,__CONCAT(__,function),suffix,args) __attribute__ (attrib); \ libm_hidden_proto(__MATH_PRECNAME(__##function,suffix)) #else -# define __MATHDECL_PRIV(type, function,suffix, args, attrib) \ - __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib); +# define __MATHDECL_PRIV(type,function,suffix,args,attrib) \ + __MATHDECL_1(type,__CONCAT(__,function),suffix,args) __attribute__ (attrib); #endif + +/* Include the file of declarations, declaring souble versions */ + #if defined _LIBC # define __MATHDECLI_MAINVARIANT(x) libm_hidden_proto(x) #else @@ -124,7 +132,8 @@ # undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME -# if (__STDC__ - 0 || __GNUC__ - 0) \ + +# if (defined __STDC__ || defined __GNUC__) \ && (defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ || defined __LDBL_COMPAT) # ifdef __LDBL_COMPAT @@ -147,11 +156,10 @@ instead of `double' and appending l to each function name. */ # undef __MATHDECL_1 -# define __MATHDECL_2(type, function,suffix, args, alias) \ - extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ - args, alias) -# define __MATHDECL_1(type, function,suffix, args) \ - __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) +# define __MATHDECL_2(type,function,suffix,args,alias) \ + extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix),args,alias) +# define __MATHDECL_1(type,function,suffix,args) \ + __MATHDECL_2(type,function,suffix,args,__CONCAT(function,suffix)) # endif # ifndef _Mlong_double_ Index: libc/sysdeps/linux/common/bits/mathcalls.h =================================================================== --- libc/sysdeps/linux/common/bits/mathcalls.h (revision 25344) +++ libc/sysdeps/linux/common/bits/mathcalls.h (revision 25345) @@ -48,6 +48,13 @@ #endif +/* __MATHCALLX includes libm_hidden_def + * __MATHCALLI includes libm_hidden_def too + * __MATHCALL does not + * __MATHDECL_PRIV includes libm_hidden_def and declared only __foo, not foo + */ + + /* Trigonometric functions. */ _Mdouble_BEGIN_NAMESPACE ------------------------------------------------------------------------ r25343 | vda | 2009-02-16 08:08:09 -0600 (Mon, 16 Feb 2009) | 4 lines Changed paths: M /trunk/uClibc/Makefile.in Makefile.in: comment out deletion of include/ucontext.h, it is included from include/signal.h. ------------------------------------------------------------------------ Index: Makefile.in =================================================================== --- Makefile.in (revision 25342) +++ Makefile.in (revision 25343) @@ -316,7 +316,8 @@ ifneq ($(UCLIBC_SUSV3_LEGACY),y) # Remove timeb.h since the LEGACY ftime() was disabled upon request $(RM) $(PREFIX)$(DEVEL_PREFIX)include/sys/timeb.h - $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ucontext.h + # BREAKAGE: include/signal.h uses it, this rm broke bbox compile: + ### $(RM) $(PREFIX)$(DEVEL_PREFIX)include/ucontext.h $(RM) $(PREFIX)$(DEVEL_PREFIX)include/regexp.h endif ifneq ($(UCLIBC_HAS_EPOLL),y) ------------------------------------------------------------------------ r25337 | vda | 2009-02-14 23:45:24 -0600 (Sat, 14 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/libc/stdio/_fopen.c M /trunk/uClibc/libc/stdio/_stdio.c M /trunk/uClibc/libc/stdio/fdopen.c M /trunk/uClibc/libc/stdio/fopen.c suppress bogus ioctl on fd==INT_MAX when vasprintf() is called ------------------------------------------------------------------------ Index: libc/stdio/_fopen.c =================================================================== --- libc/stdio/_fopen.c (revision 25336) +++ libc/stdio/_fopen.c (revision 25337) @@ -121,11 +121,11 @@ i = (open_mode & (O_ACCMODE|O_LARGEFILE)) + 1; /* NOTE: fopencookie needs changing if the basic check changes! */ - if (((i & (((int) fname_or_mode) + 1)) != i) /* Basic agreement? */ - || (((open_mode & ~((__mode_t) fname_or_mode)) & O_APPEND) - && fcntl(filedes, F_SETFL, O_APPEND)) /* Need O_APPEND. */ - ) { + if ((i & ((int)fname_or_mode + 1)) != i) /* Basic agreement? */ goto DO_EINVAL; + if ((open_mode & ~(__mode_t)fname_or_mode) & O_APPEND) { + if (fcntl(filedes, F_SETFL, O_APPEND)) /* Need O_APPEND. */ + goto DO_EINVAL; } /* For later... to reflect largefile setting in stream flags. */ __STDIO_WHEN_LFS( open_mode |= (((__mode_t) fname_or_mode) @@ -159,9 +159,15 @@ ((((open_mode & O_ACCMODE) + 1) ^ 0x03) * __FLAG_WRITEONLY); #ifdef __STDIO_BUFFERS - i = errno; /* Preserve errno against isatty call. */ - stream->__modeflags |= (isatty(stream->__filedes) * __FLAG_LBF); - __set_errno(i); + if (stream->__filedes != INT_MAX) { + /* NB: fopencookie uses bogus filedes == INT_MAX, + * avoiding isatty() in that case. + */ + i = errno; /* preserve errno against isatty call. */ + if (isatty(stream->__filedes)) + stream->__modeflags |= __FLAG_LBF; + __set_errno(i); + } if (!stream->__bufstart) { if ((stream->__bufstart = malloc(BUFSIZ)) != NULL) { Index: libc/stdio/fopen.c =================================================================== --- libc/stdio/fopen.c (revision 25336) +++ libc/stdio/fopen.c (revision 25337) @@ -9,9 +9,9 @@ #ifndef __DO_LARGEFILE # define FILEDES_ARG (-1) -#undef fopen +# undef fopen #else -#undef fopen64 +# undef fopen64 #endif /* libc_hidden_proto(fopen) */ Index: libc/stdio/fdopen.c =================================================================== --- libc/stdio/fdopen.c (revision 25336) +++ libc/stdio/fdopen.c (revision 25337) @@ -14,8 +14,9 @@ { intptr_t cur_mode; - return (((cur_mode = fcntl(filedes, F_GETFL))) != -1) - ? _stdio_fopen(cur_mode, mode, NULL, filedes) - : NULL; + cur_mode = fcntl(filedes, F_GETFL); + if (cur_mode != -1) + return _stdio_fopen(cur_mode, mode, NULL, filedes); + return NULL; } libc_hidden_def(fdopen) Index: libc/stdio/_stdio.c =================================================================== --- libc/stdio/_stdio.c (revision 25336) +++ libc/stdio/_stdio.c (revision 25337) @@ -253,8 +253,10 @@ #ifdef __STDIO_BUFFERS int old_errno = errno; /* stdin and stdout uses line buffering when connected to a tty. */ - _stdio_streams[0].__modeflags ^= (1-isatty(0)) * __FLAG_LBF; - _stdio_streams[1].__modeflags ^= (1-isatty(1)) * __FLAG_LBF; + if (!isatty(0)) + _stdio_streams[0].__modeflags ^= __FLAG_LBF; + if (!isatty(1)) + _stdio_streams[1].__modeflags ^= __FLAG_LBF; __set_errno(old_errno); #endif #ifndef __UCLIBC__ ------------------------------------------------------------------------ r25329 | vda | 2009-02-13 21:26:57 -0600 (Fri, 13 Feb 2009) | 4 lines Changed paths: M /trunk/uClibc/include/math.h M /trunk/uClibc/libm/s_nextafterf.c math.h: fix libm_hidden_proto leak into sanitized headers libm/s_nextafterf.c: use /* */ comments ------------------------------------------------------------------------ Index: libm/s_nextafterf.c =================================================================== --- libm/s_nextafterf.c (revision 25328) +++ libm/s_nextafterf.c (revision 25329) @@ -33,12 +33,12 @@ return y; if (ix == 0) { /* x == 0? */ -// glibc 2.4 does not seem to set underflow? -// float u; +/* glibc 2.4 does not seem to set underflow? */ +/* float u; */ /* return +-minsubnormal */ SET_FLOAT_WORD(x, (hy & 0x80000000) | 1); -// u = x * x; /* raise underflow flag */ -// math_force_eval(u); +/* u = x * x; raise underflow flag */ +/* math_force_eval(u); */ return x; } Index: include/math.h =================================================================== --- include/math.h (revision 25328) +++ include/math.h (revision 25329) @@ -46,9 +46,6 @@ /* Get general and ISO C99 specific information. */ #include -#if !(defined _LIBC && (defined NOT_IN_libc && defined IS_IN_libm)) -# define libm_hidden_proto(name, attrs...) -#endif /* The file contains the prototypes for all the actual math functions. These macros are used for those prototypes, @@ -59,13 +56,15 @@ __MATHDECL (_Mdouble_,function,suffix, args) #define __MATHDECL(type, function,suffix, args) \ __MATHDECL_1(type, function,suffix, args); + #define __MATHCALLX(function,suffix, args, attrib) \ __MATHDECLX (_Mdouble_,function,suffix, args, attrib) +#define __MATHDECL_1(type, function,suffix, args) \ + extern type __MATH_PRECNAME(function,suffix) args __THROW #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECLI_MAINVARIANT(function) -#define __MATHDECL_1(type, function,suffix, args) \ - extern type __MATH_PRECNAME(function,suffix) args __THROW + /* Decls which are also used internally in libm. Only the main variant is used internally, no need to try to avoid relocs for the {l,f} variants. */ @@ -76,16 +75,24 @@ __MATHDECLI_MAINVARIANT(function) /* Private helpers for purely macro impls below. Only make __foo{,f,l} visible but not (the macro-only) foo. */ -#define __MATHDECL_PRIV(type, function,suffix, args, attrib) \ - __MATHDECL_1(type, __CONCAT(__,function),suffix, args) \ - __attribute__ (attrib); \ +#if defined _LIBC +# define __MATHDECL_PRIV(type, function,suffix, args, attrib) \ + __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib); \ libm_hidden_proto(__MATH_PRECNAME(__##function,suffix)) +#else +# define __MATHDECL_PRIV(type, function,suffix, args, attrib) \ + __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib); +#endif -#define __MATHDECLI_MAINVARIANT libm_hidden_proto -#define _Mdouble_ double -#define __MATH_PRECNAME(name,r) __CONCAT(name,r) -# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD -# define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD +#if defined _LIBC +# define __MATHDECLI_MAINVARIANT(x) libm_hidden_proto(x) +#else +# define __MATHDECLI_MAINVARIANT(x) +#endif +#define _Mdouble_ double +#define __MATH_PRECNAME(name,r) __CONCAT(name,r) +#define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD +#define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD #include #undef _Mdouble_ #undef _Mdouble_BEGIN_NAMESPACE @@ -94,9 +101,9 @@ #undef __MATHDECLI_MAINVARIANT #define __MATHDECLI_MAINVARIANT(x) + #if defined __USE_MISC || defined __USE_ISOC99 - /* Include the file of declarations again, this time using `float' instead of `double' and appending f to each function name. */ @@ -160,8 +167,8 @@ # define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 # include # undef _Mdouble_ -# undef _Mdouble_BEGIN_NAMESPACE -# undef _Mdouble_END_NAMESPACE +# undef _Mdouble_BEGIN_NAMESPACE +# undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME # endif /* __STDC__ || __GNUC__ */ ------------------------------------------------------------------------ r25326 | vapier | 2009-02-13 12:57:43 -0600 (Fri, 13 Feb 2009) | 1 line Changed paths: M /trunk/uClibc/extra/scripts/install_headers.sh strict POSIX requires a path to specified to `find` ------------------------------------------------------------------------ Index: extra/scripts/install_headers.sh =================================================================== --- extra/scripts/install_headers.sh (revision 25325) +++ extra/scripts/install_headers.sh (revision 25326) @@ -33,7 +33,7 @@ ( # We must cd, or else we'll prepend "$1" to filenames! cd "$1" || exit 1 -find ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \ +find . ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \ -e '/^config$/d' ) | \ ( ------------------------------------------------------------------------ r25325 | aldot | 2009-02-13 09:35:26 -0600 (Fri, 13 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/include/unistd.h M /trunk/uClibc/libc/sysdeps/linux/common/getdomainname.c - repair my r25322 that ment to deal with getdomainname()'s visibility ------------------------------------------------------------------------ Index: include/unistd.h =================================================================== --- include/unistd.h (revision 25324) +++ include/unistd.h (revision 25325) @@ -908,16 +908,15 @@ This call is restricted to the super-user. */ extern int sethostid (long int __id) __THROW __wur; -#if defined __UCLIBC_BSD_SPECIFIC__ -# if defined UCLIBC_INTERNAL -/* separate preprocessor test for unifdef */ +#if defined __UCLIBC_BSD_SPECIFIC__ || defined UCLIBC_INTERNAL /* Get and set the NIS (aka YP) domain name, if any. Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname (char *__name, size_t __len) __THROW __nonnull ((1)) __wur; -# endif libc_hidden_proto(getdomainname) +#endif +#if defined __UCLIBC_BSD_SPECIFIC__ extern int setdomainname (__const char *__name, size_t __len) __THROW __nonnull ((1)) __wur; #endif Index: libc/sysdeps/linux/common/getdomainname.c =================================================================== --- libc/sysdeps/linux/common/getdomainname.c (revision 25324) +++ libc/sysdeps/linux/common/getdomainname.c (revision 25325) @@ -16,7 +16,11 @@ /* Experimentally off - libc_hidden_proto(strcpy) */ /* libc_hidden_proto(uname) */ -int getdomainname(char *name, size_t len) +int +#ifndef __UCLIBC_BSD_SPECIFIC__ +attribute_hidden +#endif +getdomainname(char *name, size_t len) { struct utsname uts; @@ -42,7 +46,7 @@ #endif return 0; } -#ifdef __UCLIBC_BSD_SPECIFIC__ +# ifdef __UCLIBC_BSD_SPECIFIC__ libc_hidden_def(getdomainname) +# endif #endif -#endif ------------------------------------------------------------------------ r25324 | aldot | 2009-02-13 09:22:47 -0600 (Fri, 13 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/libm/float_wrappers.c - scalb{,f,l} depend on UCLIBC_SUSV3_LEGACY ------------------------------------------------------------------------ Index: libm/float_wrappers.c =================================================================== --- libm/float_wrappers.c (revision 25323) +++ libm/float_wrappers.c (revision 25324) @@ -388,7 +388,7 @@ } #endif -#ifdef L_scalbf +#if defined L_scalbf && defined __UCLIBC_SUSV3_LEGACY__ float scalbf (float x, float y) { return (float) scalb( (double)x, (double)y ); ------------------------------------------------------------------------ r25323 | aldot | 2009-02-13 09:04:08 -0600 (Fri, 13 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/libc/inet/resolv.c - fix comment style to make it compile again - add note about "/etc/config/" and the resolver code per se. ------------------------------------------------------------------------ Index: libc/inet/resolv.c =================================================================== --- libc/inet/resolv.c (revision 25322) +++ libc/inet/resolv.c (revision 25323) @@ -133,6 +133,14 @@ * */ +/* Nota bene: + The whole resolver code has several (severe) problems: + - it doesn't even build without IPv4, i.e. !UCLIBC_HAS_IPV4 but only IPv6 + - it is way too big + + Both points above are considered bugs, patches/reimplementations welcome. +*/ + #define __FORCE_GLIBC #include #include @@ -303,7 +311,7 @@ /* Protected by __resolv_lock */ extern void (*__res_sync)(void) attribute_hidden; -//extern uint32_t __resolv_opts attribute_hidden; +/*extern uint32_t __resolv_opts attribute_hidden; */ extern unsigned __nameservers attribute_hidden; extern unsigned __searchdomains attribute_hidden; extern sockaddr46_t *__nameserver attribute_hidden; @@ -651,7 +659,7 @@ offset += i; -//TODO: what if strdup fails? +/*TODO: what if strdup fails? */ q->dotted = strdup(temp); q->qtype = (message[offset + 0] << 8) | message[offset + 1]; q->qclass = (message[offset + 2] << 8) | message[offset + 3]; @@ -731,7 +739,7 @@ return len; } -// TODO: what if strdup fails? +/* TODO: what if strdup fails? */ a->dotted = strdup(temp); a->atype = (message[0] << 8) | message[1]; message += 2; @@ -875,7 +883,7 @@ /* Protected by __resolv_lock */ void (*__res_sync)(void); -//uint32_t __resolv_opts; +/*uint32_t __resolv_opts; */ unsigned __nameservers; unsigned __searchdomains; sockaddr46_t *__nameserver; @@ -944,7 +952,10 @@ fp = fopen("/etc/resolv.conf", "r"); if (!fp) { -// TODO: why? google says nothing about this... + /* If we do not have a pre-populated /etc/resolv.conf then + try to use the one from /etc/config which exists on numerous + systems ranging from some uClinux to IRIX installations and + may be the only /etc dir that was mounted rw. */ fp = fopen("/etc/config/resolv.conf", "r"); } @@ -1169,12 +1180,12 @@ /* first time? pick starting server etc */ if (local_ns_num < 0) { local_id = last_id; -//TODO: implement /etc/resolv.conf's "options rotate" -// (a.k.a. RES_ROTATE bit in _res.options) -// local_ns_num = 0; -// if (_res.options & RES_ROTATE) +/*TODO: implement /etc/resolv.conf's "options rotate" + (a.k.a. RES_ROTATE bit in _res.options) + local_ns_num = 0; + if (_res.options & RES_ROTATE) */ local_ns_num = last_ns_num; -//TODO: use _res.retry +/*TODO: use _res.retry */ retries_left = __nameservers * RES_DFLRETRY; } retries_left--; @@ -1221,20 +1232,20 @@ goto try_next_server; rc = connect(fd, &sa.sa, sizeof(sa)); if (rc < 0) { - //if (errno == ENETUNREACH) { + /*if (errno == ENETUNREACH) { */ /* routing error, presume not transient */ goto try_next_server; - //} -//For example, what transient error this can be? Can't think of any - ///* retry */ - //continue; + /*} */ +/*For example, what transient error this can be? Can't think of any */ + /* retry */ + /*continue; */ } DPRINTF("Xmit packet len:%d id:%d qr:%d\n", len, h.id, h.qr); /* no error check - if it fails, we time out on recv */ send(fd, packet, len, 0); #ifdef USE_SELECT -//TODO: use _res.retrans +/*TODO: use _res.retrans*/ reply_timeout = RES_TIMEOUT; wait_again: FD_ZERO(&fds); @@ -1259,7 +1270,7 @@ * to next nameserver */ goto try_next_server; } -//TODO: better timeout accounting? +/*TODO: better timeout accounting?*/ reply_timeout -= 1000; #endif len = recv(fd, packet, PACKETSZ, MSG_DONTWAIT); @@ -1805,8 +1816,6 @@ #ifdef L_gethostbyname_r -//Does this function assume IPv4? If yes, -//what happens in IPv6-only build? /* Bug 671 says: * "uClibc resolver's gethostbyname does not return the requested name @@ -2109,7 +2118,7 @@ result_buf->h_addrtype = AF_INET6; result_buf->h_length = sizeof(*in); result_buf->h_addr_list = (char **) addr_list; - //result_buf->h_aliases = ??? + /* result_buf->h_aliases = ??? */ *result = result_buf; *h_errnop = NETDB_SUCCESS; return NETDB_SUCCESS; @@ -2124,10 +2133,10 @@ } /* talk to DNS servers */ -// TODO: why it's so different from gethostbyname_r (IPv4 case)? +/* TODO: why it's so different from gethostbyname_r (IPv4 case)? */ memset(&a, '\0', sizeof(a)); for (;;) { -// Hmm why we memset(a) to zeros only once? +/* Hmm why we memset(a) to zeros only once? */ i = __dns_lookup(buf, T_AAAA, &packet, &a); if (i < 0) { *h_errnop = HOST_NOT_FOUND; @@ -2157,7 +2166,7 @@ result_buf->h_addrtype = AF_INET6; result_buf->h_length = sizeof(*in); result_buf->h_addr_list = (char **) addr_list; - //result_buf->h_aliases = ??? + /* result_buf->h_aliases = ??? */ free(packet); *result = result_buf; *h_errnop = NETDB_SUCCESS; @@ -2281,7 +2290,7 @@ memset(&a, '\0', sizeof(a)); for (;;) { -// Hmm why we memset(a) to zeros only once? +/* Hmm why we memset(a) to zeros only once? */ i = __dns_lookup(buf, T_PTR, &packet, &a); if (i < 0) { *h_errnop = HOST_NOT_FOUND; @@ -2730,9 +2739,10 @@ } /* Extend and comment what program is known * to use which _res.XXX member(s). + + __resolv_opts = rp->options; + ... */ - // __resolv_opts = rp->options; - // ... } /* Our res_init never fails (always returns 0) */ @@ -2756,7 +2766,7 @@ #ifdef __UCLIBC_HAS_COMPAT_RES_STATE__ rp->retrans = RES_TIMEOUT; rp->retry = 4; -//TODO: pulls in largish static buffers... use simpler one? +/*TODO: pulls in largish static buffers... use simpler one? */ rp->id = random(); #endif rp->ndots = 1; ------------------------------------------------------------------------ r25322 | aldot | 2009-02-13 08:12:19 -0600 (Fri, 13 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/include/unistd.h M /trunk/uClibc/libc/sysdeps/linux/common/getdomainname.c - we may need getdomainname internally ------------------------------------------------------------------------ Index: include/unistd.h =================================================================== --- include/unistd.h (revision 25321) +++ include/unistd.h (revision 25322) @@ -909,11 +909,14 @@ extern int sethostid (long int __id) __THROW __wur; #if defined __UCLIBC_BSD_SPECIFIC__ +# if defined UCLIBC_INTERNAL +/* separate preprocessor test for unifdef */ /* Get and set the NIS (aka YP) domain name, if any. Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname (char *__name, size_t __len) __THROW __nonnull ((1)) __wur; +# endif libc_hidden_proto(getdomainname) extern int setdomainname (__const char *__name, size_t __len) __THROW __nonnull ((1)) __wur; Index: libc/sysdeps/linux/common/getdomainname.c =================================================================== --- libc/sysdeps/linux/common/getdomainname.c (revision 25321) +++ libc/sysdeps/linux/common/getdomainname.c (revision 25322) @@ -42,5 +42,7 @@ #endif return 0; } +#ifdef __UCLIBC_BSD_SPECIFIC__ libc_hidden_def(getdomainname) #endif +#endif ------------------------------------------------------------------------ r25321 | aldot | 2009-02-13 08:10:35 -0600 (Fri, 13 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/libm/ldouble_wrappers.c - use existing __stringify macro ------------------------------------------------------------------------ Index: libm/ldouble_wrappers.c =================================================================== --- libm/ldouble_wrappers.c (revision 25320) +++ libm/ldouble_wrappers.c (revision 25321) @@ -16,8 +16,6 @@ #include "math.h" #include -#define STRINGIZE(s) #s - #define WRAPPER1(func) \ long double func##l(long double x) \ { \ @@ -71,7 +69,7 @@ __asm ( \ " fldt %1\n" \ " fstpl %1\n" \ - " jmp " STRINGIZE(__GI_##func) "\n" \ + " jmp " __stringify(__GI_##func) "\n" \ : "=t" (st_top) \ : "m" (x) \ ); \ @@ -84,7 +82,7 @@ __asm ( \ " fldt %1\n" \ " fstpl %1\n" \ - " jmp " STRINGIZE(__GI_##func) "\n" \ + " jmp " __stringify(__GI_##func) "\n" \ : "=a" (ret) \ : "m" (x) \ ); \ @@ -97,7 +95,7 @@ __asm ( \ " fldt %1\n" \ " fstpl %1\n" \ - " jmp " STRINGIZE(__GI_##func) "\n" \ + " jmp " __stringify(__GI_##func) "\n" \ : "=a" (ret) \ : "m" (x) \ ); \ @@ -110,7 +108,7 @@ __asm ( \ " fldt %1\n" \ " fstpl %1\n" \ - " jmp " STRINGIZE(__GI_##func) "\n" \ + " jmp " __stringify(__GI_##func) "\n" \ : "=A" (ret) \ : "m" (x) \ ); \ ------------------------------------------------------------------------ r25320 | aldot | 2009-02-13 08:09:32 -0600 (Fri, 13 Feb 2009) | 2 lines Changed paths: D /trunk/uClibc/libc/string/generic/strverscmp.c A /trunk/uClibc/libc/string/strverscmp.c (from /trunk/uClibc/libc/string/generic/strverscmp.c:25316) - fix link failures coming from recently added, misplaced strverscmp. ------------------------------------------------------------------------ Index: libc/string/strverscmp.c =================================================================== --- libc/string/strverscmp.c (revision 0) +++ libc/string/strverscmp.c (revision 25320) @@ -0,0 +1,117 @@ +/* GNU's strverscmp() function, taken from glibc 2.3.2 sources + */ + +/* Compare strings while treating digits characters numerically. + Copyright (C) 1997, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jean-François Bignolles , 1997. + + Derived work for uClibc by Hai Zaar, Codefidence Ltd + + 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 +#include +#include + + +/* states: S_N: normal, S_I: comparing integral part, S_F: comparing + fractional parts, S_Z: idem but with leading Zeroes only */ +#define S_N 0x0 +#define S_I 0x4 +#define S_F 0x8 +#define S_Z 0xC + +/* result_type: CMP: return diff; LEN: compare using len_diff/diff */ +#define CMP 2 +#define LEN 3 + +/* using more efficient isdigit() */ +#undef isdigit +#define isdigit(a) ((unsigned)((a) - '0') <= 9) + +/* Compare S1 and S2 as strings holding indices/version numbers, + returning less than, equal to or greater than zero if S1 is less than, + equal to or greater than S2 (for more info, see the texinfo doc). +*/ +int strverscmp (const char *s1, const char *s2) +{ + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + int state; + int diff; + + /* Symbol(s) 0 [1-9] others (padding) + Transition (10) 0 (01) d (00) x (11) - */ + static const uint8_t next_state[] = + { + /* state x d 0 - */ + /* S_N */ S_N, S_I, S_Z, S_N, + /* S_I */ S_N, S_I, S_I, S_I, + /* S_F */ S_N, S_F, S_F, S_F, + /* S_Z */ S_N, S_F, S_Z, S_Z + }; + + static const int8_t result_type[] = + { + /* state x/x x/d x/0 x/- d/x d/d d/0 d/- + 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */ + + /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_I */ CMP, -1, -1, CMP, +1, LEN, LEN, CMP, + +1, LEN, LEN, CMP, CMP, CMP, CMP, CMP, + /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_Z */ CMP, +1, +1, CMP, -1, CMP, CMP, CMP, + -1, CMP, CMP, CMP + }; + + if (p1 == p2) + return 0; + + c1 = *p1++; + c2 = *p2++; + /* Hint: '0' is a digit too. */ + state = S_N | ((c1 == '0') + (isdigit (c1) != 0)); + + while ((diff = c1 - c2) == 0 && c1 != '\0') + { + state = next_state[state]; + c1 = *p1++; + c2 = *p2++; + state |= (c1 == '0') + (isdigit (c1) != 0); + } + + state = result_type[state << 2 | (((c2 == '0') + (isdigit (c2) != 0)))]; + + switch (state) + { + case CMP: + return diff; + + case LEN: + while (isdigit (*p1++)) + if (!isdigit (*p2++)) + return 1; + + return isdigit (*p2) ? -1 : diff; + + default: + return state; + } +} Property changes on: libc/string/strverscmp.c ___________________________________________________________________ Added: svn:mergeinfo Index: libc/string/generic/strverscmp.c =================================================================== --- libc/string/generic/strverscmp.c (revision 25319) +++ libc/string/generic/strverscmp.c (revision 25320) @@ -1,117 +0,0 @@ -/* GNU's strverscmp() function, taken from glibc 2.3.2 sources - */ - -/* Compare strings while treating digits characters numerically. - Copyright (C) 1997, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Jean-François Bignolles , 1997. - - Derived work for uClibc by Hai Zaar, Codefidence Ltd - - 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 -#include -#include - - -/* states: S_N: normal, S_I: comparing integral part, S_F: comparing - fractional parts, S_Z: idem but with leading Zeroes only */ -#define S_N 0x0 -#define S_I 0x4 -#define S_F 0x8 -#define S_Z 0xC - -/* result_type: CMP: return diff; LEN: compare using len_diff/diff */ -#define CMP 2 -#define LEN 3 - -/* using more efficient isdigit() */ -#undef isdigit -#define isdigit(a) ((unsigned)((a) - '0') <= 9) - -/* Compare S1 and S2 as strings holding indices/version numbers, - returning less than, equal to or greater than zero if S1 is less than, - equal to or greater than S2 (for more info, see the texinfo doc). -*/ -int strverscmp (const char *s1, const char *s2) -{ - const unsigned char *p1 = (const unsigned char *) s1; - const unsigned char *p2 = (const unsigned char *) s2; - unsigned char c1, c2; - int state; - int diff; - - /* Symbol(s) 0 [1-9] others (padding) - Transition (10) 0 (01) d (00) x (11) - */ - static const uint8_t next_state[] = - { - /* state x d 0 - */ - /* S_N */ S_N, S_I, S_Z, S_N, - /* S_I */ S_N, S_I, S_I, S_I, - /* S_F */ S_N, S_F, S_F, S_F, - /* S_Z */ S_N, S_F, S_Z, S_Z - }; - - static const int8_t result_type[] = - { - /* state x/x x/d x/0 x/- d/x d/d d/0 d/- - 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */ - - /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, - CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, - /* S_I */ CMP, -1, -1, CMP, +1, LEN, LEN, CMP, - +1, LEN, LEN, CMP, CMP, CMP, CMP, CMP, - /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, - CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, - /* S_Z */ CMP, +1, +1, CMP, -1, CMP, CMP, CMP, - -1, CMP, CMP, CMP - }; - - if (p1 == p2) - return 0; - - c1 = *p1++; - c2 = *p2++; - /* Hint: '0' is a digit too. */ - state = S_N | ((c1 == '0') + (isdigit (c1) != 0)); - - while ((diff = c1 - c2) == 0 && c1 != '\0') - { - state = next_state[state]; - c1 = *p1++; - c2 = *p2++; - state |= (c1 == '0') + (isdigit (c1) != 0); - } - - state = result_type[state << 2 | (((c2 == '0') + (isdigit (c2) != 0)))]; - - switch (state) - { - case CMP: - return diff; - - case LEN: - while (isdigit (*p1++)) - if (!isdigit (*p2++)) - return 1; - - return isdigit (*p2) ? -1 : diff; - - default: - return state; - } -} ------------------------------------------------------------------------ r25319 | aldot | 2009-02-13 07:29:29 -0600 (Fri, 13 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/libc/misc/ctype/ctype.c - fix fallout from r24140 and r24160 for !CTYPE_TABLES ------------------------------------------------------------------------ Index: libc/misc/ctype/ctype.c =================================================================== --- libc/misc/ctype/ctype.c (revision 25318) +++ libc/misc/ctype/ctype.c (revision 25319) @@ -152,6 +152,7 @@ #define C_MACRO(X) PASTE2(__C_is,X)(c) #define CTYPE_NAME(X) is ## X +#define CTYPE_DEF(NAME) libc_hidden_def(is ## NAME) #define IS_FUNC_BODY(NAME) \ int CTYPE_NAME(NAME) (int c) \ ------------------------------------------------------------------------ r25318 | aldot | 2009-02-13 06:59:35 -0600 (Fri, 13 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/include/ctype.h M /trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h - fix compilation of !UCLIBC_HAS_CTYPE_TABLES by merging duplicate bits into ctype.h ------------------------------------------------------------------------ Index: include/ctype.h =================================================================== --- include/ctype.h (revision 25317) +++ include/ctype.h (revision 25318) @@ -27,6 +27,69 @@ #include #include +__BEGIN_DECLS +__BEGIN_NAMESPACE_STD + +/* The following names are all functions: + int isCHARACTERISTIC(int c); + which return nonzero iff C has CHARACTERISTIC. + For the meaning of the characteristic names, see the `enum' above. */ +extern int isalnum(int __c) __THROW; +libc_hidden_proto(isalnum) +extern int isalpha(int __c) __THROW; +libc_hidden_proto(isalpha) +extern int iscntrl(int __c) __THROW; +libc_hidden_proto(iscntrl) +extern int isdigit(int __c) __THROW; +libc_hidden_proto(isdigit) +extern int islower(int __c) __THROW; +libc_hidden_proto(islower) +extern int isgraph(int __c) __THROW; +libc_hidden_proto(isgraph) +extern int isprint(int __c) __THROW; +libc_hidden_proto(isprint) +extern int ispunct(int __c) __THROW; +libc_hidden_proto(ispunct) +extern int isspace(int __c) __THROW; +libc_hidden_proto(isspace) +extern int isupper(int __c) __THROW; +libc_hidden_proto(isupper) +extern int isxdigit(int __c) __THROW; +libc_hidden_proto(isxdigit) + + +/* Return the lowercase version of C. */ +extern int tolower(int __c) __THROW; +libc_hidden_proto(tolower) + +/* Return the uppercase version of C. */ +extern int toupper(int __c) __THROW; +libc_hidden_proto(toupper) + +#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN +/* Return nonzero iff C is in the ASCII set + (i.e., is no more than 7 bits wide). */ +extern int isascii(int __c) __THROW; +libc_hidden_proto(isascii) +/* Return the part of C that is in the ASCII set + (i.e., the low-order 7 bits of C). */ +extern int toascii(int __c) __THROW; +#endif + +__END_NAMESPACE_STD + + +/* ISO C99 introduced one new function. */ +#ifdef __USE_ISOC99 +__BEGIN_NAMESPACE_C99 + +extern int isblank(int __c) __THROW; +libc_hidden_proto(isblank) + +__END_NAMESPACE_C99 +#endif +__END_DECLS + #ifndef __UCLIBC_HAS_CTYPE_TABLES__ /* "Stub locale": we are permanently in C/POSIX locale. @@ -150,70 +213,12 @@ #define __isdigit_int(C) (((unsigned int)((C) - '0')) <= 9) #endif -__BEGIN_NAMESPACE_STD - -/* The following names are all functions: - int isCHARACTERISTIC(int c); - which return nonzero iff C has CHARACTERISTIC. - For the meaning of the characteristic names, see the `enum' above. */ -extern int isalnum(int __c) __THROW; -libc_hidden_proto(isalnum) -extern int isalpha(int __c) __THROW; -libc_hidden_proto(isalpha) -extern int iscntrl(int __c) __THROW; -libc_hidden_proto(iscntrl) -extern int isdigit(int __c) __THROW; -libc_hidden_proto(isdigit) -extern int islower(int __c) __THROW; -libc_hidden_proto(islower) -extern int isgraph(int __c) __THROW; -libc_hidden_proto(isgraph) -extern int isprint(int __c) __THROW; -libc_hidden_proto(isprint) -extern int ispunct(int __c) __THROW; -libc_hidden_proto(ispunct) -extern int isspace(int __c) __THROW; -libc_hidden_proto(isspace) -extern int isupper(int __c) __THROW; -libc_hidden_proto(isupper) -extern int isxdigit(int __c) __THROW; -libc_hidden_proto(isxdigit) - - -/* Return the lowercase version of C. */ -extern int tolower(int __c) __THROW; -libc_hidden_proto(tolower) - -/* Return the uppercase version of C. */ -extern int toupper(int __c) __THROW; -libc_hidden_proto(toupper) - -__END_NAMESPACE_STD - - -/* ISO C99 introduced one new function. */ -#ifdef __USE_ISOC99 -__BEGIN_NAMESPACE_C99 - -extern int isblank(int __c) __THROW; -libc_hidden_proto(isblank) - -__END_NAMESPACE_C99 -#endif - #ifdef __USE_GNU /* Test C for a set of character classes according to MASK. */ extern int isctype(int __c, int __mask) __THROW; #endif #if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN -/* Return nonzero iff C is in the ASCII set - (i.e., is no more than 7 bits wide). */ -extern int isascii(int __c) __THROW; -libc_hidden_proto(isascii) -/* Return the part of C that is in the ASCII set - (i.e., the low-order 7 bits of C). */ -extern int toascii(int __c) __THROW; /* These are the same as `toupper' and `tolower' except that they do not check the argument for being in the range of a `char'. */ extern int _toupper(int __c) __THROW; Index: libc/sysdeps/linux/common/bits/uClibc_ctype.h =================================================================== --- libc/sysdeps/linux/common/bits/uClibc_ctype.h (revision 25317) +++ libc/sysdeps/linux/common/bits/uClibc_ctype.h (revision 25318) @@ -95,29 +95,6 @@ /**********************************************************************/ __BEGIN_DECLS -extern int isalnum(int c) __THROW; -extern int isalpha(int c) __THROW; -#ifdef __USE_ISOC99 -extern int isblank(int c) __THROW; -#endif -extern int iscntrl(int c) __THROW; -extern int isdigit(int c) __THROW; -extern int isgraph(int c) __THROW; -extern int islower(int c) __THROW; -extern int isprint(int c) __THROW; -extern int ispunct(int c) __THROW; -extern int isspace(int c) __THROW; -extern int isupper(int c) __THROW; -extern int isxdigit(int c) __THROW; - -extern int tolower(int c) __THROW; -extern int toupper(int c) __THROW; - -#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN -extern int isascii(int c) __THROW; -extern int toascii(int c) __THROW; -#endif - #if defined _LIBC && (defined NOT_IN_libc || defined IS_IN_libc) /* These are uClibc-specific. */ # define __isdigit_char(c) ((unsigned char)((c) - '0') <= 9) ------------------------------------------------------------------------ r25317 | aldot | 2009-02-13 05:11:35 -0600 (Fri, 13 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/libc/sysdeps/linux/common/ssp.c - workaround oddity with position of function attributes ------------------------------------------------------------------------ Index: libc/sysdeps/linux/common/ssp.c =================================================================== --- libc/sysdeps/linux/common/ssp.c (revision 25316) +++ libc/sysdeps/linux/common/ssp.c (revision 25317) @@ -63,7 +63,7 @@ sigaction(SSP_SIGTYPE, &sa, NULL); } -static void ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3) __cold +static void __cold ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3) { write(fd, msg1, strlen(msg1)); write(fd, msg2, strlen(msg2)); ------------------------------------------------------------------------ r25308 | carmelo | 2009-02-12 08:42:20 -0600 (Thu, 12 Feb 2009) | 6 lines Changed paths: M /trunk/uClibc/test/math/Makefile Pass NO_LONG_DOUBLE flag to basic-test when LONG_DOUBLE support is not enabled in uclibc to fix build. Signed-off-by: Carmelo Amoroso ------------------------------------------------------------------------ Index: test/math/Makefile =================================================================== --- test/math/Makefile (revision 25307) +++ test/math/Makefile (revision 25308) @@ -4,6 +4,8 @@ TESTS := basic-test rint tst-definitions test-fpucw test-float test-ifloat test-double test-idouble ifeq ($(strip $(UCLIBC_HAS_LONG_DOUBLE_MATH)),y) TESTS += test-ldouble test-ildouble +else +CFLAGS_basic-test := -DNO_LONG_DOUBLE endif include ../Test.mak @@ -13,7 +15,7 @@ # NOTE: For basic-test we must disable the floating point optimization. # Only for sh architecture because in the other architecture are disabled. ifeq ($(TARGET_ARCH),sh) -CFLAGS_basic-test := -mieee +CFLAGS_basic-test += -mieee endif EXTRA_CFLAGS := -fno-builtin EXTRA_LDFLAGS := -lm ------------------------------------------------------------------------ r25300 | vda | 2009-02-11 11:37:21 -0600 (Wed, 11 Feb 2009) | 11 lines Changed paths: M /trunk/uClibc/docs/probe_math_exception.c M /trunk/uClibc/libc/sysdeps/linux/i386/bits/mathinline.h M /trunk/uClibc/libm/math_private.h M /trunk/uClibc/libm/s_finite.c M /trunk/uClibc/libm/s_finitef.c docs/probe_math_exception.c: update example libc/sysdeps/linux/i386/bits/mathinline.h: improve __finite() macro, add __finitef macro (why they aren't always macros? why aren't they arch independent?) libm/math_private.h: much better comments on math_opt_barrier() and math_force_eval() libm/s_finite[f].c: improve out-of-line __finite[f]() too (one byte less, yay...) ------------------------------------------------------------------------ Index: libm/s_finite.c =================================================================== --- libm/s_finite.c (revision 25299) +++ libm/s_finite.c (revision 25300) @@ -22,8 +22,11 @@ int __finite(double x) { - int32_t hx; - GET_HIGH_WORD(hx,x); - return (int)((u_int32_t)((hx&0x7fffffff)-0x7ff00000)>>31); + u_int32_t hx; + + GET_HIGH_WORD(hx, x); + /* Finite numbers have at least one zero bit in exponent. */ + /* All other numbers will result in 0xffffffff after OR: */ + return (hx | 0x800fffff) != 0xffffffff; } libm_hidden_def(__finite) Index: libm/s_finitef.c =================================================================== --- libm/s_finitef.c (revision 25299) +++ libm/s_finitef.c (revision 25300) @@ -23,8 +23,11 @@ int __finitef(float x) { - int32_t ix; - GET_FLOAT_WORD(ix,x); - return (int)((u_int32_t)((ix&0x7fffffff)-0x7f800000)>>31); + u_int32_t ix; + + GET_FLOAT_WORD(ix, x); + /* Finite numbers have at least one zero bit in exponent. */ + /* All other numbers will result in 0xffffffff after OR: */ + return (ix | 0x807fffff) != 0xffffffff; } libm_hidden_def(__finitef) Index: libm/math_private.h =================================================================== --- libm/math_private.h (revision 25299) +++ libm/math_private.h (revision 25300) @@ -188,14 +188,24 @@ extern int __kernel_rem_pio2 (double*,double*,int,int,int,const int*) attribute_hidden; /* - * math_opt_barrier(x): force expression x to be evaluated and put into - * a floating point register or memory. This macro returns the value. + * math_opt_barrier(x): safely load x, even if it was manipulated + * by non-floationg point operations. This macro returns the value of x. + * This ensures compiler does not (ab)use its knowledge about x value + * and don't optimize future operations. Example: + * float x; + * SET_FLOAT_WORD(x, 0x80000001); // sets a bit pattern + * y = math_opt_barrier(x); // "compiler, do not cheat!" + * y = y * y; // compiler can't optimize, must use real multiply insn * - * math_force_eval(x): force expression x to be evaluated and put into + * math_force_eval(x): force expression x to be evaluated. + * Useful if otherwise compiler may eliminate the expression + * as unused. This macro returns no value. + * Example: "void fn(float f) { f = f * f; }" + * versus "void fn(float f) { f = f * f; math_force_eval(f); }" + * + * Currently, math_force_eval(x) stores x into * a floating point register or memory *of the appropriate size*. - * This forces floating point flags to be set correctly - * (for example, when float value is overflowing, but FPU registers - * are wide enough to "hide" this). + * There is no guarantee this will not change. */ #if defined(__i386__) #define math_opt_barrier(x) ({ \ @@ -205,19 +215,20 @@ __x; \ }) #define math_force_eval(x) do { \ - if (sizeof(x) <= sizeof(double)) \ + __typeof(x) __x = (x); \ + if (sizeof(__x) <= sizeof(double)) \ /* "m": store x into a memory location */ \ - __asm __volatile ("" : : "m" (x)); \ + __asm __volatile ("" : : "m" (__x)); \ else /* long double */ \ /* "f": load x into (any) fpreg */ \ - __asm __volatile ("" : : "f" (x)); \ + __asm __volatile ("" : : "f" (__x)); \ } while (0) #endif #if defined(__x86_64__) #define math_opt_barrier(x) ({ \ __typeof(x) __x = (x); \ - if (sizeof(x) <= sizeof(double)) \ + if (sizeof(__x) <= sizeof(double)) \ /* "x": load into XMM SSE register */ \ __asm ("" : "=x" (__x) : "0" (__x)); \ else /* long double */ \ @@ -226,20 +237,23 @@ __x; \ }) #define math_force_eval(x) do { \ - if (sizeof(x) <= sizeof(double)) \ + __typeof(x) __x = (x); \ + if (sizeof(__x) <= sizeof(double)) \ /* "x": load into XMM SSE register */ \ - __asm __volatile ("" : : "x" (x)); \ + __asm __volatile ("" : : "x" (__x)); \ else /* long double */ \ /* "f": load x into (any) fpreg */ \ - __asm __volatile ("" : : "f" (x)); \ + __asm __volatile ("" : : "f" (__x)); \ } while (0) #endif -/* Default implementation forces store to a memory location */ +/* Default implementations force store to a memory location */ #ifndef math_opt_barrier #define math_opt_barrier(x) ({ __typeof(x) __x = (x); __asm ("" : "+m" (__x)); __x; }) -#define math_force_eval(x) __asm __volatile ("" : : "m" (x)) #endif +#ifndef math_force_eval +#define math_force_eval(x) do { __typeof(x) __x = (x); __asm __volatile ("" : : "m" (__x)); } while (0) +#endif #endif /* _MATH_PRIVATE_H_ */ Index: docs/probe_math_exception.c =================================================================== --- docs/probe_math_exception.c (revision 25299) +++ docs/probe_math_exception.c (revision 25300) @@ -5,20 +5,40 @@ #define _ISOC99_SOURCE 1 #define _GNU_SOURCE 1 +#include #include #include #include int main(int argc, char **argv) { - float infF = HUGE_VALF * 2; + float largest, small, t, inf_float; + largest = small = 1; + while (1) { + t = largest + small; + /* optimizations may make plain "t == largest" unreliable */ + if (memcmp(&t, &largest, sizeof(float)) == 0) + break; + if (isfinite(t)) { + largest = t; + small *= 2; + continue; + } + small /= 2; + } + inf_float = largest + largest; + //printf("%.40g ", largest); + //printf("[%llx]\n", (long long) (*(uint32_t *)&largest)); + feclearexcept(FE_ALL_EXCEPT); -// printf("%.40e\n", 1.0 / 0.0); // FE_DIVBYZERO -// printf("%.40e\n", nextafterf(HUGE_VALF, infF)); // no exceptions in glibc 2.4 + //t = 1.0 / 0.0; // simple test: FE_DIVBYZERO + //t = nextafterf(largest, 1); // glibc 2.8: no math exceptions raised + //t = nextafterf(largest, largest); // glibc 2.8: no math exceptions raised + //t = nextafterf(largest, inf_float); // glibc 2.8: FE_INEXACT FE_OVERFLOW -#define PREX(ex) do { if (fetestexcept(ex)) printf(#ex); } while(0) +#define PREX(ex) do { if (fetestexcept(ex)) printf(#ex " "); } while(0) #ifdef FE_INEXACT PREX(FE_INEXACT); #endif @@ -36,6 +56,9 @@ #endif if (fetestexcept(FE_ALL_EXCEPT)) printf("\n"); - printf("done\n"); + else + printf("no math exceptions raised\n"); + + printf("%.40g\n", t); return 0; } Index: libc/sysdeps/linux/i386/bits/mathinline.h =================================================================== --- libc/sysdeps/linux/i386/bits/mathinline.h (revision 25299) +++ libc/sysdeps/linux/i386/bits/mathinline.h (revision 25300) @@ -713,11 +713,22 @@ __MATH_INLINE int __NTH (__finite (double __x)) { - return (__extension__ - (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1] - | 0x800fffffu) + 1) >> 31)); + union { double __d; int __i[2]; } u; + u.__d = __x; + /* Finite numbers have at least one zero bit in exponent. */ + /* All other numbers will result in 0xffffffff after OR: */ + return (u.__i[1] | 0x800fffff) != 0xffffffff; } +__MATH_INLINE int +__NTH (__finitef (float __x)) +{ + union { float __d; int __i; } u; + u.__d = __x; + return (u.__i | 0x807fffff) != 0xffffffff; +} + + /* Miscellaneous functions */ # ifdef __FAST_MATH__ __inline_mathcode (__coshm1, __x, \ ------------------------------------------------------------------------ r25299 | vda | 2009-02-11 11:32:39 -0600 (Wed, 11 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/include/ctype.h add comment why do we need _ISbit() macro ------------------------------------------------------------------------ Index: include/ctype.h =================================================================== --- include/ctype.h (revision 25298) +++ include/ctype.h (revision 25299) @@ -42,6 +42,7 @@ If there get to be more than 16 distinct characteristics, __ctype_mask_t will need to be adjusted. */ +/* libstdc++ from gcc toolchain needs this macro. */ # define _ISbit(bit) (1 << (bit)) enum ------------------------------------------------------------------------ r25296 | carmelo | 2009-02-10 10:56:43 -0600 (Tue, 10 Feb 2009) | 5 lines Changed paths: M /trunk/uClibc/include/ctype.h Re-add _ISbit macro required to build libstdc++ from gcc toolchain. Signed-off-by: Carmelo Amoroso ------------------------------------------------------------------------ Index: include/ctype.h =================================================================== --- include/ctype.h (revision 25295) +++ include/ctype.h (revision 25296) @@ -37,25 +37,31 @@ __BEGIN_DECLS +#ifndef _ISbit /* These are all the characteristics of characters. If there get to be more than 16 distinct characteristics, __ctype_mask_t will need to be adjusted. */ +# define _ISbit(bit) (1 << (bit)) + enum { - _ISupper = 1 << 0, /* UPPERCASE. */ - _ISlower = 1 << 1, /* lowercase. */ - _ISalpha = 1 << 2, /* Alphabetic. */ - _ISdigit = 1 << 3, /* Numeric. */ - _ISxdigit = 1 << 4, /* Hexadecimal numeric. */ - _ISspace = 1 << 5, /* Whitespace. */ - _ISprint = 1 << 6, /* Printing. */ - _ISgraph = 1 << 7, /* Graphical. */ - _ISblank = 1 << 8, /* Blank (usually SPC and TAB). */ - _IScntrl = 1 << 9, /* Control character. */ - _ISpunct = 1 << 10, /* Punctuation. */ - _ISalnum = 1 << 11, /* Alphanumeric. */ + _ISupper = _ISbit (0), /* UPPERCASE. */ + _ISlower = _ISbit (1), /* lowercase. */ + _ISalpha = _ISbit (2), /* Alphabetic. */ + _ISdigit = _ISbit (3), /* Numeric. */ + _ISxdigit = _ISbit (4), /* Hexadecimal numeric. */ + _ISspace = _ISbit (5), /* Whitespace. */ + _ISprint = _ISbit (6), /* Printing. */ + _ISgraph = _ISbit (7), /* Graphical. */ + _ISblank = _ISbit (8), /* Blank (usually SPC and TAB). */ + _IScntrl = _ISbit (9), /* Control character. */ + _ISpunct = _ISbit (10), /* Punctuation. */ + _ISalnum = _ISbit (11) /* Alphanumeric. */ }; +#else +#error _ISbit already defined! +#endif /* ! _ISbit */ /* __ctype_XXX_t types and __UCLIBC_CTYPE_x_TBL_OFFSET constants */ #include ------------------------------------------------------------------------ r25288 | vapier | 2009-02-09 22:10:34 -0600 (Mon, 09 Feb 2009) | 1 line Changed paths: M /trunk/uClibc/utils/ldd.c include more info in error messages so we have a better idea where things are failing ------------------------------------------------------------------------ Index: utils/ldd.c =================================================================== --- utils/ldd.c (revision 25287) +++ utils/ldd.c (revision 25288) @@ -339,7 +339,7 @@ /* We need a writable copy of this string */ path = strdup(path_list); if (!path) { - fprintf(stderr, "Out of memory!\n"); + fprintf(stderr, "%s: Out of memory!\n", __func__); exit(EXIT_FAILURE); } /* Eliminate all double //s */ @@ -388,7 +388,7 @@ /* We need some elbow room here. Make some room... */ buf = malloc(1024); if (!buf) { - fprintf(stderr, "Out of memory!\n"); + fprintf(stderr, "%s: Out of memory!\n", __func__); exit(EXIT_FAILURE); } @@ -645,7 +645,7 @@ ehdr = mmap(0, statbuf.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fileno(thefile), 0); if (ehdr == MAP_FAILED) { fclose(thefile); - fprintf(stderr, "Out of memory!\n"); + fprintf(stderr, "mmap(%s) failed: %s\n", filename, strerror(errno)); return -1; } ------------------------------------------------------------------------ r25287 | vapier | 2009-02-09 18:09:04 -0600 (Mon, 09 Feb 2009) | 1 line Changed paths: A /trunk/uClibc/utils/mmap-windows.c M /trunk/uClibc/utils/porting.h add mmap()/munmap() implementation for Windows ------------------------------------------------------------------------ Index: utils/mmap-windows.c =================================================================== --- utils/mmap-windows.c (revision 0) +++ utils/mmap-windows.c (revision 25287) @@ -0,0 +1,100 @@ +/* mmap() replacement for Windows + * + * Author: Mike Frysinger + * Placed into the public domain + */ + +/* References: + * CreateFileMapping: http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx + * CloseHandle: http://msdn.microsoft.com/en-us/library/ms724211(VS.85).aspx + * MapViewOfFile: http://msdn.microsoft.com/en-us/library/aa366761(VS.85).aspx + * UnmapViewOfFile: http://msdn.microsoft.com/en-us/library/aa366882(VS.85).aspx + */ + +#include +#include +#include + +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +/* This flag is only available in WinXP+ */ +#ifdef FILE_MAP_EXECUTE +#define PROT_EXEC 0x4 +#else +#define PROT_EXEC 0x0 +#define FILE_MAP_EXECUTE 0 +#endif + +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_ANONYMOUS 0x20 +#define MAP_ANON MAP_ANONYMOUS +#define MAP_FAILED ((void *) -1) + +#ifdef __USE_FILE_OFFSET64 +# define DWORD_HI(x) (x >> 32) +# define DWORD_LO(x) ((x) & 0xffffffff) +#else +# define DWORD_HI(x) (0) +# define DWORD_LO(x) (x) +#endif + +static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) +{ + if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) + return MAP_FAILED; + if (fd == -1) { + if (!(flags & MAP_ANON) || offset) + return MAP_FAILED; + } else if (flags & MAP_ANON) + return MAP_FAILED; + + DWORD flProtect; + if (prot & PROT_WRITE) { + if (prot & PROT_EXEC) + flProtect = PAGE_EXECUTE_READWRITE; + else + flProtect = PAGE_READWRITE; + } else if (prot & PROT_EXEC) { + if (prot & PROT_READ) + flProtect = PAGE_EXECUTE_READ; + else if (prot & PROT_EXEC) + flProtect = PAGE_EXECUTE; + } else + flProtect = PAGE_READONLY; + + off_t end = length + offset; + HANDLE mmap_fd, h; + if (fd == -1) + mmap_fd = INVALID_HANDLE_VALUE; + else + mmap_fd = (HANDLE)_get_osfhandle(fd); + h = CreateFileMapping(mmap_fd, NULL, flProtect, DWORD_HI(end), DWORD_LO(end), NULL); + if (h == NULL) + return MAP_FAILED; + + DWORD dwDesiredAccess; + if (prot & PROT_WRITE) + dwDesiredAccess = FILE_MAP_WRITE; + else + dwDesiredAccess = FILE_MAP_READ; + if (prot & PROT_EXEC) + dwDesiredAccess |= FILE_MAP_EXECUTE; + if (flags & MAP_PRIVATE) + dwDesiredAccess |= FILE_MAP_COPY; + void *ret = MapViewOfFile(h, dwDesiredAccess, DWORD_HI(offset), DWORD_LO(offset), length); + if (ret == NULL) { + CloseHandle(h); + ret = MAP_FAILED; + } + return ret; +} + +static void munmap(void *addr, size_t length) +{ + UnmapViewOfFile(addr); + /* ruh-ro, we leaked handle from CreateFileMapping() ... */ +} + +#undef DWORD_HI +#undef DWORD_LO Index: utils/porting.h =================================================================== --- utils/porting.h (revision 25286) +++ utils/porting.h (revision 25287) @@ -22,10 +22,18 @@ #include #include #include -#include +#ifdef __LDSO_LDD_SUPPORT__ +# include +#endif + +#if defined(_WIN32) || defined(_WINNT) +# include "mmap-windows.c" +#else +# include +#endif + #include -#include /* makefile will include elf.h for us */ #include "bswap.h" ------------------------------------------------------------------------ r25286 | vapier | 2009-02-09 18:02:19 -0600 (Mon, 09 Feb 2009) | 1 line Changed paths: M /trunk/uClibc/include/elf.h do not rely on features.h so that elf.h can be used on non-elf systems (Darwin, Windows, etc...) ------------------------------------------------------------------------ Index: include/elf.h =================================================================== --- include/elf.h (revision 25285) +++ include/elf.h (revision 25286) @@ -20,10 +20,11 @@ #ifndef _ELF_H #define _ELF_H 1 -#include +/* Avoid features.h here for portability. This stuff matches sys/cdefs.h. */ +#ifdef __cplusplus +extern "C" { +#endif -__BEGIN_DECLS - /* Standard ELF types. */ #include @@ -3061,6 +3062,8 @@ /* Keep this the last entry. */ #define R_XTENSA_NUM 50 -__END_DECLS +#ifdef __cplusplus +} +#endif #endif /* elf.h */ ------------------------------------------------------------------------ r25285 | vapier | 2009-02-09 17:42:23 -0600 (Mon, 09 Feb 2009) | 1 line Changed paths: M /trunk/uClibc/Makefile.in allow people to run the hostutils targets without having a .config file ------------------------------------------------------------------------ Index: Makefile.in =================================================================== --- Makefile.in (revision 25284) +++ Makefile.in (revision 25285) @@ -458,8 +458,6 @@ fi endif -hostutils: - $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" -C utils hostutils utils: $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils @@ -467,11 +465,14 @@ install_utils: utils $(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils utils_install +endif # ifeq ($(HAVE_DOT_CONFIG),y) + +hostutils: + $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" -C utils hostutils + install_hostutils: hostutils $(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils utils_install DOTHOST=.host -endif # ifeq ($(HAVE_DOT_CONFIG),y) - include/bits include/config: @$(disp_mkdir) $(Q)$(INSTALL) -d $@ ------------------------------------------------------------------------ r25283 | vda | 2009-02-09 16:55:08 -0600 (Mon, 09 Feb 2009) | 9 lines Changed paths: M /trunk/uClibc/libm/float_wrappers.c M /trunk/uClibc/libm/ldouble_wrappers.c ldouble_wrappers.c: add long and long long optimized wrappers float_wrappers.c: add xxxWRAPPER1(func) macros. no code changes, but makes this file much shorter. text data bss dec hex filename - 42504 188 4 42696 a6c8 lib/libm-0.9.30-svn.so + 42488 188 4 42680 a6b8 lib/libm-0.9.30-svn.so ------------------------------------------------------------------------ Index: libm/ldouble_wrappers.c =================================================================== --- libm/ldouble_wrappers.c (revision 25282) +++ libm/ldouble_wrappers.c (revision 25283) @@ -23,18 +23,29 @@ { \ return (long double) func((double) x); \ } - #define int_WRAPPER1(func) \ int func##l(long double x) \ { \ return func((double) x); \ } +#define long_WRAPPER1(func) \ +long func##l(long double x) \ +{ \ + return func((double) x); \ +} +#define long_long_WRAPPER1(func) \ +long long func##l(long double x) \ +{ \ + return func((double) x); \ +} #if defined __i386__ && defined __OPTIMIZE__ # undef WRAPPER1 # undef int_WRAPPER1 +# undef long_WRAPPER1 +# undef long_long_WRAPPER1 /* gcc 4.3.1 generates really ugly code with redundant pair of store/load: - * sub $0x10,%esp + * sub $0x10,%esp * fldt 0x14(%esp) * fstpl 0x8(%esp) * fldl 0x8(%esp) <-- ?? @@ -46,8 +57,8 @@ * it will be smart enough to reuse argument stack space and use * jump instead of call. Let's do it by hand. * The asm below loads long double x into st(0), then stores it back - * to the same location as a double. At this point, stack looks exactly - * as "double func(double)" expects it to be. + * to the same location, but as a double. At this point, stack looks + * exactly as "double func(double)" expects it to be. * The return value is returned in st(0) per ABI in both cases (returning * a long double or returning a double). So we can simply jump to func. * Using __GI_func in jump to make optimized intra-library jump. @@ -56,15 +67,15 @@ # define WRAPPER1(func) \ long double func##l(long double x) \ { \ - long double fp_top; \ + long double st_top; \ __asm ( \ " fldt %1\n" \ " fstpl %1\n" \ " jmp " STRINGIZE(__GI_##func) "\n" \ - : "=t" (fp_top) \ + : "=t" (st_top) \ : "m" (x) \ ); \ - return fp_top; \ + return st_top; \ } # define int_WRAPPER1(func) \ int func##l(long double x) \ @@ -79,7 +90,33 @@ ); \ return ret; \ } -#endif /* __i386__ */ +# define long_WRAPPER1(func) \ +long func##l(long double x) \ +{ \ + long ret; \ + __asm ( \ + " fldt %1\n" \ + " fstpl %1\n" \ + " jmp " STRINGIZE(__GI_##func) "\n" \ + : "=a" (ret) \ + : "m" (x) \ + ); \ + return ret; \ +} +# define long_long_WRAPPER1(func) \ +long long func##l(long double x) \ +{ \ + long long ret; \ + __asm ( \ + " fldt %1\n" \ + " fstpl %1\n" \ + " jmp " STRINGIZE(__GI_##func) "\n" \ + : "=A" (ret) \ + : "m" (x) \ + ); \ + return ret; \ +} +#endif /* __i386__ && __OPTIMIZE__ */ /* Implement the following, as defined by SuSv3 */ @@ -297,17 +334,11 @@ #endif #ifdef L_llrintl -long long llrintl (long double x) -{ - return llrint( (double)x ); -} +long_long_WRAPPER1(llrint) #endif #ifdef L_llroundl -long long llroundl (long double x) -{ - return llround( (double)x ); -} +long_long_WRAPPER1(llround) #endif #ifdef L_log10l @@ -331,17 +362,11 @@ #endif #ifdef L_lrintl -long lrintl (long double x) -{ - return lrint( (double)x ); -} +long_WRAPPER1(lrint) #endif #ifdef L_lroundl -long lroundl (long double x) -{ - return lround( (double)x ); -} +long_WRAPPER1(lround) #endif #ifdef L_modfl Index: libm/float_wrappers.c =================================================================== --- libm/float_wrappers.c (revision 25282) +++ libm/float_wrappers.c (revision 25283) @@ -16,8 +16,31 @@ #include #include + +#define WRAPPER1(func) \ +float func##f (float x) \ +{ \ + return (float) func((double)x); \ +} +#define int_WRAPPER1(func) \ +int func##f (float x) \ +{ \ + return func((double)x); \ +} +#define long_WRAPPER1(func) \ +long func##f (float x) \ +{ \ + return func((double)x); \ +} +#define long_long_WRAPPER1(func) \ +long long func##f (float x) \ +{ \ + return func((double)x); \ +} + + /* For the time being, do _NOT_ implement these functions - * that are defined by SuSv3 */ + * that are defined by SuSv3 [why?] */ #undef L_exp2f /*float exp2f(float);*/ #undef L_fdimf /*float fdimf(float, float);*/ #undef L_fmaf /*float fmaf(float, float, float);*/ @@ -77,37 +100,21 @@ #endif #ifdef L_acosf -float acosf (float x) -{ - return (float) acos( (double)x ); -} +WRAPPER1(acos) #endif - #ifdef L_acoshf -float acoshf (float x) -{ - return (float) acosh( (double)x ); -} +WRAPPER1(acosh) #endif - #ifdef L_asinf -float asinf (float x) -{ - return (float) asin( (double)x ); -} +WRAPPER1(asin) #endif - #ifdef L_asinhf -float asinhf (float x) -{ - return (float) asinh( (double)x ); -} +WRAPPER1(asinh) #endif - #ifdef L_atan2f float atan2f (float x, float y) { @@ -115,23 +122,14 @@ } #endif - #ifdef L_atanf -float atanf (float x) -{ - return (float) atan( (double)x ); -} +WRAPPER1(atan) #endif - #ifdef L_atanhf -float atanhf (float x) -{ - return (float) atanh( (double)x ); -} +WRAPPER1(atanh) #endif - #ifdef L_cargf float cargf (float complex x) { @@ -139,23 +137,14 @@ } #endif - #ifdef L_cbrtf -float cbrtf (float x) -{ - return (float) cbrt( (double)x ); -} +WRAPPER1(cbrt) #endif - #ifdef L_ceilf -float ceilf (float x) -{ - return (float) ceil( (double)x ); -} +WRAPPER1(ceil) #endif - #ifdef L_copysignf float copysignf (float x, float y) { @@ -163,71 +152,38 @@ } #endif - #ifdef L_cosf -float cosf (float x) -{ - return (float) cos( (double)x ); -} +WRAPPER1(cos) #endif - #ifdef L_coshf -float coshf (float x) -{ - return (float) cosh( (double)x ); -} +WRAPPER1(cosh) #endif - #ifdef L_erfcf -float erfcf (float x) -{ - return (float) erfc( (double)x ); -} +WRAPPER1(erfc) #endif - #ifdef L_erff -float erff (float x) -{ - return (float) erf( (double)x ); -} +WRAPPER1(erf) #endif - #ifdef L_exp2f -float exp2f (float x) -{ - return (float) exp2( (double)x ); -} +WRAPPER1(exp2) #endif - #ifdef L_expf -float expf (float x) -{ - return (float) exp( (double)x ); -} +WRAPPER1(exp) #endif - #ifdef L_expm1f -float expm1f (float x) -{ - return (float) expm1( (double)x ); -} +WRAPPER1(expm1) #endif - #ifdef L_fabsf -float fabsf (float x) -{ - return (float) fabs( (double)x ); -} +WRAPPER1(fabs) #endif - #ifdef L_fdimf float fdimf (float x, float y) { @@ -235,15 +191,10 @@ } #endif - #ifdef L_floorf -float floorf (float x) -{ - return (float) floor( (double)x ); -} +WRAPPER1(floor) #endif - #ifdef L_fmaf float fmaf (float x, float y, float z) { @@ -251,7 +202,6 @@ } #endif - #ifdef L_fmaxf float fmaxf (float x, float y) { @@ -259,7 +209,6 @@ } #endif - #ifdef L_fminf float fminf (float x, float y) { @@ -267,7 +216,6 @@ } #endif - #ifdef L_fmodf float fmodf (float x, float y) { @@ -275,7 +223,6 @@ } #endif - #ifdef L_frexpf float frexpf (float x, int *_exp) { @@ -283,7 +230,6 @@ } #endif - #ifdef L_hypotf float hypotf (float x, float y) { @@ -291,15 +237,10 @@ } #endif - #ifdef L_ilogbf -int ilogbf (float x) -{ - return (int) ilogb( (double)x ); -} +int_WRAPPER1(ilogb) #endif - #ifdef L_ldexpf float ldexpf (float x, int _exp) { @@ -307,87 +248,46 @@ } #endif - #ifdef L_lgammaf -float lgammaf (float x) -{ - return (float) lgamma( (double)x ); -} +WRAPPER1(lgamma) #endif - #ifdef L_llrintf -long long llrintf (float x) -{ - return (long long) llrint( (double)x ); -} +long_long_WRAPPER1(llrint) #endif - #ifdef L_llroundf -long long llroundf (float x) -{ - return (long long) llround( (double)x ); -} +long_long_WRAPPER1(llround) #endif - #ifdef L_log10f -float log10f (float x) -{ - return (float) log10( (double)x ); -} +WRAPPER1(log10) #endif - #ifdef L_log1pf -float log1pf (float x) -{ - return (float) log1p( (double)x ); -} +WRAPPER1(log1p) #endif - #ifdef L_log2f -float log2f (float x) -{ - return (float) log2( (double)x ); -} +WRAPPER1(log2) #endif - #ifdef L_logbf -float logbf (float x) -{ - return (float) logb( (double)x ); -} +WRAPPER1(logb) #endif - #ifdef L_logf -float logf (float x) -{ - return (float) log( (double)x ); -} +WRAPPER1(log) #endif - #ifdef L_lrintf -long lrintf (float x) -{ - return (long) lrint( (double)x ); -} +long_WRAPPER1(lrint) #endif - #ifdef L_lroundf -long lroundf (float x) -{ - return (long) lround( (double)x ); -} +long_WRAPPER1(lround) #endif - #ifdef L_modff float modff (float x, float *iptr) { @@ -399,15 +299,10 @@ } #endif - #ifdef L_nearbyintf -float nearbyintf (float x) -{ - return (float) nearbyint( (double)x ); -} +WRAPPER1(nearbyint) #endif - #ifdef L_nexttowardf float nexttowardf (float x, long double y) { @@ -415,7 +310,6 @@ } #endif - #ifdef L_powf float powf (float x, float y) { @@ -423,7 +317,6 @@ } #endif - #ifdef L_remainderf float remainderf (float x, float y) { @@ -431,7 +324,6 @@ } #endif - #ifdef L_remquof float remquof (float x, float y, int *quo) { @@ -439,23 +331,14 @@ } #endif - #ifdef L_rintf -float rintf (float x) -{ - return (float) rint( (double)x ); -} +WRAPPER1(rint) #endif - #ifdef L_roundf -float roundf (float x) -{ - return (float) round( (double)x ); -} +WRAPPER1(round) #endif - #ifdef L_scalblnf float scalblnf (float x, long _exp) { @@ -463,7 +346,6 @@ } #endif - #ifdef L_scalbnf float scalbnf (float x, int _exp) { @@ -471,60 +353,32 @@ } #endif - #ifdef L_sinf -float sinf (float x) -{ - return (float) sin( (double)x ); -} +WRAPPER1(sin) #endif - #ifdef L_sinhf -float sinhf (float x) -{ - return (float) sinh( (double)x ); -} +WRAPPER1(sinh) #endif - #ifdef L_sqrtf -float sqrtf (float x) -{ - return (float) sqrt( (double)x ); -} +WRAPPER1(sqrt) #endif - #ifdef L_tanf -float tanf (float x) -{ - return (float) tan( (double)x ); -} +WRAPPER1(tan) #endif - #ifdef L_tanhf -float tanhf (float x) -{ - return (float) tanh( (double)x ); -} +WRAPPER1(tanh) #endif - #ifdef L_tgammaf -float tgammaf (float x) -{ - return (float) tgamma( (double)x ); -} +WRAPPER1(tgamma) #endif - #ifdef L_truncf -float truncf (float x) -{ - return (float) trunc( (double)x ); -} +WRAPPER1(trunc) #endif #ifdef L_fmaf @@ -542,15 +396,9 @@ #endif #ifdef L_gammaf -float gammaf (float x) -{ - return (float) gamma( (double)x ); -} +WRAPPER1(gamma) #endif #ifdef L_significandf -float significandf (float x) -{ - return (float) significand( (double)x ); -} +WRAPPER1(significand) #endif ------------------------------------------------------------------------ r25282 | vapier | 2009-02-09 16:51:27 -0600 (Mon, 09 Feb 2009) | 1 line Changed paths: M /trunk/uClibc/utils/bswap.h M /trunk/uClibc/utils/porting.h unify byte order cruft in bswap.h and porting.h and add a bswap_64() replacement ------------------------------------------------------------------------ Index: utils/bswap.h =================================================================== --- utils/bswap.h (revision 25281) +++ utils/bswap.h (revision 25282) @@ -6,40 +6,6 @@ #ifndef _BSWAP_H #define _BSWAP_H 1 -#if !defined(__BYTE_ORDER) && defined(BYTE_ORDER) -# define __BYTE_ORDER BYTE_ORDER -# if !defined(__BIG_ENDIAN) && defined(BIG_ENDIAN) -# define __BIG_ENDIAN BIG_ENDIAN -# endif -# if !defined(__LITTLE_ENDIAN) && defined(LITTLE_ENDIAN) -# define __LITTLE_ENDIAN LITTLE_ENDIAN -# endif -#endif - -#ifndef __BYTE_ORDER -# ifdef __linux__ -# include -# else -# define __LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */ -# define __BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ -# define __PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */ - -# if defined(sun386) || defined(i386) || defined(__LITTLE_ENDIAN__) -# define __BYTE_ORDER __LITTLE_ENDIAN -# endif - -# if defined(sparc) || defined(__BIG_ENDIAN__) -# define __BYTE_ORDER __BIG_ENDIAN -# endif - -# endif /* __linux__ */ -#endif /* __BYTE_ORDER */ - - -#ifndef __BYTE_ORDER -# error "Undefined __BYTE_ORDER" -#endif - #ifdef __linux__ # include #else @@ -56,6 +22,24 @@ (((x) & 0x0000ff00) << 8) | \ (((x) & 0x000000ff) << 24)); } +static __inline__ uint64_t bswap_64(uint64_t x) +{ +#define _uswap_64(x, sfx) \ + return ((((x) & 0xff00000000000000##sfx) >> 56) | \ + (((x) & 0x00ff000000000000##sfx) >> 40) | \ + (((x) & 0x0000ff0000000000##sfx) >> 24) | \ + (((x) & 0x000000ff00000000##sfx) >> 8) | \ + (((x) & 0x00000000ff000000##sfx) << 8) | \ + (((x) & 0x0000000000ff0000##sfx) << 24) | \ + (((x) & 0x000000000000ff00##sfx) << 40) | \ + (((x) & 0x00000000000000ff##sfx) << 56)); +#if defined(__GNUC__) + _uswap_64(x, ull) +#else + _uswap_64(x, ) #endif +#undef _uswap_64 +} +#endif #endif Index: utils/porting.h =================================================================== --- utils/porting.h (revision 25281) +++ utils/porting.h (revision 25282) @@ -44,13 +44,23 @@ # define UCLIBC_RUNTIME_PREFIX "/" #endif +#undef UCLIBC_ENDIAN_HOST #define UCLIBC_ENDIAN_LITTLE 1234 #define UCLIBC_ENDIAN_BIG 4321 -#if __BYTE_ORDER == __LITTLE_ENDIAN -# define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE -#elif __BYTE_ORDER == __BIG_ENDIAN -# define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG -#else +#if defined(BYTE_ORDER) +# if BYTE_ORDER == LITTLE_ENDIAN +# define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE +# elif BYTE_ORDER == BIG_ENDIAN +# define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG +# endif +#elif defined(__BYTE_ORDER) +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE +# elif __BYTE_ORDER == __BIG_ENDIAN +# define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG +# endif +#endif +#if !defined(UCLIBC_ENDIAN_HOST) # error "Unknown host byte order!" #endif ------------------------------------------------------------------------ r25281 | vapier | 2009-02-09 15:48:48 -0600 (Mon, 09 Feb 2009) | 1 line Changed paths: M /trunk/uClibc/utils/Makefile.in M /trunk/uClibc/utils/chroot_realpath.c M /trunk/uClibc/utils/ldconfig.c M /trunk/uClibc/utils/ldd.c A /trunk/uClibc/utils/porting.h M /trunk/uClibc/utils/readelf.c M /trunk/uClibc/utils/readsoname2.c unify the headers/random defines into porting.h to avoid duplication/rot ------------------------------------------------------------------------ Index: utils/chroot_realpath.c =================================================================== --- utils/chroot_realpath.c (revision 25280) +++ utils/chroot_realpath.c (revision 25281) @@ -20,24 +20,8 @@ * 2005/09/12: Dan Howell (modified from realpath.c to emulate chroot) */ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "porting.h" -#include -#include -#include -#include -#include -#include /* for PATH_MAX */ -#include /* for MAXPATHLEN */ -#include -#include /* for S_IFLNK */ - -#ifndef PATH_MAX -#define PATH_MAX _POSIX_PATH_MAX -#endif - #define MAX_READLINKS 32 char *chroot_realpath(const char *chroot, const char *path, Index: utils/readsoname2.c =================================================================== --- utils/readsoname2.c (revision 25280) +++ utils/readsoname2.c (revision 25281) @@ -35,13 +35,11 @@ if ((char *)(epnt + 1) > (char *)(header + st.st_size)) goto skip; -#if __BYTE_ORDER == __LITTLE_ENDIAN - byteswap = (epnt->e_ident[5] == ELFDATA2MSB) ? 1 : 0; -#elif __BYTE_ORDER == __BIG_ENDIAN - byteswap = (epnt->e_ident[5] == ELFDATA2LSB) ? 1 : 0; -#else -#error Unknown host byte order! -#endif + if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_LITTLE) + byteswap = (epnt->e_ident[5] == ELFDATA2MSB) ? 1 : 0; + else if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_BIG) + byteswap = (epnt->e_ident[5] == ELFDATA2LSB) ? 1 : 0; + /* Be very lazy, and only byteswap the stuff we use */ if (byteswap == 1) { epnt->e_phoff = bswap_32(epnt->e_phoff); Index: utils/Makefile.in =================================================================== --- utils/Makefile.in (revision 25280) +++ utils/Makefile.in (revision 25281) @@ -9,6 +9,9 @@ CFLAGS-utils := \ $(SSP_ALL_CFLAGS) \ + -I$(top_srcdir)ldso/include \ + -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \ + -DUCLIBC_LDSO=$(UCLIBC_LDSO) \ -I$(top_srcdir)/$(KERNEL_HEADERS) \ -DNOT_IN_libc \ -B$(top_builddir)lib \ @@ -20,21 +23,14 @@ CFLAGS-utils-shared := endif -CFLAGS-ldconfig := \ - -I$(top_srcdir)ldso/include \ - -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \ - -DUCLIBC_LDSO=$(UCLIBC_LDSO) +CFLAGS-ldconfig := ifeq ($(UCLIBC_STATIC_LDCONFIG),y) CFLAGS-ldconfig += -static else CFLAGS-ldconfig += $(CFLAGS-utils-shared) endif -CFLAGS-ldd := \ - -I$(top_srcdir)ldso/include \ - -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \ - -DUCLIBC_LDSO=$(UCLIBC_LDSO) \ - $(CFLAGS-utils-shared) +CFLAGS-ldd := $(CFLAGS-utils-shared) CFLAGS-readelf := $(CFLAGS-utils-shared) @@ -52,24 +48,17 @@ LDSO_CACHE_SUPPORT := -D__LDSO_CACHE_SUPPORT__=1 endif -BUILD_CFLAGS-ldconfig.host := \ +BUILD_CFLAGS-utils := \ -include $(top_srcdir)include/elf.h \ -I$(top_srcdir)ldso/include \ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \ -DUCLIBC_LDSO=$(UCLIBC_LDSO) \ - $(LDSO_CACHE_SUPPORT) \ + $(LDSO_CACHE_SUPPORT) +BUILD_CFLAGS-ldconfig.host := $(BUILD_CFLAGS-utils) +BUILD_CFLAGS-ldd.host := $(BUILD_CFLAGS-utils) +BUILD_CFLAGS-readelf.host := $(BUILD_CFLAGS-utils) -BUILD_CFLAGS-ldd.host := \ - -include $(top_srcdir)include/elf.h \ - -I$(top_srcdir)ldso/include \ - -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \ - -DUCLIBC_LDSO=$(UCLIBC_LDSO) \ - $(LDSO_CACHE_SUPPORT) \ -BUILD_CFLAGS-readelf.host := \ - -include $(top_srcdir)include/elf.h \ - - # Rules utils_DIR := $(top_srcdir)utils Index: utils/readelf.c =================================================================== --- utils/readelf.c (revision 25280) +++ utils/readelf.c (revision 25281) @@ -13,20 +13,8 @@ * Licensed under GPLv2 or later */ +#include "porting.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include "bswap.h" -#include "link.h" -/* makefile will include elf.h for us */ - static int byteswap; static __inline__ uint32_t byteswap32_to_host(uint32_t value) { @@ -103,15 +91,13 @@ /* Check if the target endianness matches the host's endianness */ byteswap = 0; -#if __BYTE_ORDER == __LITTLE_ENDIAN - if (ehdr->e_ident[5] == ELFDATA2MSB) - byteswap = 1; -#elif __BYTE_ORDER == __BIG_ENDIAN - if (ehdr->e_ident[5] == ELFDATA2LSB) - byteswap = 1; -#else -#error Unknown host byte order! -#endif + if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_LITTLE) { + if (ehdr->e_ident[5] == ELFDATA2MSB) + byteswap = 1; + } else if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_BIG) { + if (ehdr->e_ident[5] == ELFDATA2LSB) + byteswap = 1; + } /* Be very lazy, and only byteswap the stuff we use */ if (byteswap) { ehdr->e_type = bswap_16(ehdr->e_type); Index: utils/ldd.c =================================================================== --- utils/ldd.c (revision 25280) +++ utils/ldd.c (revision 25281) @@ -13,26 +13,8 @@ * Licensed under GPLv2 or later */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "porting.h" -#include "bswap.h" -#include "link.h" -#include "dl-defs.h" -/* makefile will include elf.h for us */ - -#ifdef DMALLOC -#include -#endif - #if defined(__alpha__) #define MATCH_MACHINE(x) (x == EM_ALPHA) #define ELFCLASSM ELFCLASS64 @@ -134,16 +116,12 @@ # warning "You really should add a MATCH_MACHINE() macro for your architecture" #endif -#if __BYTE_ORDER == __LITTLE_ENDIAN +#if UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_LITTLE #define ELFDATAM ELFDATA2LSB -#elif __BYTE_ORDER == __BIG_ENDIAN +#elif UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_BIG #define ELFDATAM ELFDATA2MSB #endif -#ifndef UCLIBC_RUNTIME_PREFIX -# define UCLIBC_RUNTIME_PREFIX "/" -#endif - struct library { char *name; int resolved; @@ -247,15 +225,13 @@ /* Check if the target endianness matches the host's endianness */ byteswap = 0; -#if __BYTE_ORDER == __LITTLE_ENDIAN - if (ehdr->e_ident[5] == ELFDATA2MSB) - byteswap = 1; -#elif __BYTE_ORDER == __BIG_ENDIAN - if (ehdr->e_ident[5] == ELFDATA2LSB) - byteswap = 1; -#else -#error Unknown host byte order! -#endif + if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_LITTLE) { + if (ehdr->e_ident[5] == ELFDATA2MSB) + byteswap = 1; + } else if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_BIG) { + if (ehdr->e_ident[5] == ELFDATA2LSB) + byteswap = 1; + } /* Be very lazy, and only byteswap the stuff we use */ if (byteswap) { Index: utils/ldconfig.c =================================================================== --- utils/ldconfig.c (revision 25280) +++ utils/ldconfig.c (revision 25281) @@ -26,20 +26,7 @@ * 2005/09/16: Dan Howell (modified for cross-development) */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "bswap.h" -#include "dl-defs.h" +#include "porting.h" #define BUFFER_SIZE 4096 @@ -72,20 +59,6 @@ char *___strtok = NULL; -/* For SunOS */ -#ifndef PATH_MAX -#include -#define PATH_MAX _POSIX_PATH_MAX -#endif - -/* For SunOS */ -#ifndef N_MAGIC -#define N_MAGIC(exec) ((exec).a_magic & 0xffff) -#endif - -#define EXIT_OK 0 -#define EXIT_FATAL 128 - char *prog = NULL; int debug = 0; /* debug mode */ int verbose = 0; /* verbose mode */ @@ -177,7 +150,7 @@ { void *ptr; if ((ptr = malloc(size)) == NULL) - err(EXIT_FATAL, "out of memory"); + err(EXIT_FAILURE, "out of memory"); return ptr; } @@ -185,7 +158,7 @@ { char *ptr; if ((ptr = strdup(str)) == NULL) - err(EXIT_FATAL, "out of memory"); + err(EXIT_FAILURE, "out of memory"); return ptr; } @@ -452,7 +425,7 @@ /* We need a writable copy of this string */ path = strdup(rawname); if (!path) { - err(EXIT_FATAL, "Out of memory!\n"); + err(EXIT_FAILURE, "Out of memory!\n"); } /* Eliminate all double //s */ path_n = path; @@ -678,17 +651,17 @@ return; if (!chroot_realpath(chroot_dir, cachefile, realcachefile)) - err(EXIT_FATAL, "can't resolve %s in chroot %s (%s)", + err(EXIT_FAILURE, "can't resolve %s in chroot %s (%s)", cachefile, chroot_dir, strerror(errno)); sprintf(tempfile, "%s~", realcachefile); if (unlink(tempfile) && errno != ENOENT) - err(EXIT_FATAL, "can't unlink %s~ (%s)", cachefile, + err(EXIT_FAILURE, "can't unlink %s~ (%s)", cachefile, strerror(errno)); if ((cachefd = creat(tempfile, 0644)) < 0) - err(EXIT_FATAL, "can't create %s~ (%s)", cachefile, + err(EXIT_FAILURE, "can't create %s~ (%s)", cachefile, strerror(errno)); if (byteswap) { @@ -699,7 +672,7 @@ magic_ptr = &magic; } if (write(cachefd, magic_ptr, sizeof(header_t)) != sizeof(header_t)) - err(EXIT_FATAL, "can't write %s~ (%s)", cachefile, + err(EXIT_FAILURE, "can't write %s~ (%s)", cachefile, strerror(errno)); for (cur_lib = lib_head; cur_lib != NULL; cur_lib = cur_lib->next) { @@ -717,31 +690,31 @@ } if (write(cachefd, lib_ptr, sizeof(libentry_t)) != sizeof(libentry_t)) - err(EXIT_FATAL, "can't write %s~ (%s)", cachefile, + err(EXIT_FAILURE, "can't write %s~ (%s)", cachefile, strerror(errno)); } for (cur_lib = lib_head; cur_lib != NULL; cur_lib = cur_lib->next) { if ((size_t)write(cachefd, cur_lib->soname, strlen(cur_lib->soname) + 1) != strlen(cur_lib->soname) + 1) - err(EXIT_FATAL, "can't write %s~ (%s)", cachefile, + err(EXIT_FAILURE, "can't write %s~ (%s)", cachefile, strerror(errno)); if ((size_t)write(cachefd, cur_lib->libname, strlen(cur_lib->libname) + 1) != strlen(cur_lib->libname) + 1) - err(EXIT_FATAL, "can't write %s~ (%s)", cachefile, + err(EXIT_FAILURE, "can't write %s~ (%s)", cachefile, strerror(errno)); } if (close(cachefd)) - err(EXIT_FATAL, "can't close %s~ (%s)", cachefile, + err(EXIT_FAILURE, "can't close %s~ (%s)", cachefile, strerror(errno)); if (chmod(tempfile, 0644)) - err(EXIT_FATAL, "can't chmod %s~ (%s)", cachefile, + err(EXIT_FAILURE, "can't chmod %s~ (%s)", cachefile, strerror(errno)); if (rename(tempfile, realcachefile)) - err(EXIT_FATAL, "can't rename %s~ (%s)", cachefile, + err(EXIT_FAILURE, "can't rename %s~ (%s)", cachefile, strerror(errno)); } @@ -756,22 +729,22 @@ char realcachefile[BUFFER_SIZE]; if (!chroot_realpath(chroot_dir, cachefile, realcachefile)) - err(EXIT_FATAL, "can't resolve %s in chroot %s (%s)", + err(EXIT_FAILURE, "can't resolve %s in chroot %s (%s)", cachefile, chroot_dir, strerror(errno)); if (stat(realcachefile, &st) || (fd = open(realcachefile, O_RDONLY)) < 0) - err(EXIT_FATAL, "can't read %s (%s)", cachefile, strerror(errno)); + err(EXIT_FAILURE, "can't read %s (%s)", cachefile, strerror(errno)); c = mmap(0, st.st_size, PROT_READ, LDSO_CACHE_MMAP_FLAGS, fd, 0); if (c == MAP_FAILED) - err(EXIT_FATAL, "can't map %s (%s)", cachefile, strerror(errno)); + err(EXIT_FAILURE, "can't map %s (%s)", cachefile, strerror(errno)); close(fd); if (memcmp(((header_t *) c)->magic, LDSO_CACHE_MAGIC, LDSO_CACHE_MAGIC_LEN)) - err(EXIT_FATAL, "%s cache corrupt", cachefile); + err(EXIT_FAILURE, "%s cache corrupt", cachefile); if (memcmp(((header_t *) c)->version, LDSO_CACHE_VER, LDSO_CACHE_VER_LEN)) - err(EXIT_FATAL, "wrong cache version - expected %s", + err(EXIT_FAILURE, "wrong cache version - expected %s", LDSO_CACHE_VER); header = (header_t *) c; @@ -843,7 +816,7 @@ "\tlib ... :\tlibraries to link\n\n" #endif ); - exit(EXIT_FATAL); + exit(EXIT_FAILURE); } #define DIR_SEP ":, \t\n" @@ -916,11 +889,11 @@ if (chroot_dir && *chroot_dir) { if (chroot(chroot_dir) < 0) { if (chdir(chroot_dir) < 0) - err(EXIT_FATAL, "couldn't chroot to %s (%s)", chroot_dir, strerror(errno)); + err(EXIT_FAILURE, "couldn't chroot to %s (%s)", chroot_dir, strerror(errno)); chroot_dir = "."; } else { if (chdir("/") < 0) - err(EXIT_FATAL, "couldn't chdir to / (%s)", strerror(errno)); + err(EXIT_FAILURE, "couldn't chdir to / (%s)", strerror(errno)); chroot_dir = NULL; } } @@ -932,7 +905,7 @@ if (printcache) { /* print the cache -- don't you trust me? */ cache_print(); - exit(EXIT_OK); + exit(EXIT_SUCCESS); } else if (libmode) { /* so you want to do things manually, eh? */ @@ -952,7 +925,7 @@ /* we'd better do a little bit of checking */ if ((so = is_shlib(dir, cp, &libtype, &islink, LIB_ANY)) == NULL) - err(EXIT_FATAL, "%s%s%s is not a shared library", + err(EXIT_FAILURE, "%s%s%s is not a shared library", dir, (*dir && strcmp(dir, "/")) ? "/" : "", cp); /* so far, so good, maybe he knows what he's doing */ @@ -1005,5 +978,5 @@ cache_write(); } - exit(EXIT_OK); + exit(EXIT_SUCCESS); } Index: utils/porting.h =================================================================== --- utils/porting.h (revision 0) +++ utils/porting.h (revision 25281) @@ -0,0 +1,57 @@ +/* Misc system-specific crap */ + +#ifndef _PORTING_H_ +#define _PORTING_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +/* makefile will include elf.h for us */ + +#include "bswap.h" +#include "dl-defs.h" + +#ifdef DMALLOC +#include +#endif + +/* For SunOS */ +#ifndef PATH_MAX +#define PATH_MAX _POSIX_PATH_MAX +#endif + +#ifndef UCLIBC_RUNTIME_PREFIX +# define UCLIBC_RUNTIME_PREFIX "/" +#endif + +#define UCLIBC_ENDIAN_LITTLE 1234 +#define UCLIBC_ENDIAN_BIG 4321 +#if __BYTE_ORDER == __LITTLE_ENDIAN +# define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_LITTLE +#elif __BYTE_ORDER == __BIG_ENDIAN +# define UCLIBC_ENDIAN_HOST UCLIBC_ENDIAN_BIG +#else +# error "Unknown host byte order!" +#endif + +#endif ------------------------------------------------------------------------ r25280 | vapier | 2009-02-09 15:25:15 -0600 (Mon, 09 Feb 2009) | 1 line Changed paths: M /trunk/uClibc/utils/Makefile.in dont force -Wl,-s when building host utils -- people can strip themselves ------------------------------------------------------------------------ Index: utils/Makefile.in =================================================================== --- utils/Makefile.in (revision 25279) +++ utils/Makefile.in (revision 25280) @@ -52,21 +52,21 @@ LDSO_CACHE_SUPPORT := -D__LDSO_CACHE_SUPPORT__=1 endif -BUILD_CFLAGS-ldconfig.host := -Wl,-s \ +BUILD_CFLAGS-ldconfig.host := \ -include $(top_srcdir)include/elf.h \ -I$(top_srcdir)ldso/include \ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \ -DUCLIBC_LDSO=$(UCLIBC_LDSO) \ $(LDSO_CACHE_SUPPORT) \ -BUILD_CFLAGS-ldd.host := -Wl,-s \ +BUILD_CFLAGS-ldd.host := \ -include $(top_srcdir)include/elf.h \ -I$(top_srcdir)ldso/include \ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \ -DUCLIBC_LDSO=$(UCLIBC_LDSO) \ $(LDSO_CACHE_SUPPORT) \ -BUILD_CFLAGS-readelf.host := -Wl,-s \ +BUILD_CFLAGS-readelf.host := \ -include $(top_srcdir)include/elf.h \ ------------------------------------------------------------------------ r25275 | vda | 2009-02-09 07:26:01 -0600 (Mon, 09 Feb 2009) | 4 lines Changed paths: M /trunk/uClibc/Makefile.in reinstate bits/uClibc_arch_features.h in installed headers, my cross-compile toolchain based on gcc 4.3.1 broke without it. ------------------------------------------------------------------------ Index: Makefile.in =================================================================== --- Makefile.in (revision 25274) +++ Makefile.in (revision 25275) @@ -220,7 +220,8 @@ $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/atomic.h $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/sigcontextinfo.h $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/stackinfo.h - $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_arch_features.h + # gcc 4.3.1 needs it, dont rm: + #$(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_arch_features.h ifneq ($(UCLIBC_HAS_FLOATS),y) # Remove floating point related headers since float support is disabled. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/complex.h ------------------------------------------------------------------------ r25273 | vda | 2009-02-09 07:10:12 -0600 (Mon, 09 Feb 2009) | 19 lines Changed paths: M /trunk/uClibc/libm/ldouble_wrappers.c Hand-optimize wrappers on i386: -83 ec 10 sub $0x10,%esp -db 6c 24 14 fldt 0x14(%esp) -dd 5c 24 08 fstpl 0x8(%esp) -dd 44 24 08 fldl 0x8(%esp) -dd 1c 24 fstpl (%esp) -e8 fc ff ff ff call __GI_trunc -83 c4 10 add $0x10,%esp +db 6c 24 04 fldt 0x4(%esp) +dd 5c 24 04 fstpl 0x4(%esp) +e9 fc ff ff ff jmp __GI_trunc c3 ret text data bss dec hex filename - 42749 176 4 42929 a7b1 lib/libm-0.9.30-svn.so + 42085 176 4 42265 a519 lib/libm-0.9.30-svn.so ------------------------------------------------------------------------ Index: libm/ldouble_wrappers.c =================================================================== --- libm/ldouble_wrappers.c (revision 25272) +++ libm/ldouble_wrappers.c (revision 25273) @@ -16,7 +16,72 @@ #include "math.h" #include +#define STRINGIZE(s) #s +#define WRAPPER1(func) \ +long double func##l(long double x) \ +{ \ + return (long double) func((double) x); \ +} + +#define int_WRAPPER1(func) \ +int func##l(long double x) \ +{ \ + return func((double) x); \ +} + +#if defined __i386__ && defined __OPTIMIZE__ +# undef WRAPPER1 +# undef int_WRAPPER1 +/* gcc 4.3.1 generates really ugly code with redundant pair of store/load: + * sub $0x10,%esp + * fldt 0x14(%esp) + * fstpl 0x8(%esp) + * fldl 0x8(%esp) <-- ?? + * fstpl (%esp) <-- ?? + * call function + * add $0x10,%esp + * ret + * I can hope newer gcc will eliminate that. However, I don't think + * it will be smart enough to reuse argument stack space and use + * jump instead of call. Let's do it by hand. + * The asm below loads long double x into st(0), then stores it back + * to the same location as a double. At this point, stack looks exactly + * as "double func(double)" expects it to be. + * The return value is returned in st(0) per ABI in both cases (returning + * a long double or returning a double). So we can simply jump to func. + * Using __GI_func in jump to make optimized intra-library jump. + * gcc will still generate a useless "ret" after asm. Oh well... + */ +# define WRAPPER1(func) \ +long double func##l(long double x) \ +{ \ + long double fp_top; \ + __asm ( \ + " fldt %1\n" \ + " fstpl %1\n" \ + " jmp " STRINGIZE(__GI_##func) "\n" \ + : "=t" (fp_top) \ + : "m" (x) \ + ); \ + return fp_top; \ +} +# define int_WRAPPER1(func) \ +int func##l(long double x) \ +{ \ + int ret; \ + __asm ( \ + " fldt %1\n" \ + " fstpl %1\n" \ + " jmp " STRINGIZE(__GI_##func) "\n" \ + : "=a" (ret) \ + : "m" (x) \ + ); \ + return ret; \ +} +#endif /* __i386__ */ + + /* Implement the following, as defined by SuSv3 */ #if 0 long double acoshl(long double); @@ -79,31 +144,19 @@ #endif #ifdef L_acoshl -long double acoshl (long double x) -{ - return (long double) acosh( (double)x ); -} +WRAPPER1(acosh) #endif #ifdef L_acosl -long double acosl (long double x) -{ - return (long double) acos( (double)x ); -} +WRAPPER1(acos) #endif #ifdef L_asinhl -long double asinhl (long double x) -{ - return (long double) asinh( (double)x ); -} +WRAPPER1(asinh) #endif #ifdef L_asinl -long double asinl (long double x) -{ - return (long double) asin( (double)x ); -} +WRAPPER1(asin) #endif #ifdef L_atan2l @@ -114,17 +167,11 @@ #endif #ifdef L_atanhl -long double atanhl (long double x) -{ - return (long double) atanh( (double)x ); -} +WRAPPER1(atanh) #endif #ifdef L_atanl -long double atanl (long double x) -{ - return (long double) atan( (double)x ); -} +WRAPPER1(atan) #endif #ifdef L_cargl @@ -135,17 +182,11 @@ #endif #ifdef L_cbrtl -long double cbrtl (long double x) -{ - return (long double) cbrt( (double)x ); -} +WRAPPER1(cbrt) #endif #ifdef L_ceill -long double ceill (long double x) -{ - return (long double) ceil( (double)x ); -} +WRAPPER1(ceil) #endif #ifdef L_copysignl @@ -156,59 +197,35 @@ #endif #ifdef L_coshl -long double coshl (long double x) -{ - return (long double) cosh( (double)x ); -} +WRAPPER1(cosh) #endif #ifdef L_cosl -long double cosl (long double x) -{ - return (long double) cos( (double)x ); -} +WRAPPER1(cos) #endif #ifdef L_erfcl -long double erfcl (long double x) -{ - return (long double) erfc( (double)x ); -} +WRAPPER1(erfc) #endif #ifdef L_erfl -long double erfl (long double x) -{ - return (long double) erf( (double)x ); -} +WRAPPER1(erf) #endif #ifdef L_exp2l -long double exp2l (long double x) -{ - return (long double) exp2( (double)x ); -} +WRAPPER1(exp2) #endif #ifdef L_expl -long double expl (long double x) -{ - return (long double) exp( (double)x ); -} +WRAPPER1(exp) #endif #ifdef L_expm1l -long double expm1l (long double x) -{ - return (long double) expm1( (double)x ); -} +WRAPPER1(expm1) #endif #ifdef L_fabsl -long double fabsl (long double x) -{ - return (long double) fabs( (double)x ); -} +WRAPPER1(fabs) #endif #ifdef L_fdiml @@ -219,10 +236,7 @@ #endif #ifdef L_floorl -long double floorl (long double x) -{ - return (long double) floor( (double)x ); -} +WRAPPER1(floor) #endif #ifdef L_fmal @@ -268,10 +282,7 @@ #endif #ifdef L_ilogbl -int ilogbl (long double x) -{ - return (long double) ilogb( (double)x ); -} +int_WRAPPER1(ilogb) #endif #ifdef L_ldexpl @@ -282,10 +293,7 @@ #endif #ifdef L_lgammal -long double lgammal (long double x) -{ - return (long double) lgamma( (double)x ); -} +WRAPPER1(lgamma) #endif #ifdef L_llrintl @@ -303,38 +311,23 @@ #endif #ifdef L_log10l -long double log10l (long double x) -{ - return (long double) log10( (double)x ); -} +WRAPPER1(log10) #endif #ifdef L_log1pl -long double log1pl (long double x) -{ - return (long double) log1p( (double)x ); -} +WRAPPER1(log1p) #endif #ifdef L_log2l -long double log2l (long double x) -{ - return (long double) log2( (double)x ); -} +WRAPPER1(log2) #endif #ifdef L_logbl -long double logbl (long double x) -{ - return (long double) logb( (double)x ); -} +WRAPPER1(logb) #endif #ifdef L_logl -long double logl (long double x) -{ - return (long double) log( (double)x ); -} +WRAPPER1(log) #endif #ifdef L_lrintl @@ -362,10 +355,7 @@ #endif #ifdef L_nearbyintl -long double nearbyintl (long double x) -{ - return (long double) nearbyint( (double)x ); -} +WRAPPER1(nearbyint) #endif #ifdef L_nextafterl @@ -404,17 +394,11 @@ #endif #ifdef L_rintl -long double rintl (long double x) -{ - return (long double) rint( (double)x ); -} +WRAPPER1(rint) #endif #ifdef L_roundl -long double roundl (long double x) -{ - return (long double) round( (double)x ); -} +WRAPPER1(round) #endif #ifdef L_scalblnl @@ -432,90 +416,54 @@ #endif #ifdef L_sinhl -long double sinhl (long double x) -{ - return (long double) sinh( (double)x ); -} +WRAPPER1(sinh) #endif #ifdef L_sinl -long double sinl (long double x) -{ - return (long double) sin( (double)x ); -} +WRAPPER1(sin) #endif #ifdef L_sqrtl -long double sqrtl (long double x) -{ - return (long double) sqrt( (double)x ); -} +WRAPPER1(sqrt) #endif #ifdef L_tanhl -long double tanhl (long double x) -{ - return (long double) tanh( (double)x ); -} +WRAPPER1(tanh) #endif #ifdef L_tanl -long double tanl (long double x) -{ - return (long double) tan( (double)x ); -} +WRAPPER1(tan) #endif #ifdef L_tgammal -long double tgammal (long double x) -{ - return (long double) tgamma( (double)x ); -} +WRAPPER1(tgamma) #endif #ifdef L_truncl -long double truncl (long double x) -{ - return (long double) trunc( (double)x ); -} +WRAPPER1(trunc) #endif #ifdef __DO_C99_MATH__ #ifdef L_fpclassifyl -int __fpclassifyl (long double x) -{ - return __fpclassify ( (double) x ); -} +int_WRAPPER1(__fpclassify); #endif #ifdef L_finitel -int __finitel (long double x) -{ - return __finite ( (double)x ); -} +int_WRAPPER1(__finite) #endif #ifdef L___signbitl -int __signbitl (long double x) -{ - return __signbit ( (double)x ); -} +int_WRAPPER1(__signbit) #endif #ifdef L_isnanl -int __isnanl (long double x) -{ - return __isnan ( (double)x ); -} +int_WRAPPER1(__isnan) libm_hidden_def(__isnanl) #endif #ifdef L_isinfl -int __isinfl (long double x) -{ - return __isinf ( (double)x ); -} +int_WRAPPER1(__isinf) libm_hidden_def(__isinfl) #endif ------------------------------------------------------------------------ r25270 | vda | 2009-02-09 07:07:37 -0600 (Mon, 09 Feb 2009) | 5 lines Changed paths: M /trunk/uClibc/libm/Makefile.in M /trunk/uClibc/libm/ldouble_wrappers.c ldouble_wrappers.c: fix __signbitl, it was calling itself by mistake. remove wrong casts to long double of long return values. remove lots of empty lines. ------------------------------------------------------------------------ Index: libm/Makefile.in =================================================================== --- libm/Makefile.in (revision 25269) +++ libm/Makefile.in (revision 25270) @@ -87,7 +87,7 @@ frexpl.o gammal.o hypotl.o ilogbl.o isinfl.o isnanl.o ldexpl.o lgammal.o llrintl.o \ llroundl.o log10l.o log1pl.o XXXlog2l.o logbl.o logl.o lrintl.o lroundl.o \ modfl.o nearbyintl.o nextafterl.o XXXnexttowardl.o powl.o remainderl.o \ - remquol.o rintl.o roundl.o scalblnl.o scalbnl.o signbitl.o sinhl.o sinl.o sqrtl.o \ + remquol.o rintl.o roundl.o scalblnl.o scalbnl.o __signbitl.o sinhl.o sinl.o sqrtl.o \ tanhl.o tanl.o tgammal.o truncl.o else # This list of math functions was taken from POSIX/IEEE 1003.1b-1993 Index: libm/ldouble_wrappers.c =================================================================== --- libm/ldouble_wrappers.c (revision 25269) +++ libm/ldouble_wrappers.c (revision 25270) @@ -85,7 +85,6 @@ } #endif - #ifdef L_acosl long double acosl (long double x) { @@ -93,7 +92,6 @@ } #endif - #ifdef L_asinhl long double asinhl (long double x) { @@ -101,7 +99,6 @@ } #endif - #ifdef L_asinl long double asinl (long double x) { @@ -109,7 +106,6 @@ } #endif - #ifdef L_atan2l long double atan2l (long double x, long double y) { @@ -117,7 +113,6 @@ } #endif - #ifdef L_atanhl long double atanhl (long double x) { @@ -125,7 +120,6 @@ } #endif - #ifdef L_atanl long double atanl (long double x) { @@ -133,7 +127,6 @@ } #endif - #ifdef L_cargl long double cargl (long double complex x) { @@ -141,7 +134,6 @@ } #endif - #ifdef L_cbrtl long double cbrtl (long double x) { @@ -149,7 +141,6 @@ } #endif - #ifdef L_ceill long double ceill (long double x) { @@ -157,7 +148,6 @@ } #endif - #ifdef L_copysignl long double copysignl (long double x, long double y) { @@ -165,7 +155,6 @@ } #endif - #ifdef L_coshl long double coshl (long double x) { @@ -173,7 +162,6 @@ } #endif - #ifdef L_cosl long double cosl (long double x) { @@ -181,7 +169,6 @@ } #endif - #ifdef L_erfcl long double erfcl (long double x) { @@ -189,7 +176,6 @@ } #endif - #ifdef L_erfl long double erfl (long double x) { @@ -197,7 +183,6 @@ } #endif - #ifdef L_exp2l long double exp2l (long double x) { @@ -205,7 +190,6 @@ } #endif - #ifdef L_expl long double expl (long double x) { @@ -213,7 +197,6 @@ } #endif - #ifdef L_expm1l long double expm1l (long double x) { @@ -221,7 +204,6 @@ } #endif - #ifdef L_fabsl long double fabsl (long double x) { @@ -229,7 +211,6 @@ } #endif - #ifdef L_fdiml long double fdiml (long double x, long double y) { @@ -237,7 +218,6 @@ } #endif - #ifdef L_floorl long double floorl (long double x) { @@ -245,7 +225,6 @@ } #endif - #ifdef L_fmal long double fmal (long double x, long double y, long double z) { @@ -253,7 +232,6 @@ } #endif - #ifdef L_fmaxl long double fmaxl (long double x, long double y) { @@ -261,7 +239,6 @@ } #endif - #ifdef L_fminl long double fminl (long double x, long double y) { @@ -269,7 +246,6 @@ } #endif - #ifdef L_fmodl long double fmodl (long double x, long double y) { @@ -277,7 +253,6 @@ } #endif - #ifdef L_frexpl long double frexpl (long double x, int *exp) { @@ -285,7 +260,6 @@ } #endif - #ifdef L_hypotl long double hypotl (long double x, long double y) { @@ -293,7 +267,6 @@ } #endif - #ifdef L_ilogbl int ilogbl (long double x) { @@ -301,7 +274,6 @@ } #endif - #ifdef L_ldexpl long double ldexpl (long double x, int exp) { @@ -309,7 +281,6 @@ } #endif - #ifdef L_lgammal long double lgammal (long double x) { @@ -317,19 +288,17 @@ } #endif - #ifdef L_llrintl long long llrintl (long double x) { - return (long double) llrint( (double)x ); + return llrint( (double)x ); } #endif - #ifdef L_llroundl long long llroundl (long double x) { - return (long double) llround( (double)x ); + return llround( (double)x ); } #endif @@ -340,7 +309,6 @@ } #endif - #ifdef L_log1pl long double log1pl (long double x) { @@ -348,7 +316,6 @@ } #endif - #ifdef L_log2l long double log2l (long double x) { @@ -356,7 +323,6 @@ } #endif - #ifdef L_logbl long double logbl (long double x) { @@ -364,7 +330,6 @@ } #endif - #ifdef L_logl long double logl (long double x) { @@ -372,23 +337,20 @@ } #endif - #ifdef L_lrintl long lrintl (long double x) { - return (long double) lrint( (double)x ); + return lrint( (double)x ); } #endif - #ifdef L_lroundl long lroundl (long double x) { - return (long double) lround( (double)x ); + return lround( (double)x ); } #endif - #ifdef L_modfl long double modfl (long double x, long double *iptr) { @@ -396,11 +358,9 @@ result = modf ( x, &y ); *iptr = (long double)y; return (long double) result; - } #endif - #ifdef L_nearbyintl long double nearbyintl (long double x) { @@ -408,7 +368,6 @@ } #endif - #ifdef L_nextafterl long double nextafterl (long double x, long double y) { @@ -416,7 +375,6 @@ } #endif - #ifdef L_nexttowardl long double nexttowardl (long double x, long double y) { @@ -424,7 +382,6 @@ } #endif - #ifdef L_powl long double powl (long double x, long double y) { @@ -432,7 +389,6 @@ } #endif - #ifdef L_remainderl long double remainderl (long double x, long double y) { @@ -440,7 +396,6 @@ } #endif - #ifdef L_remquol long double remquol (long double x, long double y, int *quo) { @@ -448,7 +403,6 @@ } #endif - #ifdef L_rintl long double rintl (long double x) { @@ -456,7 +410,6 @@ } #endif - #ifdef L_roundl long double roundl (long double x) { @@ -464,7 +417,6 @@ } #endif - #ifdef L_scalblnl long double scalblnl (long double x, long exp) { @@ -472,7 +424,6 @@ } #endif - #ifdef L_scalbnl long double scalbnl (long double x, int exp) { @@ -480,7 +431,6 @@ } #endif - #ifdef L_sinhl long double sinhl (long double x) { @@ -488,7 +438,6 @@ } #endif - #ifdef L_sinl long double sinl (long double x) { @@ -496,7 +445,6 @@ } #endif - #ifdef L_sqrtl long double sqrtl (long double x) { @@ -504,7 +452,6 @@ } #endif - #ifdef L_tanhl long double tanhl (long double x) { @@ -512,7 +459,6 @@ } #endif - #ifdef L_tanl long double tanl (long double x) { @@ -520,7 +466,6 @@ } #endif - #ifdef L_tgammal long double tgammal (long double x) { @@ -528,7 +473,6 @@ } #endif - #ifdef L_truncl long double truncl (long double x) { @@ -536,7 +480,6 @@ } #endif - #ifdef __DO_C99_MATH__ #ifdef L_fpclassifyl @@ -553,10 +496,10 @@ } #endif -#ifdef L_signbitl +#ifdef L___signbitl int __signbitl (long double x) { - return __signbitl ( (double)x ); + return __signbit ( (double)x ); } #endif ------------------------------------------------------------------------ r25266 | vda | 2009-02-08 16:45:13 -0600 (Sun, 08 Feb 2009) | 3 lines Changed paths: A /trunk/uClibc/libc/string/generic/strverscmp.c forgot to add libc/string/generic/strverscmp.c ------------------------------------------------------------------------ Index: libc/string/generic/strverscmp.c =================================================================== --- libc/string/generic/strverscmp.c (revision 0) +++ libc/string/generic/strverscmp.c (revision 25266) @@ -0,0 +1,117 @@ +/* GNU's strverscmp() function, taken from glibc 2.3.2 sources + */ + +/* Compare strings while treating digits characters numerically. + Copyright (C) 1997, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jean-François Bignolles , 1997. + + Derived work for uClibc by Hai Zaar, Codefidence Ltd + + 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 +#include +#include + + +/* states: S_N: normal, S_I: comparing integral part, S_F: comparing + fractional parts, S_Z: idem but with leading Zeroes only */ +#define S_N 0x0 +#define S_I 0x4 +#define S_F 0x8 +#define S_Z 0xC + +/* result_type: CMP: return diff; LEN: compare using len_diff/diff */ +#define CMP 2 +#define LEN 3 + +/* using more efficient isdigit() */ +#undef isdigit +#define isdigit(a) ((unsigned)((a) - '0') <= 9) + +/* Compare S1 and S2 as strings holding indices/version numbers, + returning less than, equal to or greater than zero if S1 is less than, + equal to or greater than S2 (for more info, see the texinfo doc). +*/ +int strverscmp (const char *s1, const char *s2) +{ + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + int state; + int diff; + + /* Symbol(s) 0 [1-9] others (padding) + Transition (10) 0 (01) d (00) x (11) - */ + static const uint8_t next_state[] = + { + /* state x d 0 - */ + /* S_N */ S_N, S_I, S_Z, S_N, + /* S_I */ S_N, S_I, S_I, S_I, + /* S_F */ S_N, S_F, S_F, S_F, + /* S_Z */ S_N, S_F, S_Z, S_Z + }; + + static const int8_t result_type[] = + { + /* state x/x x/d x/0 x/- d/x d/d d/0 d/- + 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */ + + /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_I */ CMP, -1, -1, CMP, +1, LEN, LEN, CMP, + +1, LEN, LEN, CMP, CMP, CMP, CMP, CMP, + /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, + CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, + /* S_Z */ CMP, +1, +1, CMP, -1, CMP, CMP, CMP, + -1, CMP, CMP, CMP + }; + + if (p1 == p2) + return 0; + + c1 = *p1++; + c2 = *p2++; + /* Hint: '0' is a digit too. */ + state = S_N | ((c1 == '0') + (isdigit (c1) != 0)); + + while ((diff = c1 - c2) == 0 && c1 != '\0') + { + state = next_state[state]; + c1 = *p1++; + c2 = *p2++; + state |= (c1 == '0') + (isdigit (c1) != 0); + } + + state = result_type[state << 2 | (((c2 == '0') + (isdigit (c2) != 0)))]; + + switch (state) + { + case CMP: + return diff; + + case LEN: + while (isdigit (*p1++)) + if (!isdigit (*p2++)) + return 1; + + return isdigit (*p2) ? -1 : diff; + + default: + return state; + } +} ------------------------------------------------------------------------ r25265 | vda | 2009-02-08 16:40:17 -0600 (Sun, 08 Feb 2009) | 4 lines Changed paths: M /trunk/uClibc/include/dirent.h M /trunk/uClibc/include/string.h M /trunk/uClibc/libc/misc/dirent/Makefile.in A /trunk/uClibc/libc/misc/dirent/versionsort.c A /trunk/uClibc/libc/misc/dirent/versionsort64.c Add strverscmp() and versionsort[64](). By Hai Zaar (haizaar AT codefidence.com) ------------------------------------------------------------------------ Index: include/dirent.h =================================================================== --- include/dirent.h (revision 25264) +++ include/dirent.h (revision 25265) @@ -293,6 +293,25 @@ __THROW __attribute_pure__ __nonnull ((1, 2)); # endif +/* Function to compare two `struct dirent's alphabetically. */ +# ifndef __USE_FILE_OFFSET64 +extern int versionsort (__const void *__e1, __const void *__e2) + __THROW __attribute_pure__ __nonnull ((1, 2)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (versionsort, + (__const void *__e1, __const void *__e2), + versionsort64) __attribute_pure__ __nonnull ((1, 2)); +# else +# define versionsort versionsort64 +# endif +# endif + +# if defined __USE_GNU && defined __USE_LARGEFILE64 +extern int versionsort64 (__const void *__e1, __const void *__e2) + __THROW __attribute_pure__ __nonnull ((1, 2)); +# endif + #endif /* Use BSD or misc. */ __END_DECLS Index: include/string.h =================================================================== --- include/string.h (revision 25264) +++ include/string.h (revision 25265) @@ -422,11 +422,9 @@ #ifdef __USE_GNU /* Compare S1 and S2 as strings holding name & indices/version numbers. */ -# if 0 extern int strverscmp (__const char *__s1, __const char *__s2) __THROW __attribute_pure__ __nonnull ((1, 2)); libc_hidden_proto(strverscmp) -# endif /* Return a string describing the meaning of the signal number in SIG. */ extern char *strsignal (int __sig) __THROW; Index: libc/misc/dirent/Makefile.in =================================================================== --- libc/misc/dirent/Makefile.in (revision 25264) +++ libc/misc/dirent/Makefile.in (revision 25265) @@ -6,10 +6,10 @@ # CSRC := alphasort.c closedir.c dirfd.c opendir.c readdir.c rewinddir.c \ - scandir.c seekdir.c telldir.c readdir_r.c + scandir.c seekdir.c telldir.c readdir_r.c versionsort.c ifeq ($(UCLIBC_HAS_LFS),y) -CSRC += readdir64.c alphasort64.c scandir64.c readdir64_r.c +CSRC += readdir64.c alphasort64.c scandir64.c readdir64_r.c versionsort64.c endif MISC_DIRENT_DIR := $(top_srcdir)libc/misc/dirent Index: libc/misc/dirent/versionsort64.c =================================================================== --- libc/misc/dirent/versionsort64.c (revision 0) +++ libc/misc/dirent/versionsort64.c (revision 25265) @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2008-2009 Hai Zaar, Codefidence Ltd + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include <_lfs_64.h> + +#include +#include +#include "dirstream.h" + +int versionsort64(const void *a, const void *b) +{ + return strverscmp((*(const struct dirent64 **) a)->d_name, + (*(const struct dirent64 **) b)->d_name); +} Index: libc/misc/dirent/versionsort.c =================================================================== --- libc/misc/dirent/versionsort.c (revision 0) +++ libc/misc/dirent/versionsort.c (revision 25265) @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2008-2009 Hai Zaar, Codefidence Ltd + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include +#include +#include "dirstream.h" + +int versionsort(const void *a, const void *b) +{ + return strverscmp((*(const struct dirent **) a)->d_name, + (*(const struct dirent **) b)->d_name); +} ------------------------------------------------------------------------ r25262 | vda | 2009-02-07 20:04:10 -0600 (Sat, 07 Feb 2009) | 3 lines Changed paths: A /trunk/uClibc/docs/probe_math_exception.c M /trunk/uClibc/libm/math_private.h M /trunk/uClibc/libm/s_nextafterf.c nextafterf: trying to correct FP exception handling ------------------------------------------------------------------------ Index: libm/s_nextafterf.c =================================================================== --- libm/s_nextafterf.c (revision 25261) +++ libm/s_nextafterf.c (revision 25262) @@ -16,11 +16,6 @@ #include "math.h" #include "math_private.h" -#ifndef math_opt_barrier -# define math_opt_barrier(x) ({ __typeof (x) __x = x; __asm ("" : "+m" (__x)); __x; }) -# define math_force_eval(x) __asm __volatile ("" : : "m" (x)) -#endif - float nextafterf(float x, float y) { int32_t hx, hy, ix, iy; @@ -38,12 +33,12 @@ return y; if (ix == 0) { /* x == 0? */ - float u; +// glibc 2.4 does not seem to set underflow? +// float u; /* return +-minsubnormal */ SET_FLOAT_WORD(x, (hy & 0x80000000) | 1); - u = math_opt_barrier(x); - u = u * u; - math_force_eval(u); /* raise underflow flag */ +// u = x * x; /* raise underflow flag */ +// math_force_eval(u); return x; } @@ -63,8 +58,6 @@ hy = hx & 0x7f800000; if (hy >= 0x7f800000) { x = x + x; /* overflow */ -//?? if (FLT_EVAL_METHOD != 0) -// asm ("" : "+m"(x)); return x; /* overflow */ } if (hy < 0x00800000) { Index: libm/math_private.h =================================================================== --- libm/math_private.h (revision 25261) +++ libm/math_private.h (revision 25262) @@ -187,4 +187,59 @@ extern double __kernel_tan (double,double,int) attribute_hidden; extern int __kernel_rem_pio2 (double*,double*,int,int,int,const int*) attribute_hidden; +/* + * math_opt_barrier(x): force expression x to be evaluated and put into + * a floating point register or memory. This macro returns the value. + * + * math_force_eval(x): force expression x to be evaluated and put into + * a floating point register or memory *of the appropriate size*. + * This forces floating point flags to be set correctly + * (for example, when float value is overflowing, but FPU registers + * are wide enough to "hide" this). + */ +#if defined(__i386__) +#define math_opt_barrier(x) ({ \ + __typeof(x) __x = (x); \ + /* "t": load x into top-of-stack fpreg */ \ + __asm ("" : "=t" (__x) : "0" (__x)); \ + __x; \ +}) +#define math_force_eval(x) do { \ + if (sizeof(x) <= sizeof(double)) \ + /* "m": store x into a memory location */ \ + __asm __volatile ("" : : "m" (x)); \ + else /* long double */ \ + /* "f": load x into (any) fpreg */ \ + __asm __volatile ("" : : "f" (x)); \ +} while (0) +#endif + +#if defined(__x86_64__) +#define math_opt_barrier(x) ({ \ + __typeof(x) __x = (x); \ + if (sizeof(x) <= sizeof(double)) \ + /* "x": load into XMM SSE register */ \ + __asm ("" : "=x" (__x) : "0" (__x)); \ + else /* long double */ \ + /* "t": load x into top-of-stack fpreg */ \ + __asm ("" : "=t" (__x) : "0" (__x)); \ + __x; \ +}) +#define math_force_eval(x) do { \ + if (sizeof(x) <= sizeof(double)) \ + /* "x": load into XMM SSE register */ \ + __asm __volatile ("" : : "x" (x)); \ + else /* long double */ \ + /* "f": load x into (any) fpreg */ \ + __asm __volatile ("" : : "f" (x)); \ +} while (0) +#endif + +/* Default implementation forces store to a memory location */ +#ifndef math_opt_barrier +#define math_opt_barrier(x) ({ __typeof(x) __x = (x); __asm ("" : "+m" (__x)); __x; }) +#define math_force_eval(x) __asm __volatile ("" : : "m" (x)) +#endif + + #endif /* _MATH_PRIVATE_H_ */ Index: docs/probe_math_exception.c =================================================================== --- docs/probe_math_exception.c (revision 0) +++ docs/probe_math_exception.c (revision 25262) @@ -0,0 +1,41 @@ +/* Small test program for probing how various math functions + * with specific operands set floating point exceptions + */ + +#define _ISOC99_SOURCE 1 +#define _GNU_SOURCE 1 + +#include +#include +#include + +int main(int argc, char **argv) +{ + float infF = HUGE_VALF * 2; + + feclearexcept(FE_ALL_EXCEPT); + +// printf("%.40e\n", 1.0 / 0.0); // FE_DIVBYZERO +// printf("%.40e\n", nextafterf(HUGE_VALF, infF)); // no exceptions in glibc 2.4 + +#define PREX(ex) do { if (fetestexcept(ex)) printf(#ex); } while(0) +#ifdef FE_INEXACT + PREX(FE_INEXACT); +#endif +#ifdef FE_DIVBYZERO + PREX(FE_DIVBYZERO); +#endif +#ifdef FE_UNDERFLOW + PREX(FE_UNDERFLOW); +#endif +#ifdef FE_OVERFLOW + PREX(FE_OVERFLOW); +#endif +#ifdef FE_INVALID + PREX(FE_INVALID); +#endif + if (fetestexcept(FE_ALL_EXCEPT)) + printf("\n"); + printf("done\n"); + return 0; +} ------------------------------------------------------------------------ r25257 | vda | 2009-02-05 19:57:15 -0600 (Thu, 05 Feb 2009) | 3 lines Changed paths: A /trunk/uClibc/libm/s_nextafterf.c libm/s_nextafterf.c: forgot to "svn add" it ------------------------------------------------------------------------ Index: libm/s_nextafterf.c =================================================================== --- libm/s_nextafterf.c (revision 0) +++ libm/s_nextafterf.c (revision 25257) @@ -0,0 +1,103 @@ +/* s_nextafterf.c -- float version of s_nextafter.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#include "math.h" +#include "math_private.h" + +#ifndef math_opt_barrier +# define math_opt_barrier(x) ({ __typeof (x) __x = x; __asm ("" : "+m" (__x)); __x; }) +# define math_force_eval(x) __asm __volatile ("" : : "m" (x)) +#endif + +float nextafterf(float x, float y) +{ + int32_t hx, hy, ix, iy; + + GET_FLOAT_WORD(hx, x); + GET_FLOAT_WORD(hy, y); + ix = hx & 0x7fffffff; /* |x| */ + iy = hy & 0x7fffffff; /* |y| */ + + /* x is nan or y is nan? */ + if ((ix > 0x7f800000) || (iy > 0x7f800000)) + return x + y; + + if (x == y) + return y; + + if (ix == 0) { /* x == 0? */ + float u; + /* return +-minsubnormal */ + SET_FLOAT_WORD(x, (hy & 0x80000000) | 1); + u = math_opt_barrier(x); + u = u * u; + math_force_eval(u); /* raise underflow flag */ + return x; + } + + if (hx >= 0) { /* x > 0 */ + if (hx > hy) { /* x > y: x -= ulp */ + hx -= 1; + } else { /* x < y: x += ulp */ + hx += 1; + } + } else { /* x < 0 */ + if (hy >= 0 || hx > hy) { /* x < y: x -= ulp */ + hx -= 1; + } else { /* x > y: x += ulp */ + hx += 1; + } + } + hy = hx & 0x7f800000; + if (hy >= 0x7f800000) { + x = x + x; /* overflow */ +//?? if (FLT_EVAL_METHOD != 0) +// asm ("" : "+m"(x)); + return x; /* overflow */ + } + if (hy < 0x00800000) { + float u = x * x; /* underflow */ + math_force_eval(u); /* raise underflow flag */ + } + SET_FLOAT_WORD(x, hx); + return x; +} + +#if 0 +/* "testprog N a b" + * calculates a = nextafterf(a, b) and prints a as float + * and as raw bytes; repeats it N times. + */ +#include +#include +#include +int main(int argc, char **argv) +{ + int cnt, i; + float a, b; + cnt = atoi(argv[1]); + a = strtod(argv[2], NULL); + b = strtod(argv[3], NULL); + while (cnt-- > 0) { + for (i = 0; i < sizeof(a); i++) { + unsigned char c = ((char*)(&a))[i]; + printf("%x%x", (c >> 4), (c & 0xf)); + } + printf(" %f\n", a); + a = nextafterf(a, b); + } + return 0; +} +#endif ------------------------------------------------------------------------ r25255 | vda | 2009-02-05 19:56:25 -0600 (Thu, 05 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/libm/Makefile.in M /trunk/uClibc/libm/float_wrappers.c fix nextafterf. by Jie Zhang (jie.zhang AT analog.com) ------------------------------------------------------------------------ Index: libm/Makefile.in =================================================================== --- libm/Makefile.in (revision 25254) +++ libm/Makefile.in (revision 25255) @@ -61,7 +61,8 @@ s_asinh.c s_atan.c s_cbrt.c s_ceil.c s_copysign.c s_cos.c \ s_erf.c s_expm1.c s_fabs.c s_finite.c s_floor.c s_frexp.c \ s_ilogb.c s_ldexp.c s_lib_version.c s_lrint.c s_lround.c s_llround.c \ - s_log1p.c s_logb.c s_matherr.c s_modf.c s_nextafter.c s_round.c \ + s_log1p.c s_logb.c s_matherr.c s_modf.c s_nextafter.c \ + s_nextafterf.c s_round.c \ s_rint.c s_scalbn.c s_signgam.c s_significand.c s_sin.c s_tan.c \ s_tanh.c s_trunc.c \ w_cabs.c \ @@ -76,7 +77,7 @@ expm1f.o fabsf.o fdimf.o floorf.o fmaf.o fmaxf.o fminf.o fmodf.o \ frexpf.o hypotf.o ilogbf.o ldexpf.o lgammaf.o llroundf.o log10f.o \ log1pf.o log2f.o logbf.o logf.o lrintf.o lroundf.o modff.o nearbyintf.o \ - nextafterf.o powf.o remainderf.o remquof.o rintf.o roundf.o \ + powf.o remainderf.o remquof.o rintf.o roundf.o \ scalblnf.o scalbnf.o sinf.o sinhf.o sqrtf.o tanf.o tanhf.o \ tgammaf.o truncf.o cargf.o llrintf.o scalbf.o gammaf.o significandf.o Index: libm/float_wrappers.c =================================================================== --- libm/float_wrappers.c (revision 25254) +++ libm/float_wrappers.c (revision 25255) @@ -64,7 +64,6 @@ float logf(float); long lroundf(float); float modff(float, float *); -float nextafterf(float, float); float powf(float, float); float remainderf(float, float); float rintf(float); @@ -409,14 +408,6 @@ #endif -#ifdef L_nextafterf -float nextafterf (float x, float y) -{ - return (float) nextafter( (double)x, (double)y ); -} -#endif - - #ifdef L_nexttowardf float nexttowardf (float x, long double y) { ------------------------------------------------------------------------ r25253 | vda | 2009-02-05 16:40:03 -0600 (Thu, 05 Feb 2009) | 5 lines Changed paths: M /trunk/uClibc/libm/Makefile.in M /trunk/uClibc/libm/float_wrappers.c M /trunk/uClibc/test/Makefile libm: add scalbf, gammaf, significandf wrappers. This makes in possible to enable test/math (not it compiles, but has lots of test failures). ------------------------------------------------------------------------ Index: test/Makefile =================================================================== --- test/Makefile (revision 25252) +++ test/Makefile (revision 25253) @@ -38,7 +38,6 @@ ifeq ($(HAS_NO_THREADS),y) DIRS := $(filter-out pthread,$(DIRS)) endif -DIRS := $(filter-out math,$(DIRS)) test check all: run Index: libm/Makefile.in =================================================================== --- libm/Makefile.in (revision 25252) +++ libm/Makefile.in (revision 25253) @@ -78,7 +78,7 @@ log1pf.o log2f.o logbf.o logf.o lrintf.o lroundf.o modff.o nearbyintf.o \ nextafterf.o powf.o remainderf.o remquof.o rintf.o roundf.o \ scalblnf.o scalbnf.o sinf.o sinhf.o sqrtf.o tanf.o tanhf.o \ - tgammaf.o truncf.o cargf.o llrintf.o + tgammaf.o truncf.o cargf.o llrintf.o scalbf.o gammaf.o significandf.o LD_MOBJ := acoshl.o acosl.o asinhl.o asinl.o atan2l.o atanhl.o atanl.o cargl.o cbrtl.o \ ceill.o copysignl.o coshl.o cosl.o erfcl.o erfl.o exp2l.o expl.o \ Index: libm/float_wrappers.c =================================================================== --- libm/float_wrappers.c (revision 25252) +++ libm/float_wrappers.c (revision 25253) @@ -77,7 +77,6 @@ float tanhf(float); #endif - #ifdef L_acosf float acosf (float x) { @@ -543,3 +542,24 @@ return (float) fma( (double)x, (double)y, (double)z ); } #endif + +#ifdef L_scalbf +float scalbf (float x, float y) +{ + return (float) scalb( (double)x, (double)y ); +} +#endif + +#ifdef L_gammaf +float gammaf (float x) +{ + return (float) gamma( (double)x ); +} +#endif + +#ifdef L_significandf +float significandf (float x) +{ + return (float) significand( (double)x ); +} +#endif ------------------------------------------------------------------------ r25244 | kraj | 2009-02-05 01:50:54 -0600 (Thu, 05 Feb 2009) | 2 lines Changed paths: M /trunk/uClibc/extra/Configs/Config.in Make TLS configure time variable. Enable it along with NPTL. ------------------------------------------------------------------------ Index: extra/Configs/Config.in =================================================================== --- extra/Configs/Config.in (revision 25243) +++ extra/Configs/Config.in (revision 25244) @@ -372,6 +372,16 @@ If your applications require pthreads, answer Y. +config UCLIBC_HAS_TLS + bool "Thread-Local Storage" + depends on UCLIBC_HAS_THREADS + default n + help + If you want to enable TLS support then answer Y. + This is fast an efficient way to store per-thread local data + which is not on stack. It needs __thread support enabled in + gcc. + config PTHREADS_DEBUG_SUPPORT bool "Build pthreads debugging support" default n @@ -407,6 +417,7 @@ bool "Native POSIX Threading (NPTL) Support" depends on UCLIBC_HAS_THREADS default n + select UCLIBC_HAS_TLS help If you want to compile uClibc with NPTL support, then answer Y. ------------------------------------------------------------------------ r25230 | aldot | 2009-02-03 11:38:53 -0600 (Tue, 03 Feb 2009) | 3 lines Changed paths: M /trunk/uClibc/Rules.mak - fix install_headers on hosts where ld does not support gnu hash-style but uClibc is configured to use it. ------------------------------------------------------------------------ Index: Rules.mak =================================================================== --- Rules.mak (revision 25229) +++ Rules.mak (revision 25230) @@ -567,7 +567,9 @@ # Be sure that binutils support it LDFLAGS_GNUHASH:=$(call check_ld,--hash-style=gnu) ifeq ($(LDFLAGS_GNUHASH),) +ifneq ($(filter-out install_headers,$(MAKECMDGOALS)),) $(error Your binutils don't support --hash-style option, while you want to use it) +endif else LDFLAGS_NOSTRIP += -Wl,$(LDFLAGS_GNUHASH) endif ------------------------------------------------------------------------ r25221 | vda | 2009-02-02 08:51:48 -0600 (Mon, 02 Feb 2009) | 6 lines Changed paths: M /trunk/uClibc/libc/sysdeps/linux/i386/bits/kernel_types.h M /trunk/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_types.h M /trunk/uClibc/libm/ldouble_wrappers.c M /trunk/uClibc/test/Rules.mak M /trunk/uClibc/test/math/basic-test.c M /trunk/uClibc/test/unistd/errno.c libm/ldouble_wrappers.c: add libm_hidden_def's to fix testsuite build test/Rules.mak: don't pass target options to host build test/math/basic-test.c: fix test build error patching file test/unistd/errno.c: fix test build warning ------------------------------------------------------------------------ Index: test/math/basic-test.c =================================================================== --- test/math/basic-test.c (revision 25220) +++ test/math/basic-test.c (revision 25221) @@ -17,6 +17,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define _ISOC99_SOURCE + #include #include #include Index: test/Rules.mak =================================================================== --- test/Rules.mak (revision 25220) +++ test/Rules.mak (revision 25221) @@ -86,7 +86,9 @@ CC_INC := -I$(dir $(CC_IPREFIX))include-fixed -I$(CC_IPREFIX) CFLAGS += $(CC_INC) -HOST_CFLAGS += $(XWARNINGS) $(OPTIMIZATION) $(XCOMMON_CFLAGS) +# Can't add $(OPTIMIZATION) here, it may be target-specific. +# Just adding -Os for now. +HOST_CFLAGS += $(XWARNINGS) -Os $(XCOMMON_CFLAGS) LDFLAGS := $(CPU_LDFLAGS) ifeq ($(DODEBUG),y) Index: test/unistd/errno.c =================================================================== --- test/unistd/errno.c (revision 25220) +++ test/unistd/errno.c (revision 25221) @@ -17,7 +17,7 @@ { int r_clone, ret_errno; - r_clone = do_clone(child_fn, NULL, (int) NULL, NULL); + r_clone = do_clone(child_fn, NULL, 0, NULL); ret_errno = errno; if (ret_errno != EINVAL || r_clone != -1) { fprintf(stderr, "clone: res=%d (wanted -1) errno=%d (wanted %d)\n", Index: libm/ldouble_wrappers.c =================================================================== --- libm/ldouble_wrappers.c (revision 25220) +++ libm/ldouble_wrappers.c (revision 25221) @@ -565,6 +565,7 @@ { return __isnan ( (double)x ); } +libm_hidden_def(__isnanl) #endif #ifdef L_isinfl @@ -572,6 +573,7 @@ { return __isinf ( (double)x ); } +libm_hidden_def(__isinfl) #endif #endif Index: libc/sysdeps/linux/i386/bits/kernel_types.h =================================================================== --- libc/sysdeps/linux/i386/bits/kernel_types.h (revision 25220) +++ libc/sysdeps/linux/i386/bits/kernel_types.h (revision 25221) @@ -50,4 +50,4 @@ #endif } __kernel_fsid_t; -#endif /* __ARCH_I386_POSIX_TYPES_H */ +#endif Index: libc/sysdeps/linux/x86_64/bits/kernel_types.h =================================================================== --- libc/sysdeps/linux/x86_64/bits/kernel_types.h (revision 25220) +++ libc/sysdeps/linux/x86_64/bits/kernel_types.h (revision 25221) @@ -50,4 +50,4 @@ #endif } __kernel_fsid_t; -#endif /* _ASM_X86_64_POSIX_TYPES_H */ +#endif ------------------------------------------------------------------------ r25109 | vda | 2009-01-28 17:42:01 -0600 (Wed, 28 Jan 2009) | 3 lines Changed paths: M /trunk/uClibc/libc/sysdeps/linux/common/ppoll.c fix ppoll. we forgot to pass 5th parameter to the syscall ------------------------------------------------------------------------ Index: libc/sysdeps/linux/common/ppoll.c =================================================================== --- libc/sysdeps/linux/common/ppoll.c (revision 25108) +++ libc/sysdeps/linux/common/ppoll.c (revision 25109) @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include @@ -26,24 +27,26 @@ # define __NR___libc_ppoll __NR_ppoll static __always_inline -_syscall4(int, __libc_ppoll, struct pollfd *, fds, - nfds_t, nfds, const struct timespec *, timeout, - const __sigset_t *, sigmask) +_syscall5(int, __libc_ppoll, + struct pollfd *, fds, + nfds_t, nfds, + const struct timespec *, timeout, + const __sigset_t *, sigmask, + size_t, sigsetsize) int -ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, +ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, const __sigset_t *sigmask) { - /* The Linux kernel can in some situations update the timeout value. - We do not want that so use a local variable. */ - struct timespec tval; - if (timeout != NULL) - { - tval = *timeout; - timeout = &tval; - } + /* The Linux kernel can in some situations update the timeout value. + We do not want that so use a local variable. */ + struct timespec tval; + if (timeout != NULL) { + tval = *timeout; + timeout = &tval; + } - return __libc_ppoll(fds, nfds, timeout, sigmask); + return __libc_ppoll(fds, nfds, timeout, sigmask, _NSIG / 8); } libc_hidden_def(ppoll) ------------------------------------------------------------------------ r25108 | vda | 2009-01-28 17:12:43 -0600 (Wed, 28 Jan 2009) | 4 lines Changed paths: M /trunk/uClibc/Makerules M /trunk/uClibc/utils/Makefile.in Partially revent "make utils" fix. This version is less intrusive, but still works! :) ------------------------------------------------------------------------ Index: Makerules =================================================================== --- Makerules (revision 25107) +++ Makerules (revision 25108) @@ -190,9 +190,7 @@ $(CFLAGS_gen.dep) cmd_compile.i = $(cmd_compile.c:-c=-E -dD $(EXTRA_CPPFLAGS)) cmd_compile.s = $(cmd_compile.c:-c=-S) -#vda -###_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep) -cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep) +cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep) cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@)) cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@)) cmd_compile.mi= $(cmd_compile.m:-c=-E -dD $(EXTRA_CPPFLAGS)) Index: utils/Makefile.in =================================================================== --- utils/Makefile.in (revision 25107) +++ utils/Makefile.in (revision 25108) @@ -4,12 +4,15 @@ # # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + # "make utils" flags -# ldconfig,ldd,readelf had also: -# -Wl,-rpath,/lib -# -Wl,--dynamic-linker,/lib/ld-uClibc.so.0 -# -Wl,--hash-style=gnu +CFLAGS-utils := \ + $(SSP_ALL_CFLAGS) \ + -I$(top_srcdir)/$(KERNEL_HEADERS) \ + -DNOT_IN_libc \ + -B$(top_builddir)lib \ + -Wl,-rpath-link,$(top_builddir)lib ifeq ($(UCLIBC_BUILD_PIE),y) CFLAGS-utils-shared := $(PIEFLAG) $(LDPIEFLAG) @@ -24,53 +27,23 @@ ifeq ($(UCLIBC_STATIC_LDCONFIG),y) CFLAGS-ldconfig += -static else -CFLAGS-ldconfig += \ - $(CFLAGS-utils-shared) \ - -Wl,-rpath-link,$(top_builddir)lib +CFLAGS-ldconfig += $(CFLAGS-utils-shared) endif -# Can't just pull in $(CFLAGS), there are bad include paths. -# We want to use "sanitized" headers in LOCAL_INSTALL_PATH. -CFLAGS-ldconfig += \ - $(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) $(OPTIMIZATION) \ - -nostdinc \ - -I $(top_builddir)/$(LOCAL_INSTALL_PATH)/usr/include \ - $(CC_INC) \ - -B$(top_builddir)lib \ CFLAGS-ldd := \ - $(CFLAGS-utils-shared) \ - $(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) $(OPTIMIZATION) \ - -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO) \ - -nostdinc \ -I$(top_srcdir)ldso/include \ - -I$(top_builddir)/$(LOCAL_INSTALL_PATH)/usr/include \ - $(CC_INC) \ - -B$(top_builddir)lib \ - -Wl,-rpath-link,$(top_builddir)lib \ + -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \ + -DUCLIBC_LDSO=$(UCLIBC_LDSO) \ + $(CFLAGS-utils-shared) -CFLAGS-readelf := \ - $(CFLAGS-utils-shared) \ - $(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) $(OPTIMIZATION) \ - -nostdinc \ - -I $(top_builddir)/$(LOCAL_INSTALL_PATH)/usr/include \ - $(CC_INC) \ - -B$(top_builddir)lib \ - -Wl,-rpath-link,$(top_builddir)lib \ +CFLAGS-readelf := $(CFLAGS-utils-shared) -# iconv and locale use non-sanitized headers by just pulling in $(CFLAGS) -CFLAGS-iconv := \ - $(CFLAGS) $(CFLAGS-utils-shared) \ - -DNOT_IN_libc \ +# Need CFLAGS-utils explicitly, because the source file is not located in utils +CFLAGS-iconv := $(CFLAGS-utils) \ + $(CFLAGS-utils-shared) \ -DL_iconv_main \ - -I$(top_srcdir)/$(KERNEL_HEADERS) \ - -B$(top_builddir)lib \ - -Wl,-rpath-link,$(top_builddir)lib \ -CFLAGS-locale := \ - $(CFLAGS) $(CFLAGS-utils-shared) \ - -DNOT_IN_libc \ - -B$(top_builddir)lib \ - -Wl,-rpath-link,$(top_builddir)lib \ +CFLAGS-locale := $(CFLAGS-utils) # "make hostutils" flags @@ -134,14 +107,6 @@ $(utils_OUT)/locale: $(top_srcdir)extra/locale/programs/locale.c | $(libc) $(compile.u) -# Instruct make to install uclibc locally before buiding target utils -$(utils_OBJ): | $(top_builddir)/$(LOCAL_INSTALL_PATH) -$(utils_OUT)/iconv: | $(top_builddir)/$(LOCAL_INSTALL_PATH) -$(utils_OUT)/locale: | $(top_builddir)/$(LOCAL_INSTALL_PATH) - -$(top_builddir)/$(LOCAL_INSTALL_PATH): - $(Q)$(MAKE) -C $(top_builddir) $(LOCAL_INSTALL_PATH) - hostutils: $(hostutils_OBJ) $(hostutils_OBJ): $(utils_OUT)/%.host : $(utils_DIR)/%.c ------------------------------------------------------------------------ r25099 | carmelo | 2009-01-28 09:23:51 -0600 (Wed, 28 Jan 2009) | 5 lines Changed paths: A /trunk/uClibc/libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h A /trunk/uClibc/libpthread/linuxthreads/sysdeps/arm/sysdep.h Added sysdep.h and sysdep-cancel.h for linuxthreads ARM Signed-off-by: Will Wagner ------------------------------------------------------------------------ Index: libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h =================================================================== --- libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h (revision 0) +++ libpthread/linuxthreads/sysdeps/arm/sysdep-cancel.h (revision 25099) @@ -0,0 +1,8 @@ +#include + +/* No multi-thread handling enabled. */ +#define SINGLE_THREAD_P (1) +#define RTLD_SINGLE_THREAD_P (1) +#define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */ +#define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */ +#define LIBC_CANCEL_HANDLED() /* Nothing. */ Index: libpthread/linuxthreads/sysdeps/arm/sysdep.h =================================================================== --- libpthread/linuxthreads/sysdeps/arm/sysdep.h (revision 0) +++ libpthread/linuxthreads/sysdeps/arm/sysdep.h (revision 25099) @@ -0,0 +1,137 @@ +/* Generic asm macros used on many machines. + Copyright (C) 1991,92,93,96,98,2002,2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + 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. */ + +#ifndef C_LABEL + +/* Define a macro we can use to construct the asm name for a C symbol. */ +#ifdef NO_UNDERSCORES +#ifdef __STDC__ +#define C_LABEL(name) name##: +#else +#define C_LABEL(name) name/**/: +#endif +#else +#ifdef __STDC__ +#define C_LABEL(name) _##name##: +#else +#define C_LABEL(name) _/**/name/**/: +#endif +#endif + +#endif + +#ifdef __ASSEMBLER__ +/* Mark the end of function named SYM. This is used on some platforms + to generate correct debugging information. */ +#ifndef END +#define END(sym) +#endif + +#ifndef JUMPTARGET +#define JUMPTARGET(sym) sym +#endif + +/* Makros to generate eh_frame unwind information. */ +# ifdef HAVE_ASM_CFI_DIRECTIVES +# define cfi_startproc .cfi_startproc +# define cfi_endproc .cfi_endproc +# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off +# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg +# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off +# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off +# define cfi_offset(reg, off) .cfi_offset reg, off +# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off +# define cfi_register(r1, r2) .cfi_register r1, r2 +# define cfi_return_column(reg) .cfi_return_column reg +# define cfi_restore(reg) .cfi_restore reg +# define cfi_same_value(reg) .cfi_same_value reg +# define cfi_undefined(reg) .cfi_undefined reg +# define cfi_remember_state .cfi_remember_state +# define cfi_restore_state .cfi_restore_state +# define cfi_window_save .cfi_window_save +# else +# define cfi_startproc +# define cfi_endproc +# define cfi_def_cfa(reg, off) +# define cfi_def_cfa_register(reg) +# define cfi_def_cfa_offset(off) +# define cfi_adjust_cfa_offset(off) +# define cfi_offset(reg, off) +# define cfi_rel_offset(reg, off) +# define cfi_register(r1, r2) +# define cfi_return_column(reg) +# define cfi_restore(reg) +# define cfi_same_value(reg) +# define cfi_undefined(reg) +# define cfi_remember_state +# define cfi_restore_state +# define cfi_window_save +# endif + +#else /* ! ASSEMBLER */ +# ifdef HAVE_ASM_CFI_DIRECTIVES +# define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name) +# define CFI_STRINGIFY2(Name) #Name +# define CFI_STARTPROC ".cfi_startproc" +# define CFI_ENDPROC ".cfi_endproc" +# define CFI_DEF_CFA(reg, off) \ + ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off) +# define CFI_DEF_CFA_REGISTER(reg) \ + ".cfi_def_cfa_register " CFI_STRINGIFY(reg) +# define CFI_DEF_CFA_OFFSET(off) \ + ".cfi_def_cfa_offset " CFI_STRINGIFY(off) +# define CFI_ADJUST_CFA_OFFSET(off) \ + ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off) +# define CFI_OFFSET(reg, off) \ + ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off) +# define CFI_REL_OFFSET(reg, off) \ + ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off) +# define CFI_REGISTER(r1, r2) \ + ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2) +# define CFI_RETURN_COLUMN(reg) \ + ".cfi_return_column " CFI_STRINGIFY(reg) +# define CFI_RESTORE(reg) \ + ".cfi_restore " CFI_STRINGIFY(reg) +# define CFI_UNDEFINED(reg) \ + ".cfi_undefined " CFI_STRINGIFY(reg) +# define CFI_REMEMBER_STATE \ + ".cfi_remember_state" +# define CFI_RESTORE_STATE \ + ".cfi_restore_state" +# define CFI_WINDOW_SAVE \ + ".cfi_window_save" +# else +# define CFI_STARTPROC +# define CFI_ENDPROC +# define CFI_DEF_CFA(reg, off) +# define CFI_DEF_CFA_REGISTER(reg) +# define CFI_DEF_CFA_OFFSET(off) +# define CFI_ADJUST_CFA_OFFSET(off) +# define CFI_OFFSET(reg, off) +# define CFI_REL_OFFSET(reg, off) +# define CFI_REGISTER(r1, r2) +# define CFI_RETURN_COLUMN(reg) +# define CFI_RESTORE(reg) +# define CFI_UNDEFINED(reg) +# define CFI_REMEMBER_STATE +# define CFI_RESTORE_STATE +# define CFI_WINDOW_SAVE +# endif + +#endif /* __ASSEMBLER__ */ ------------------------------------------------------------------------ r25093 | carmelo | 2009-01-28 07:36:43 -0600 (Wed, 28 Jan 2009) | 6 lines Changed paths: M /trunk/uClibc/ldso/ldso/arm/elfinterp.c M /trunk/uClibc/ldso/ldso/bfin/elfinterp.c M /trunk/uClibc/ldso/ldso/cris/elfinterp.c M /trunk/uClibc/ldso/ldso/frv/elfinterp.c M /trunk/uClibc/ldso/ldso/i386/elfinterp.c M /trunk/uClibc/ldso/ldso/m68k/elfinterp.c M /trunk/uClibc/ldso/ldso/mips/elfinterp.c M /trunk/uClibc/ldso/ldso/powerpc/elfinterp.c M /trunk/uClibc/ldso/ldso/sh/elfinterp.c M /trunk/uClibc/ldso/ldso/sh64/elfinterp.c M /trunk/uClibc/ldso/ldso/sparc/elfinterp.c M /trunk/uClibc/ldso/ldso/x86_64/elfinterp.c M /trunk/uClibc/ldso/ldso/xtensa/elfinterp.c Remove check for the relocation type check in the resolver, from all archs. Signed-off-by: Jiri Olsa ------------------------------------------------------------------------ Index: ldso/ldso/powerpc/elfinterp.c =================================================================== --- ldso/ldso/powerpc/elfinterp.c (revision 25092) +++ ldso/ldso/powerpc/elfinterp.c (revision 25093) @@ -127,13 +127,6 @@ debug_sym(symtab,strtab,symtab_index); debug_reloc(symtab,strtab,this_reloc); -#if defined (__SUPPORT_LD_DEBUG__) - if (unlikely(ELF32_R_TYPE(this_reloc->r_info) != R_PPC_JMP_SLOT)) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump relocation\n", _dl_progname); - _dl_exit(1); - } -#endif - /* Address of dump instruction to fix up */ reloc_addr = (Elf32_Addr *) (tpnt->loadaddr + this_reloc->r_offset); Index: ldso/ldso/arm/elfinterp.c =================================================================== --- ldso/ldso/arm/elfinterp.c (revision 25092) +++ ldso/ldso/arm/elfinterp.c (revision 25093) @@ -44,7 +44,6 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; char *symname; @@ -58,19 +57,12 @@ rel_addr = (ELF_RELOC *) tpnt->dynamic_info[DT_JMPREL]; this_reloc = rel_addr + reloc_entry; - reloc_type = ELF32_R_TYPE(this_reloc->r_info); symtab_index = ELF32_R_SYM(this_reloc->r_info); symtab = (Elf32_Sym *) tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *) tpnt->dynamic_info[DT_STRTAB]; symname = strtab + symtab[symtab_index].st_name; - if (unlikely(reloc_type != R_ARM_JUMP_SLOT)) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", - _dl_progname); - _dl_exit(1); - } - /* Address of jump instruction to fix up */ instr_addr = ((unsigned long) this_reloc->r_offset + (unsigned long) tpnt->loadaddr); Index: ldso/ldso/sh64/elfinterp.c =================================================================== --- ldso/ldso/sh64/elfinterp.c (revision 25092) +++ ldso/ldso/sh64/elfinterp.c (revision 25093) @@ -47,7 +47,6 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; Elf32_Sym *symtab; @@ -61,19 +60,12 @@ rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry); - reloc_type = ELF32_R_TYPE(this_reloc->r_info); symtab_index = ELF32_R_SYM(this_reloc->r_info); symtab = (Elf32_Sym *)(intptr_t)tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *)tpnt->dynamic_info[DT_STRTAB]; symname = strtab + symtab[symtab_index].st_name; - if (unlikely(reloc_type != R_SH_JMP_SLOT)) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump reloc\n", - _dl_progname); - _dl_exit(1); - } - /* Address of jump instruction to fix up */ instr_addr = ((unsigned long)this_reloc->r_offset + (unsigned long)tpnt->loadaddr); Index: ldso/ldso/m68k/elfinterp.c =================================================================== --- ldso/ldso/m68k/elfinterp.c (revision 25092) +++ ldso/ldso/m68k/elfinterp.c (revision 25093) @@ -47,7 +47,6 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; ElfW(Sym) *symtab; @@ -60,19 +59,12 @@ rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; this_reloc = (ELF_RELOC *)(rel_addr + reloc_entry); - reloc_type = ELF_R_TYPE(this_reloc->r_info); symtab_index = ELF_R_SYM(this_reloc->r_info); symtab = (ElfW(Sym) *)tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *)tpnt->dynamic_info[DT_STRTAB]; symname = strtab + symtab[symtab_index].st_name; - if (unlikely(reloc_type != R_68K_JMP_SLOT)) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", - _dl_progname); - _dl_exit(1); - } - /* Address of the jump instruction to fix up. */ instr_addr = (this_reloc->r_offset + tpnt->loadaddr); got_addr = (char **)instr_addr; Index: ldso/ldso/i386/elfinterp.c =================================================================== --- ldso/ldso/i386/elfinterp.c (revision 25092) +++ ldso/ldso/i386/elfinterp.c (revision 25093) @@ -47,7 +47,6 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; Elf32_Sym *symtab; @@ -60,7 +59,6 @@ rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry); - reloc_type = ELF32_R_TYPE(this_reloc->r_info); symtab_index = ELF32_R_SYM(this_reloc->r_info); symtab = (Elf32_Sym *)(intptr_t)tpnt->dynamic_info[DT_SYMTAB]; Index: ldso/ldso/frv/elfinterp.c =================================================================== --- ldso/ldso/frv/elfinterp.c (revision 25092) +++ ldso/ldso/frv/elfinterp.c (revision 25093) @@ -26,7 +26,6 @@ struct funcdesc_value volatile attribute_hidden * _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; Elf32_Sym *symtab; @@ -42,7 +41,6 @@ tpnt->loadaddr); this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry); - reloc_type = ELF32_R_TYPE(this_reloc->r_info); symtab_index = ELF32_R_SYM(this_reloc->r_info); symtab = (Elf32_Sym *)(intptr_t) @@ -51,12 +49,6 @@ strtab = DL_RELOC_ADDR (tpnt->dynamic_info[DT_STRTAB], tpnt->loadaddr); symname= strtab + symtab[symtab_index].st_name; - if (reloc_type != R_FRV_FUNCDESC_VALUE) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", - _dl_progname); - _dl_exit(1); - } - /* Address of GOT entry fix up */ got_entry = (struct funcdesc_value *) DL_RELOC_ADDR (this_reloc->r_offset, tpnt->loadaddr); Index: ldso/ldso/x86_64/elfinterp.c =================================================================== --- ldso/ldso/x86_64/elfinterp.c (revision 25092) +++ ldso/ldso/x86_64/elfinterp.c (revision 25093) @@ -47,7 +47,6 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; ElfW(Sym) *symtab; @@ -60,19 +59,12 @@ rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; this_reloc = (ELF_RELOC *)(rel_addr + reloc_entry); - reloc_type = ELF_R_TYPE(this_reloc->r_info); symtab_index = ELF_R_SYM(this_reloc->r_info); symtab = (ElfW(Sym) *)tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *)tpnt->dynamic_info[DT_STRTAB]; symname = strtab + symtab[symtab_index].st_name; - if (unlikely(reloc_type != R_X86_64_JUMP_SLOT)) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", - _dl_progname); - _dl_exit(1); - } - /* Address of the jump instruction to fix up. */ instr_addr = (this_reloc->r_offset + tpnt->loadaddr); got_addr = (char **)instr_addr; Index: ldso/ldso/cris/elfinterp.c =================================================================== --- ldso/ldso/cris/elfinterp.c (revision 25092) +++ ldso/ldso/cris/elfinterp.c (revision 25093) @@ -41,7 +41,6 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; int symtab_index; char *strtab; char *symname; @@ -55,19 +54,12 @@ rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry); - reloc_type = ELF32_R_TYPE(this_reloc->r_info); symtab_index = ELF32_R_SYM(this_reloc->r_info); symtab = (Elf32_Sym *)(intptr_t)tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *)tpnt->dynamic_info[DT_STRTAB]; symname = strtab + symtab[symtab_index].st_name; - if (unlikely(reloc_type != R_CRIS_JUMP_SLOT)) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", - _dl_progname); - _dl_exit(1); - } - /* Address of the jump instruction to fix up. */ instr_addr = ((unsigned long)this_reloc->r_offset + (unsigned long)tpnt->loadaddr); Index: ldso/ldso/xtensa/elfinterp.c =================================================================== --- ldso/ldso/xtensa/elfinterp.c (revision 25092) +++ ldso/ldso/xtensa/elfinterp.c (revision 25093) @@ -35,7 +35,6 @@ unsigned long _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; Elf32_Sym *symtab; @@ -47,19 +46,12 @@ rel_addr = (char *) tpnt->dynamic_info[DT_JMPREL]; this_reloc = (ELF_RELOC *) (rel_addr + reloc_entry); - reloc_type = ELF32_R_TYPE (this_reloc->r_info); symtab_index = ELF32_R_SYM (this_reloc->r_info); symtab = (Elf32_Sym *) tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *) tpnt->dynamic_info[DT_STRTAB]; symname = strtab + symtab[symtab_index].st_name; - if (unlikely (reloc_type != R_XTENSA_JMP_SLOT)) { - _dl_dprintf (2, "%s: Incorrect relocation type in jump relocations\n", - _dl_progname); - _dl_exit (1); - } - /* Address of the literal to fix up. */ got_addr = (char **) (this_reloc->r_offset + tpnt->loadaddr); Index: ldso/ldso/mips/elfinterp.c =================================================================== --- ldso/ldso/mips/elfinterp.c (revision 25092) +++ ldso/ldso/mips/elfinterp.c (revision 25093) @@ -87,7 +87,6 @@ unsigned long __dl_runtime_pltresolve(struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; Elf32_Sym *symtab; @@ -100,7 +99,6 @@ rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry); - reloc_type = ELF32_R_TYPE(this_reloc->r_info); symtab_index = ELF32_R_SYM(this_reloc->r_info); symtab = (Elf32_Sym *)(intptr_t)tpnt->dynamic_info[DT_SYMTAB]; Index: ldso/ldso/sparc/elfinterp.c =================================================================== --- ldso/ldso/sparc/elfinterp.c (revision 25092) +++ ldso/ldso/sparc/elfinterp.c (revision 25093) @@ -52,7 +52,6 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; ElfW(Sym) *symtab; @@ -70,19 +69,12 @@ reloc_entry = (reloc_entry >> 10) - 0xc; this_reloc = (ELF_RELOC *)(rel_addr + reloc_entry); - reloc_type = ELF_R_TYPE(this_reloc->r_info); symtab_index = ELF_R_SYM(this_reloc->r_info); symtab = (ElfW(Sym) *)tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *)tpnt->dynamic_info[DT_STRTAB]; symname = strtab + symtab[symtab_index].st_name; - if (unlikely(reloc_type != R_SPARC_JMP_SLOT)) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", - _dl_progname); - _dl_exit(1); - } - /* Address of the jump instruction to fix up. */ instr_addr = (this_reloc->r_offset + tpnt->loadaddr); got_addr = (char **)instr_addr; Index: ldso/ldso/sh/elfinterp.c =================================================================== --- ldso/ldso/sh/elfinterp.c (revision 25092) +++ ldso/ldso/sh/elfinterp.c (revision 25093) @@ -45,7 +45,6 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; Elf32_Sym *symtab; @@ -59,19 +58,12 @@ rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry); - reloc_type = ELF32_R_TYPE(this_reloc->r_info); symtab_index = ELF32_R_SYM(this_reloc->r_info); symtab = (Elf32_Sym *)(intptr_t) tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *)tpnt->dynamic_info[DT_STRTAB]; symname = strtab + symtab[symtab_index].st_name; - if (unlikely(reloc_type != R_SH_JMP_SLOT)) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", - _dl_progname); - _dl_exit(1); - } - /* Address of jump instruction to fix up */ instr_addr = (unsigned long) (this_reloc->r_offset + tpnt->loadaddr); got_addr = (char **) instr_addr; Index: ldso/ldso/bfin/elfinterp.c =================================================================== --- ldso/ldso/bfin/elfinterp.c (revision 25092) +++ ldso/ldso/bfin/elfinterp.c (revision 25093) @@ -40,7 +40,6 @@ struct funcdesc_value volatile *__attribute__((__visibility__("hidden"))) _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry) { - int reloc_type; ELF_RELOC *this_reloc; char *strtab; ElfW(Sym) *symtab; @@ -55,19 +54,12 @@ rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry); - reloc_type = ELF_R_TYPE(this_reloc->r_info); symtab_index = ELF_R_SYM(this_reloc->r_info); symtab = (Elf32_Sym *) tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *) tpnt->dynamic_info[DT_STRTAB]; symname= strtab + symtab[symtab_index].st_name; - if (reloc_type != R_BFIN_FUNCDESC_VALUE) { - _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n", - _dl_progname); - _dl_exit(1); - } - /* Address of GOT entry fix up */ got_entry = (struct funcdesc_value *) DL_RELOC_ADDR(tpnt->loadaddr, this_reloc->r_offset); ------------------------------------------------------------------------ r25088 | carmelo | 2009-01-28 07:13:40 -0600 (Wed, 28 Jan 2009) | 6 lines Changed paths: M /trunk/uClibc/test/regex/tst-regex2.c A /trunk/uClibc/test/regex/tst-regex2.dat (from /trunk/uClibc/test/regex/tst-regex2.data:25045) D /trunk/uClibc/test/regex/tst-regex2.data Follow naming convention for tst-regex2 input file. All others are .dat suffix. Signed-off-by: Carmelo Amoroso ------------------------------------------------------------------------ Index: test/regex/tst-regex2.data =================================================================== --- test/regex/tst-regex2.data (revision 25087) +++ test/regex/tst-regex2.data (revision 25088) @@ -1,2176 +0,0 @@ -2002-11-19 Ulrich Drepper - - * intl/localealias.c (read_alias_file): Use only about 400 bytes - of stack space instead of 16k. - -2002-11-18 Wolfram Gloger - - * malloc/arena.c - (ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all2): Do - nothing if not initialized. Bug report from Marcus Brinkmann - . - -2002-11-19 Roland McGrath - - * posix/Versions (libc: GLIBC_2.3.2): Add sched_getaffinity and - sched_setaffinity. - - * configure.in (libc_cv_gcc_dwarf2_unwind_info check): Use libraries - `-lgcc -lgcc_eh -lgcc', not just `-lgcc -lgcc_eh' in link commands for - test leading to libc_cv_gcc_dwarf2_unwind_info=no_registry_needed. - * configure: Regenerated. - -2002-11-19 Ulrich Drepper - - * include/dlfcn.h: __libc_dlopen is now a macro calling - __libc_dlopen_mode with the extra parameter RTLD_LAZY. - (__libc_dlopen_mode): New prototype. - * elf/dl-libc.c (__libc_dlopen_mode): Renamed from __libc_dlopen. Add - new parameter. Store new parameter in mode field of structure passed - to do_dlopen. - (struct do_dlopen_args): Add new field mode. - (do_dlopen): Pass mode from parameter structure to _dl_open. - -2002-11-11 Randolf Chung - - * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h [__USE_FILE_OFFSET64] - (F_GETLK, F_SETLK, F_SETLKW): Define to F_*64 versions. - * sysdeps/unix/sysv/linux/hppa/fcntl.c: New file. - - * sysdeps/hppa/fpu/libm-test-ulps: New file (generated). - - * sysdeps/hppa/Makefile (CFLAGS-rtld.c): New variable. - Set -mdisable-fpregs for this file. - -2002-11-11 Carlos O'Donell - - * sysdeps/unix/sysv/linux/configure.in: - Make 2.4.19 minimum linux kernel for hppa, and add unwind symbols - from gcc-3.0 era for backwards compatibility. - * sysdeps/unix/sysv/linux/configure: Regenerate. - - * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: - Define mcontext_t as a sigcontext. - -2002-11-18 Roland McGrath - - * dlfcn/dlerror.c (fini): New function, __attribute__ ((destructor)). - Free memory in `last_result' if it was used. - - * resolv/nss_dns/dns-network.c (getanswer_r): In BYNAME case, search - all aliases for one that matches the ".IN-ADDR.ARPA" form. - Do the parsing inline instead of copying strings and calling - inet_network, and properly skip all alias names not matching the form. - - * manual/pattern.texi (Variable Substitution): Fix # and ## examples. - -2002-11-17 Ulrich Drepper - - * manual/pattern.texi (Wordexp Example): Fix sample code. - - * sysdeps/unix/sysv/linux/i386/clone.S: Initialize word in the - childs stack which will be loaded into the %esi register. - -2002-11-14 Paul Eggert - - * resolv/nss_dns/dns-network.c (getanswer_r): Check for buffer - overflow when skipping the question part and when unpacking aliases. - -2002-11-15 Roland McGrath - - * math/Makefile (libm-calls): Remove s_copysign, s_isinf, s_isnan, - s_finite, s_modf, s_scalbn, s_frexp, m_ldexp, s_signbit. - Instead add $(calls:s_%=m_%) to get m_* versions of them all. - -2002-11-15 Jakub Jelinek - - * sysdeps/i386/dl-machine.h (elf_machine_rela): Handle R_386_COPY. - * sysdeps/arm/dl-machine.h (elf_machine_rela): Handle R_ARM_COPY. - -2002-11-15 Roland McGrath - - * math/Makefile (libm-calls): Change s_ldexp to m_ldexp. - * Makerules ($(+sysdir_pfx)sysd-rules): Emit pattern rules for m_%.[Sc] - from sysdeps/.../s_%.[Sc] with commands $(+make-include-of-dep). - (+make-include-of-dep): New canned sequence. - - * stdlib/canonicalize.c (__realpath): Check for malloc failure. - From Dmitry V. Levin . - -2002-11-14 Roland McGrath - - * sysdeps/generic/errno.c (__libc_errno): Remove alias. - * inet/herrno.c (__libc_h_errno): Likewise. - * resolv/res_libc.c (__libc_res): Likewise. - [USE___THREAD]: Use this in place of [USE_TLS && HAVE___THREAD]. - (__res_state) [! USE___THREAD]: Don't define as weak. - * csu/Versions: Revert last change. - * resolv/Versions: Revert last change. - - * Makerules ($(common-objpfx)%.make): New pattern rule. - * tls.make.c: New file. - * Makefile (distribute): Add it. - - * sysdeps/generic/errno.c [! USE___THREAD] - [HAVE_ELF && SHARED && DO_VERSIONING] (errno, _errno): Declare these - with compat_symbol so they are not link-time visible. - [! USE___THREAD] (__libc_errno): New alias for errno. - * csu/Versions [!(USE_TLS && HAVE___THREAD)] (libc: GLIBC_PRIVATE): - Add __libc_errno here. - * inet/herrno.c [USE___THREAD]: Use this conditional - in place of [USE_TLS && HAVE___THREAD]. - [! USE___THREAD] [HAVE_ELF && SHARED && DO_VERSIONING] - (h_errno, _h_errno): Declare these with compat_symbol so they are not - link-time visible. - [! USE___THREAD] (__libc_h_errno): New alias for h_errno. - * resolv/res_libc.c [! USE___THREAD] - [HAVE_ELF && SHARED && DO_VERSIONING] (_res): Likewise. - (_res): Use __attribute__ ((section (".bss"))) so we can have an alias. - (__libc_res): Define as alias for _res. - * resolv/Versions [!(USE_TLS && HAVE___THREAD)] (libc: GLIBC_PRIVATE): - Add __libc_h_errno and __libc_res here. - -2002-11-14 Jakub Jelinek - - * csu/Versions (errno): Move STT_TLS symbol to GLIBC_PRIVATE for now. - * resolv/Versions (h_errno, _res): Likewise. - -2002-11-14 Roland McGrath - - * Makerules (%.dynsym): Remove $(objpfx) from target and dep. - (%.symlist): Likewise. - -2002-11-13 Roland McGrath - - * scripts/abilist.awk: New file. - * Makefile (distribute): Add it. - * Makerules ($(objpfx)%.dynsym, $(objpfx)%.symlist): New rules. - (tests): Depend on .symlist file for each $(install-lib.so-versioned). - [$(subdir) = elf] (tests): Depend on libc.symlist. - (generated, common-generated): Add those files. - - * aclocal.m4 (LIBC_PROG_BINUTILS): Check for objdump, set OBJDUMP. - * configure: Regenerated. - * config.make.in (OBJDUMP): New variable, substituted by configure. - - * malloc/mcheck.c (struct hdr): New members `block' and `magic2'. - (mallochook, reallochook): Set them up. - (checkhdr): Check HDR->magic2 value. - (freehook): Reset HDR->magic2. - (memalignhook): New static function. - (old_memalign_hook): New static variable. - (mcheck, reallochook): Set __memalign_hook to memalignhook. - - * sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage): Zero the space - for the new TCB. - -2002-11-13 Andreas Jaeger - - * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Check for visibility - attribute. - * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. - -2002-11-11 Paul Eggert - - * manual/crypt.texi (Cryptographic Functions): Mention that - the MD5 one-way algorithm is compatible with BSD's. - -2002-11-11 Isamu Hasegawa - - * posix/regex_internal.c (re_string_skip_chars): Also return the last - wide character. - (re_string_reconstruct): Calculate the context by itself when the - offset points out of the valid range. - (re_string_context_at): Use wide character when MB_CUR_MAX > 1. - * posix/regex_internal.h (WIDE_NEWLINE_CHAR): New macro. - (IS_WIDE_WORD_CHAR): New macro. - (IS_WIDE_NEWLINE): New macro. - -2002-11-12 Andreas Jaeger - - * sysdeps/x86_64/strchr.S: Don't use one register for two - purposes, this fixes a bug noticed by test-strchr.c. - - * sysdeps/x86_64/strcat.S: Fix algorithm to align source pointer - correctly. - -2002-11-12 Roland McGrath - - * libio/libioP.h [_LIBC && !SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)] - (_G_IO_NO_BACKWARD_COMPAT): Define it. - - * sysdeps/ia64/dl-fptr.c [_LIBC_REENTRANT]: Include - instead of . - [_LIBC_REENTRANT] (lock, unlock): Use __sync_lock_* macros instead of - testandset. - From Ian Wienand . - -2002-11-10 Roland McGrath - - * libio/bug-wfflush.c (do_test): Call rewind instead of fsetpos. - Call fputs instead of fwprintf (simpler to follow in debugger). - - * crypt/md5-crypt.c: Doc fix. - - * sysdeps/unix/make-syscalls.sh: Insert $(make-target-directory) at - the beginning of generated target commands. - - * csu/Makefile ($(objpfx)crti.o, $(objpfx)crtn.o): Add explicit - dependencies for these in case implicit rule search skipped the - nonexistent source directory. - * sysdeps/gnu/Makefile ($(objpfx)errlist.d): Give this rule all the - files with $(object-suffixes) as targets too. - * Makerules [no_deps && objpfx] (before-compile): Add $(objpfx). - and a target for it using $(make-target-directory). - - * Rules (before-compile): Add $(common-objpfx)bits/stdio-lim.h. - -2002-11-10 Roland McGrath - - * sysdeps/unix/sysv/linux/bits/pthreadtypes.h: Moved to ... - * sysdeps/generic/bits/pthreadtypes.h: ... here. - - * sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Treat a struct flock with - l_start == 0 and l_len == 1 as we do l_len == 0. - -2002-11-10 Ulrich Drepper - - * po/da.po: Update from translation team. - -2002-11-10 Roland McGrath - - * config.make.in (includedir): New variable, substituted by configure. - Reported missing by Jocelyn Fournier . - * Makeconfig (includedir): Use $(prefix), not $(exec_prefix). - -2002-11-10 Andreas Jaeger - - * sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h (enum): Add - REG_OLDMASK and REG_CR2 to synch with kernel header. - (NGREG): Increase. - - * nss/getXXent.c (GETFUNC_NAME): Use union type to avoid strict - aliasing problem. - * nss/getXXbyYY_r.c (INTERNAL): Likewise. - * nss/getnssent_r.c (__nss_getent_r): Likewise. - (__nss_setent): Likewise. - (__nss_getent_r): Likewise. - * inet/getnetgrent_r.c (innetgr): Likewise. - (__internal_setnetgrent_reuse): Likewise. - (internal_getnetgrent_r): Likewise. - * inet/ether_hton.c (ether_hostton): Likewise. - * inet/ether_ntoh.c (ether_ntohost): Likewise. - * sunrpc/netname.c (netname2user): Likewise. - * sunrpc/publickey.c (getpublickey): Likewise. - (getsecretkey): Likewise. - -2002-11-09 Marcus Brinkmann - - * sysdeps/mach/hurd/i386/ioperm.c (ioperm): Correct off by one - error in range calculation. - -2002-10-09 Jakub Jelinek - - * string/test-strspn.c (do_test): Ensure zero termination. - * string/test-strpbrk.c (do_test): Likewise. - * string/test-strncmp.c (stupid_strncmp): Use strnlen, not strlen. - * string/test-strncpy.c (stupid_strncpy): Likewise. - * string/test-stpncpy.c (stupid_stpncpy): Likewise. - -2002-10-08 Roland McGrath - - * string/test-string.h (test_init): Fill BUF1 and BUF2 with - nonzero characters. - -2002-09-22 H.J. Lu - - * sysdeps/unix/sysv/linux/mmap64.c (MMAP2_PAGE_SHIFT): Renamed - from PAGE_SHIFT. Define if not defined. Check MMAP2_PAGE_SHIFT - only if __NR_mmap2 is defined. - - * sysdeps/unix/sysv/linux/powerpc/mmap64.c: Moved to ... - * sysdeps/unix/sysv/linux/mmap64.c: ... here. - * sysdeps/unix/sysv/linux/hppa/mmap64.c: File removed. - * sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c: FIle removed, - -2002-11-08 Jakub Jelinek - - * posix/bug-regex13.c (tests): Add new test. - - * string/test-strchr.c (stupid_strchr): New function. - (do_random_tests): Make sure the string is zero terminated. - * string/test-strpbrk.c (stupid_strpbrk): New function. - (do_random_tests): Make sure the string is zero terminated. - * string/test-strcmp.c (stupid_strcmp): New function. - (do_random_tests): Make sure the strings are zero terminated. - * string/test-strspn.c (stupid_strspn): New function. - (simple_strspn): Rename rej argument to acc. - (do_random_tests): Make sure the string is zero terminated. - * string/test-strcspn.c (stupid_strcspn): New function. - * string/test-strncpy.c (stupid_strncpy): New function. - * string/test-stpncpy.c (stupid_stpncpy): New function. - * string/test-strncmp.c (stupid_strncmp): New function. - (do_random_tests): Make sure the strings are zero terminated. - * string/test-string.h (impl_t): Change test into long. - (IMPL): Add __attribute__((aligned (sizeof (void *)))). - -2002-11-08 Roland McGrath - - * sysdeps/ia64/elf/configure.in: Add TLS check. - From Ian Wienand . - * sysdeps/ia64/elf/configure: Regenerated. - -2002-11-07 Roland McGrath - - * libio/fileops.c (_IO_new_file_overflow): Use INTUSE(_IO_do_write) in - place of _IO_new_do_write. - [_LIBC] (_IO_do_write): Define as macro for _IO_new_do_write and - #undef before versioned_symbol use. - -2002-11-07 Richard Henderson - - * configure.in (ASM_ALPHA_NG_SYMBOL_PREFIX): Remove test. - * configure: Regenerated. - * config.h.in (ASM_ALPHA_NG_SYMBOL_PREFIX): Remove #undef. - * sysdeps/alpha/dl-machine.h (TRAMPOLINE_TEMPLATE): Use !samegp. - (RTLD_START): Likewise. Access _dl_skip_args, _rtld_local, and - _dl_fini via gp-relative relocations. - * sysdeps/alpha/fpu/e_sqrt.c: Use !samegp. - - * elf/tls-macros.h: Add alpha versions. - * sysdeps/alpha/dl-machine.h (elf_machine_rela): Handle TLS relocs. - * sysdeps/unix/alpha/sysdep.S: Support USE___THREAD. - * sysdeps/unix/alpha/sysdep.h: Likewise. Add SYSCALL_ERROR_HANDLER. - * sysdeps/unix/sysv/linux/alpha/brk.S: Use it. - * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/getitimer.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/rt_sigaction.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/select.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/sigsuspend.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise. - * sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise. - - * sysdeps/unix/sysv/linux/alpha/sysdep.h: Re-include protect. - Kill argument registers across the inline syscall. - - * sysdeps/unix/sysv/linux/alpha/clone.S: Add user_tid and tls args. - - * linuxthreads/sysdeps/alpha/tls.h: New file. - * sysdeps/alpha/dl-tls.h: New file. - -2002-10-29 David Mosberger - - * sysdeps/ia64/elf/initfini.c [HAVE_INITFINI_ARRAY] - (gmon_initializer): New function. - (.init prologue): If HAVE_INITFINI_ARRAY is true, don't call - __gmon_start__ here. Call it from gmon_initializer() instead. - -2002-03-12 H.J. Lu - - * elf/Makefile [$(have-initfini-array) = yes] (tests): Add tst-array1, - tst-array2, and tst-array3. - [$(have-initfini-array) = yes] (tests-static): Add tst-array3. - [$(have-initfini-array) = yes] (modules-names): Add tst-array2dep. - ($(objpfx)tst-array1.out): New target. - ($(objpfx)tst-array2): Likewise. - ($(objpfx)tst-array2.out): Likewise. - ($(objpfx)tst-array3.out): Likewise. - * elf/tst-array1.c: New file. - * elf/tst-array1.exp: Likewise. - * elf/tst-array2.c: Likewise. - * elf/tst-array2dep.c: Likewise. - * elf/tst-array2.exp: Likewise. - * elf/tst-array3.c: Likewise. - -2002-10-28 David Mosberger - - * elf/dl-fini.c (_dl_fini): Invoke fini_array in _reverse_ order. - Don't add L->l_addr to array entry values. - -2002-11-07 Jakub Jelinek - - * string/test-string.h: New file. - * string/test-strlen.c: New file. - * string/test-string.h: New file. - * string/test-strcmp.c: New file. - * string/test-strchr.c: New file. - * string/test-strrchr.c: New file. - * string/test-strcpy.c: New file. - * string/test-stpcpy.c: New file. - * string/test-strncpy.c: New file. - * string/test-stpncpy.c: New file. - * string/test-strpbrk.c: New file. - * string/test-strcspn.c: New file. - * string/test-strspn.c: New file. - * string/test-strcat.c: New file. - * string/test-strncmp.c: New file. - * string/test-memchr.c: New file. - * string/test-memcmp.c: New file. - * string/test-memset.c: New file. - * string/test-memcpy.c: New file. - * string/test-mempcpy.c: New file. - * string/test-memmove.c: New file. - * string/Makefile (strop-tests): New variable. - (tests): Add strop-tests. - (distribute): Add test-string.h. - -2002-11-06 Ulrich Drepper - - * posix/regcomp.c: Use tabs instead of spaces. - * posix/regexec.c: Likewise. - * posix/regex_internal.h: Likewise. - - * posix/regcomp.c (re_compile_fastmap_iter): Use __wcrtomb not wctomb. - -2002-11-06 Jakub Jelinek - - * posix/regcomp.c (re_compile_pattern): Don't set regs_allocated - here. - (regcomp): Don't set can_be_null here. - (re_comp): Clear whole re_comp_buf with the exception of fastmap. - (re_compile_internal): Clear can_be_null, set regs_allocated. - - * posix/regcomp.c (re_set_fastmap): New function. - (re_compile_fastmap_iter): Use it. Remove redundant type == - COMPLEX_BRACKET check. - * posix/regexec.c (re_search_internal): Optimize searching with - fastmap. Call re_string_reconstruct even if match_first is - smaller than raw_mbs_idx. - -2002-11-06 Isamu Hasegawa - - * posix/regcomp (free_dfa_content): Use free_state. - * posix/regex_internal.c (re_string_realloc_buffers): Don't edit - pointers in case that realloc failed. - (re_node_set_merge): Likewise. - (register_state): Likewise. - (create_newstate_common): Invoke memory release functions in case of - error conditions. - (create_ci_newstate): Likewise. - (create_cd_newstate): Likewise. - (free_state): New function. - * posix/regexec.c (re_search_internal): Invoke memory release - functions in case of error conditions. - (sift_states_backward): Likewise. - (merge_state_array): Likewise. - (add_epsilon_src_nodes): Likewise. - (sub_epsilon_src_nodes): Likewise. - (search_subexp): Likewise. - (sift_states_bkref): Likewise. - (transit_state_sb): Likewise. - (transit_state_mb): Likewise. - (transit_state_bkref_loop): Likewise. - (group_nodes_into_DFAstates): Likewise. - (push_fail_stack): Don't edit pointers in case that realloc failed. - (extend_buffers): Likewise. - (match_ctx_add_entry): Likewise. - -2002-11-06 Roland McGrath - - * sysdeps/unix/sysv/linux/mips/configure.in: File removed. - * sysdeps/unix/sysv/linux/mips/configure: Likewise. - - * configure.in: Add checks on as and ld for binutils 2.13 or later. - * configure: Regenerated. - -2002-11-06 Ulrich Drepper - - * posix/regcomp.c (regcomp): __re_compile_fastmap can never fail. - If re_compile_internal failed free fastmap buffer. - (free_dfa_content): Broken out of regfree function. Frees all dfa - related data. - (regfree): Add free_dfa_content. - (re_compile_internal): If any of the called functions fails free - all dfa related memory. - -2002-11-05 Ulrich Drepper - - * sysdeps/unix/sysv/linux/sys/sysctl.h: Add ugly hacks to prevent - warnings from the kernel headers. - -2002-11-05 Roland McGrath - - * sysdeps/unix/mips/sysdep.h [! __PIC__] (PSEUDO): Add nop after jump. - From Johannes Stezenbach . - - * sysdeps/unix/sysv/linux/mips/Versions (libc: GLIBC_2.0): Change - #errlist-compat magic comment to give 123 as size. - (libc: GLIBC_2.1): Remove this set, moving #errlist-compat magic to ... - (libc: GLIBC_2.2): ... here. - (libc: GLIBC_2.3): Likewise. - -2002-11-05 Ulrich Drepper - - * elf/dl-fini.c (_dl_fini): Correct the increment of l_opencount - which happens at the beginning so that we can unload modules in - __libc_freeres. - -2002-11-06 Kaz Kojima - - * sysdeps/sh/bits/setjmp.h (JB_SIZE): Define only - under [__USE_MISC || _ASM]. - - * elf/elf.h: Remove the obsolete SH TLS relocations. - -2002-11-05 Ulrich Drepper - - * posix/regcomp.c (regcomp): Initialize preg->can_be_null to zero. - -2002-11-05 Franz Sirl - - * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Handle - __NR_pread64 and __NR_pwrite64. - * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise. - * sysdeps/unix/sysv/linux/powerpc/pread.c: Remove __NR_pread64 - and __NR_pwrite64. - Revert change to use INLINE_SYSCALL. - * sysdeps/unix/sysv/linux/powerpc/pread64.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/pwrite.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/pwrite64.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/ftruncate64.c: Revert change to use - INLINE_SYSCALL. - * sysdeps/unix/sysv/linux/powerpc/truncate64.c: Likewise. - - * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INLINE_SYSCALL): - Update clobber list and add a comment about the syscall ABI. - - * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (s_pread64, - s_pwrite64, s_ftruncate, s_truncate): Re-add. - -2002-11-05 Jakub Jelinek - - * iconv/gconv_dl.c (free_mem): Clear loaded. - * locale/loadarchive.c (_nl_archive_subfreeres): Call locale_data's - cleanup if any. - -2002-11-05 Ulrich Drepper - - * sysdeps/unix/sysv/linux/fexecve.c: Include . - - * libio/ioseekoff.c: Remove INTDEF. Define _IO_seekoff_unlocked. Same - as old code without locking. _IO_seekoff calls this function after - locking the stream. - * libio/ioseekpos.c: Likewise for _IO_seekpos. - * libio/libioP.h: Replace _IO_seekoff_internal and _IO_seekpos_internal - prototypes with _IO_seekoff_unlocked and _IO_seekpos_unlocked - prototypes. - * libio/iolibio.h (_IO_fseek): Call _IO_seekoff_unlocked instead - of _IO_seekoff_internal. - (_IO_rewind): Likewise. - * libio/ioftell.c: Likewise. - * libio/ftello.c: Likewise. - * libio/ftello64.c: Likewise. - * libio/iofgetpos.c: Likewise. - * libio/iofgetpos64.c: Likewise. - * libio/oldiofgetpos.c: Likewise. - * libio/oldiofgetpos64.c: Likewise. - * libio/iofsetpos.c: Call _IO_seekpos_unlocked instead of - _IO_seekpos_internal. - * libio/iofsetpos64.c: Likewise. - * libio/oldiofsetpos.c: Likewise. - * libio/oldiofsetpos64.c: Likewise. - -2002-11-04 Roland McGrath - - * sysdeps/unix/sysv/linux/powerpc/chown.c: Use INLINE_SYSCALL macro. - * sysdeps/unix/sysv/linux/powerpc/ftruncate64.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/ioctl.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/pread.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/pread64.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/pwrite.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/pwrite64.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/tcgetattr.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/tcsetattr.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/truncate64.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (s_ioctl, - s_chown, s_ftruncate64, s_mmap2, s_pread64, s_pwrite64, s_truncate64, - sys_fstat, sys_lstat, sys_mknod, sys_readv, sys_stat, sys_writev): - Remove these, no longer used. - -2002-11-04 Franz Sirl - - * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (s_ipc, - s_llseek, s_readahead, s_execve, s_fcntl, s_fcntl64, s_fstat64, - s_getcwd, s_getdents, s_getdents64, s_getpmsg, s_getpriority, - s_getrlimit, s_lstat64, s_poll, s_ptrace, s_putpmsg, s_reboot, - s_setrlimit, s_sigaction, s_sigpending, s_sigprocmask, s_sigsuspend, - s_stat64, s_sysctl, s_ugetrlimit, s_ustat, s_vfork): Remove now unused - syscall stubs. - - * sysdeps/unix/sysv/linux/pwrite.c: Fix typo. - * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/pread.c: Handle both __NR_pread64 - and __NR_pread. - * sysdeps/unix/sysv/linux/powerpc/pread64.c: Likewise. - * sysdeps/unix/sysv/linux/powerpc/pwrite.c: Handle both __NR_pwrite64 - and __NR_pwrite. - * sysdeps/unix/sysv/linux/powerpc/pwrite64.c: Likewise. - -2002-11-03 Roland McGrath - - * sysdeps/generic/ldsodefs.h (struct rtld_global): New member - `_dl_tls_static_used'. - * sysdeps/generic/libc-tls.c (_dl_tls_static_used): New variable. - (__libc_setup_tls): Initialize it. Let the initial value of - _dl_tls_static_size indicate some surplus space in the computed value. - * elf/dl-open.c (_dl_tls_static_size): New variable. - * sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): Initialize - _dl_tls_static_used. Add some surplus space into _dl_tls_static_size. - * elf/dl-reloc.c [USE_TLS] (allocate_static_tls): New function. - (CHECK_STATIC_TLS): Use it. - * elf/dl-close.c (_dl_close): Adjust _dl_tls_static_used when the - closed objects occupied a trailing contiguous chunk of static TLS area. - -2002-10-18 Bruno Haible - - * charmaps/ISO_5428: Use Greek characters introduced in Unicode 3.0. - -2002-11-04 Ulrich Drepper - - * libio/wfileops.c (_IO_wfile_seekoff): Don't modify _offset and - _wide_data->_IO_read_end if adjustment can be made in the current - buffer. - - * sysdeps/unix/sysv/linux/fexecve.c: New file. - - * libio/bug-wfflush.c (do_test): Using fseek is not allowed when - wide oriented streams are used. - - * nss/getXXent_r.c (ENDFUNC_NAME): Don't do anything if the - service hasn't been used [PR libc/4744]. - - * include/features.h: Use __STDC_VERSION__ not __STDC_VERSION. - Reported by Miloslav Trmac [PR libc/4766]. - - * manual/examples/dir.c: Don't include . - * manual/examples/select.c: Include for TEMP_FAILURE_RETRY. - Reported by Frédéric Delanoy . - -2002-11-02 H.J. Lu - - * stdio-common/reg-printf.c: Include . - -2002-11-03 Ulrich Drepper - - * sysdeps/generic/libc-tls.c: Define _dl_tls_static_used. - - * po/ca.po: Update from translation team. - * po/es.po: Likewise. - - * sysdeps/generic/segfault.c (catch_segfault): If HAVE_PROC_SELF - is defined write out memory map. - * sysdeps/unix/sysv/linux/segfault.c: New file. - -2002-11-02 Roland McGrath - - * sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): Use union type for - pointers that can alias. - Reported by Daniel Jacobowitz . - - * sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h: New file. - -2002-11-02 Roland McGrath - - * manual/filesys.texi (Reading/Closing Directory): Rewrite readdir_r - description to be clearer and to say that *RESULT is set to ENTRY. - -2002-10-30 Jakub Jelinek - - * posix/regexec.c (build_trtable): Alloca or malloc dests_node and - dests_ch arrays together. Alloca or malloc dest_states, - dest_states_word and dest_states_nl arrays together. Free memory on - error exit. - -2002-10-29 Daniel Jacobowitz - - * crypt/crypt_util.c (__init_des_r): Initialize current_salt - and current_saltbits. - -2002-11-02 Roland McGrath - - * stdio-common/reg-printf.c: Include . - -2002-11-02 H.J. Lu - - * sysdeps/unix/sysv/linux/mips/syscalls.list (s_execve): Set - caller to EXTRA instead of execve. - -2002-11-01 Roland McGrath - - * sysdeps/generic/errno-loc.c [! USE___THREAD]: Use this conditional - in place of [!(USE_TLS && HAVE___THREAD)]. - (__errno_location) [! USE___THREAD]: Define as strong, not weak. - -2002-10-31 Roger Sayle - - * sysdeps/i386/soft-fp/sfp-machine.h (_FP_NANFRAC_Q, _FP_NANSIGN_Q): - New macros. - * sysdeps/x86_64/soft-fp/sfp-machine.h: Likewise. - - * soft-fp/soft-fp.h: Allow sfp-machine.h to define FP_RND_NEAREST - without defining FP_ROUNDMODE. - -2002-10-29 Jakub Jelinek - - * sysdeps/gnu/siglist.c (PTR_SIZE_STR): Remove. - (__old_sys_siglist, __old_sys_sigabbrev): Use strong_alias and - declare_symbol. - * sysdeps/mach/hurd/siglist.h (OLD_SIGLIST_SIZE_STR): Remove. - (OLD_SIGLIST_SIZE): Define. - * sysdeps/unix/sysv/linux/siglist.h (OLD_SIGLIST_SIZE_STR): Remove. - (OLD_SIGLIST_SIZE): Define. - * sysdeps/unix/sysv/linux/arm/siglist.c: Remove. - -2002-11-01 Jakub Jelinek - - * sysdeps/ia64/strncpy.S: Fix recovery code. - -2002-10-30 Jakub Jelinek - - * include/libc-symbols.h (__libc_freeres_fn_section, libc_freeres_fn): - New macros. - * elf/dl-close.c (free_mem): Use libc_freeres_fn macro, remove - text_set_element. - * elf/dl-libc.c (free_mem): Likewise. - * iconv/gconv_conf.c (free_mem): Likewise. - * iconv/gconv_db.c (free_mem): Likewise. - * iconv/gconv_dl.c (free_mem): Likewise. - * iconv/gconv_cache.c (free_mem): Likewise. - * intl/finddomain.c (free_mem): Likewise. - * intl/dcigettext.c (free_mem): Likewise. - * locale/setlocale.c (free_mem): Likewise. - * misc/fstab.c (fstab_free): Likewise. - * nss/nsswitch.c (free_mem): Likewise. - * posix/regcomp.c (free_mem): Likewise. - * resolv/gai_misc.c (free_res): Likewise. - * stdlib/fmtmsg.c (free_mem): Likewise. - * sunrpc/clnt_perr.c (free_mem): Likewise. - * sysdeps/generic/setenv.c (free_mem): Likewise. - * sysdeps/unix/sysv/linux/shm_open.c (freeit): Likewise. - * sysdeps/pthread/aio_misc.c (free_res): Likewise. - * time/tzset.c (free_mem): Likewise. - * malloc/mtrace.c (release_libc_mem): Add __libc_freeres_fn_section. - * locale/loadarchive.c (_nl_archive_subfreeres): Likewise. - * malloc/set-freeres.c (__libc_freeres): Likewise. - - * login/getutent.c: Include stdlib.h instead of stddef.h. - (buffer): Change into pointer to utmp, add libc_freeres_ptr. - (__getutent): Allocate buffer the first time it is run. - * login/getutid.c: Include stdlib.h instead of stddef.h. - (buffer): Change into pointer to utmp, add libc_freeres_ptr. - (__getutid): Allocate buffer the first time it is run. - * login/getutline.c: Include stdlib.h instead of stddef.h. - (buffer): Change into pointer to utmp, add libc_freeres_ptr. - (__getutline): Allocate buffer the first time it is run. - * malloc/mtrace.c (malloc_trace_buffer): Change into char *. - (mtrace): Allocate malloc_trace_buffer. - * resolv/nsap_addr.c (inet_nsap_ntoa): Decrease size of tmpbuf. - * resolv/ns_print.c (ns_sprintrrf): Decrease size of t. - * string/strerror.c: Include libintl.h and errno.h. - (buf): New variable. - (strerror): Only allocate buffer if actually needed (unknown error). - * time/tzfile.c (transitions): Add libc_freeres_ptr. - (freeres): Remove. - -2002-10-25 Jakub Jelinek - - * include/libc-symbols.h (libc_freeres_ptr): New macro. - * malloc/set-freeres.c (__libc_freeres_ptrs): Define using - symbol_set_define. - (__libc_freeres): Free all pointers in that section. - * Makerules (build-shlib): Add $(LDSEDCMD-$(@F:lib%.so=%).so) to sed - commands when creating .lds script. - (LDSEDCMD-c.so): New variable. - * inet/rcmd.c (ahostbuf): Change into char *. Add libc_freeres_ptr. - (rcmd_af): Use strdup to allocate ahostbuf. - * inet/rexec.c (ahostbuf): Change into char *. Add libc_freeres_ptr. - (rexec_af): Use strdup to allocate ahostbuf. - * stdio-common/reg-printf.c (printf_funcs): Remove. - (__printf_arginfo_table): Change into printf_arginfo_function **. - Add libc_freeres_ptr. - (__register_printf_function): Allocate __printf_arginfo_table - and __printf_function_table the first time it is called. - * stdio-common/printf-parse.h (__printf_arginfo_table): Change into - printf_arginfo_function **. - (parse_one_spec): Add __builtin_expect. - * grp/fgetgrent.c (buffer): Add libc_freeres_ptr. - (free_mem): Remove. - * inet/getnetgrent.c (buffer): Add libc_freeres_ptr. - (free_mem): Remove. - * intl/localealias.c (libc_freeres_ptr): Define if !_LIBC. - (string_space, map): Add libc_freeres_ptr. - (free_mem): Remove. - * misc/efgcvt.c (FCVT_BUFPTR): Add libc_freeres_ptr. - (free_mem): Remove. - * misc/mntent.c (getmntent_buffer): Add libc_freeres_ptr. - (free_mem): Remove. - * crypt/md5-crypt.c (libc_freeres_ptr): Define if !_LIBC. - (buffer): Add libc_freeres_ptr. - (free_mem): Remove for _LIBC. - * nss/getXXbyYY.c (buffer): Add libc_freeres_ptr. - (free_mem): Remove. - * nss/getXXent.c (buffer): Add libc_freeres_ptr. - (free_mem): Remove. - * pwd/fgetpwent.c (buffer): Add libc_freeres_ptr. - (free_mem): Remove. - * resolv/res_hconf.c (ifaddrs): Add libc_freeres_ptr. - (free_mem): Remove. - * shadow/fgetspent.c (buffer): Add libc_freeres_ptr. - (free_mem): Remove. - * sysdeps/posix/ttyname.c (getttyname_name): Add libc_freeres_ptr. - (free_mem): Remove. - * sysdeps/unix/sysv/linux/getsysstats.c (mount_proc): Add - libc_freeres_ptr. - (free_mem): Remove. - * sysdeps/unix/sysv/linux/ttyname.c (getttyname_name, ttyname_buf): Add - libc_freeres_ptr. - (free_mem): Remove. - -2002-10-30 Jakub Jelinek - - * malloc/obstack.c [_LIBC] (obstack_free): Change into strong_alias - instead of duplicating the whole function in libc. - -2002-10-31 Roland McGrath - - * sysdeps/i386/bits/byteswap.h [__GNUC__ < 2] (__bswap_32): - Renamed from __bswap_16 (typo fix). Reported by . - -2002-10-30 Jakub Jelinek - - * sysdeps/unix/sysv/linux/Makefile (syscall-%.h): Add -D for each - 32bit-predefine when creating .new32 list and -U for each - 32bit-predefine when creating .new64 list. - * sysdeps/unix/sysv/linux/x86_64/Makefile (32bit-predefine): New. - -2002-10-29 Andreas Schwab - - * sysdeps/generic/allocrtsig.c: Include , not - "testrtsig.h". Reported by Daniel Jacobowitz . - -2002-10-25 Roland McGrath - - * sysdeps/unix/sysv/linux/configure.in: Fix typo in last change. - * sysdeps/unix/sysv/linux/configure: Regenerated. - - * sysdeps/generic/ldsodefs.h: Remove [! SHARED] conditional from - _dl_starting_up decl. - -2002-10-20 H.J. Lu - - * sysdeps/unix/sysv/linux/configure.in: Don't check - /lib/modules/`uname -r`/build/include for kernel headers if - cross compiling. - * sysdeps/unix/sysv/linux/configure: Regenerated. - -2002-10-25 Roland McGrath - - * math/math.h (M_LOG2El): Correct the value. - From Stephen L Moshier . - - * sysdeps/unix/sysv/linux/init-first.c (init): Remove [! SHARED] - conditional from __libc_multiple_libcs access. Remove kludge for weak - symbol access with old compilers we no longer support. - * sysdeps/unix/sysv/aix/init-first.c (init): Likewise. - * sysdeps/generic/libc-start.c (__libc_start_main): Likewise. - -2002-10-25 Roland McGrath - - * sysdeps/posix/sigvec.c [SA_RESETHAND]: Disable wrapper hacks and - implement SV_RESETHAND by translating it to SA_RESETHAND. - -2002-10-23 Alexandre Oliva - - * elf/dl-reloc.c (_dl_reloc_bad_use): Print the full 32-bit relocation - type on ELF64 platforms. - -2002-10-24 Ulrich Drepper - - * elf/elf.h (R_X86_64_GOTTPOFF): Renamed from r_x86_64_GOTTPOFF. - - * elf/elf.h: Define ELF_NOTE_OS_FREEBSD and NT_TASKSTRUCT. - -2002-10-24 Jakub Jelinek - - * elf/dl-misc.c: Include . - (_dl_debug_vdprintf): Only take dl_load_lock if not _dl_starting_up. - - * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL, - INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros. - (INLINE_SYSCALL): Use that. - * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL, - INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros. - (INLINE_SYSCALL): Use that. - * sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL, - INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros. - (INLINE_SYSCALL): Use that. - * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include - dl-sysdep.h. - (SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant. - (__INTERNAL_SYSCALL_STRING): Define. - * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include - dl-sysdep.h. - (SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant. - (__INTERNAL_SYSCALL_STRING): Define. - * sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass - __SYSCALL_STRING to inline_syscall*. - (INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): - New macros. - (inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3, - inline_syscall4, inline_syscall5, inline_syscall6): Add string - argument. - -2002-10-24 Roland McGrath - - * sysdeps/generic/ldsodefs.h (_dl_starting_up): Declare it here. - * sysdeps/unix/sysv/linux/init-first.c: Not here. - * sysdeps/powerpc/elf/libc-start.c: Or here. - * sysdeps/unix/sysv/aix/libc-start.c: Or here. - * sysdeps/unix/sysv/aix/start-libc.c: Or here. - * sysdeps/unix/sysv/aix/init-first.c: Or here. - * sysdeps/generic/libc-start.c: Or here. - * sysdeps/unix/sysv/linux/init-first.c (init): Protect _dl_starting_up - access with [! SHARED]. - * sysdeps/unix/sysv/aix/init-first.c (init): Likewise. - - * libio/bug-wfflush.c: New file. - * libio/Makefile (tests): Add bug-wfflush. - -2002-10-23 Roland McGrath - - * stdio-common/tst-fphex.c: New file. - * stdio-common/Makefile (tests): Add tst-fphex. - * sysdeps/generic/printf_fphex.c (__printf_fphex): Fix initialization - of WNUMEND. Fix counting of decimal point in WIDTH. Print '0' pad - chars always before the value digits. - Reported by James Antill . - -2002-10-24 Jakub Jelinek - - * posix/regcomp.c (re_comp): Call __regfree on re_comp_buf. - (free_mem): New function. - * posix/Makefile (tests): Add bug-regex14. Add bug-regex14-mem - if not cross compiling. - (generated): Add bug-regex14-mem and bug-regex14.mtrace. - (bug-regex14-ENV): Set. - (bug-regex14-mem): New target. - * posix/bug-regex14.c: New file. - -2002-10-23 Roland McGrath - - * elf/Makefile ($(objpfx)librtld.map): Use temporary file for output - target, so we don't touch it when the link fails. - - * libio/ftello.c (ftello): Use _IO_off64_t for type of POS. - Check for the result overflowing off_t and fail with EOVERFLOW. - * libio/ioftell.c (_IO_ftell): Likewise. - * libio/iofgetpos.c (_IO_new_fgetpos): Likewise. - - * login/logwtmp.c (logwtmp): If sizeof ut_tv != sizeof struct timeval, - use a temporary timeval on the stack for gettimeofday and copy it. - * login/logout.c (logout): Likewise. - Reported by Steven Munroe . - - * sysdeps/unix/sysv/linux/bits/statfs.h (struct statfs): - Use __SWORD_TYPE instead of int for member types. - (struct statfs64): Likewise. - * sysdeps/unix/sysv/linux/alpha/bits/statfs.h: New file. - * sysdeps/unix/sysv/linux/s390/bits/statfs.h: New file. - * sysdeps/unix/sysv/linux/ia64/bits/statfs.h: File removed. - * sysdeps/unix/sysv/linux/sparc/bits/statfs.h: File removed. - * sysdeps/unix/sysv/linux/x86_64/bits/statfs.h: File removed. - - * sysdeps/unix/sysv/linux/sparc/bits/statvfs.h: Moved to ... - * sysdeps/unix/sysv/linux/bits/statvfs.h: ... here. - (ST_NODIRATIME): Restore fixed value of 2048. - * sysdeps/unix/sysv/linux/alpha/bits/statvfs.h: File removed. - * sysdeps/unix/sysv/linux/ia64/bits/statvfs.h: File removed. - - Rearranged definitions to reduce duplication. - * sysdeps/generic/bits/types.h: Rewritten, using macros from - and new header . - * posix/Makefile (headers): Add bits/typesizes.h here. - * sysdeps/generic/bits/typesizes.h: New file. - * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h: New file. - * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h: New file. - * sysdeps/mach/hurd/bits/typesizes.h: New file. - * sysdeps/unix/sysv/linux/alpha/bits/types.h: File removed. - * sysdeps/unix/sysv/linux/bits/types.h: File removed. - * sysdeps/unix/sysv/linux/ia64/bits/types.h: File removed. - * sysdeps/unix/sysv/linux/mips/bits/types.h: File removed. - * sysdeps/unix/sysv/linux/s390/bits/types.h: File removed. - * sysdeps/unix/sysv/linux/sparc/bits/types.h: File removed. - * sysdeps/unix/sysv/linux/x86_64/bits/types.h: File removed. - * posix/sys/types.h [__USE_POSIX199506 || __USE_UNIX98]: Include - here, not in . - * signal/signal.h: Likewise. - - * streams/stropts.h: Include . - * streams/Makefile (headers): Add bits/xtitypes.h here. - * sysdeps/generic/bits/xtitypes.h: New file. - * sysdeps/s390/bits/xtitypes.h: New file. - * sysdeps/ia64/bits/xtitypes.h: New file. - * sysdeps/x86_64/bits/xtitypes.h: New file. - - * sysvipc/Makefile (headers): Add bits/ipctypes.h here. - * sysdeps/generic/bits/ipctypes.h: New file. - * sysdeps/mips/bits/ipctypes.h: New file. - * sysdeps/gnu/bits/shm.h: Include . - * sysdeps/gnu/bits/msq.h: Likewise. - * sysvipc/sys/ipc.h: Likewise. - -2002-10-22 Ulrich Drepper - - * elf/dl-load.c (struct filebuf): For buf element to have the - alignment of ElfXX_Ehdr since this is what will be stored in it. - -2002-10-22 Jakub Jelinek - - * locale/programs/locarchive.c (add_alias): Change locrec_offset arg - into pointer to locrec_offset. - (add_locale_to_archive): Adjust callers. Free normalized_name right - before returning, not immediately after add_locale, pass it to - add_alias if not NULL instead of name. Rename second normalized_name - occurence to nnormalized_codeset_name. - - * locale/programs/locarchive.c (enlarge_archive): Make sure - string_size is always a multiple of 4. - Reported by Andreas Schwab . - -2002-10-21 Andreas Schwab - - * sysdeps/unix/sysv/linux/ia64/syscalls.list (s_execve): Set - caller to EXTRA instead of execve, since the latter has a - higher-priority implementation in linuxthreads. - -2002-10-21 Roland McGrath - - * sysdeps/generic/libc-tls.c (__libc_setup_tls): Initialize the static - slotinfo list's len member to the proper size, not just 1. - Initialize static_map.l_tls_initimage. - - * elf/dl-open.c (dl_open_worker): Fix loop searching for - dtv_slotinfo_list element containing new modules' l_tls_modid. - - * elf/tst-tls9.c, elf/tst-tls9-static.c: New files. - * elf/tst-tlsmod5.c, elf/tst-tlsmod6.c: New files. - * elf/Makefile (tests): Add tst-tls9. - (tests-static): Add tst-tls9-static. - (tst-tls9-static-ENV): New variable. - ($(objpfx)tst-tls9-static, $(objpfx)tst-tls9-static.out): New targets. - - * elf/dl-close.c (remove_slotinfo): Remove an assert; the number of - modids used by partially loaded modules being closed can't be known. - -2002-10-21 Isamu Hasegawa - - * posix/Makefile: Add a test case for the bug reported by Aharon - Robbins . - * posix/bug-regex13.c: New file. - * posix/regcomp.c (peek_token_bracket): Skip the byte already read. - -2002-10-21 Ulrich Drepper - - * csu/gmon-start.c: Pretty printing. - -2002-10-19 Art Haas - - * configure.in: Replace AC_CONFIG_HEADER with AC_CONFIG_HEADERS, - add AC_HELP_STRING to all AC_ARG_WITH and AC_ARG_ENABLE macros, - add autoconf quotes to the AC_CONFIG_AUX_DIR macro. - * configure: Regenerated. - -2002-10-19 Roland McGrath - - * configure.in: Call AC_CONFIG_SUBDIRS with empty argument - and then set $subdirs directly, because the new Autoconf breaks - compatibility in every way imaginable and insists on whining - about usage that worked since the dawn of time. - * configure: Regenerated. - - * configure: Regenerated (using Autoconf 2.54). - * sysdeps/alpha/elf/configure: Likewise. - * sysdeps/generic/configure: Likewise. - * sysdeps/i386/elf/configure: Likewise. - * sysdeps/ia64/elf/configure: Likewise. - * sysdeps/mach/hurd/configure: Likewise. - * sysdeps/mach/configure: Likewise. - * sysdeps/unix/configure: Likewise. - * sysdeps/unix/common/configure: Likewise. - * sysdeps/unix/sysv/aix/configure: Likewise. - * sysdeps/unix/sysv/linux/configure: Likewise. - * sysdeps/unix/sysv/linux/mips/configure: Likewise. - * sysdeps/x86_64/elf/configure: Likewise. - - * config.make.in: Nix completely-soft nonsense. - * configure.in: Likewise. Under --without-fp, use nofpu subdirectory - of machine directories instead of fpu subdirectory. - * sysdeps/powerpc/soft-fp/Makefile: Remove cruft added in last change. - * sysdeps/powerpc/nofpu/Makefile: Put it in this new file instead. - * sysdeps/powerpc/soft-fp/sim-full.c: Moved to ... - * sysdeps/powerpc/nofpu/sim-full.c: ... here. - * sysdeps/powerpc/soft-fp/fraiseexcpt.c: Moved to ... - * sysdeps/powerpc/nofpu/fraiseexcpt.c: ... here. - * sysdeps/powerpc/soft-fp/fegetexcept.c: Moved to ... - * sysdeps/powerpc/nofpu/fegetexcept.c: ... here. - * sysdeps/powerpc/soft-fp/fclrexcpt.c: Moved to ... - * sysdeps/powerpc/nofpu/fclrexcpt.c: ... here. - * sysdeps/powerpc/soft-fp/ftestexcept.c: Moved to ... - * sysdeps/powerpc/nofpu/ftestexcept.c: ... here. - * sysdeps/powerpc/soft-fp/fgetexcptflg.c: Moved to ... - * sysdeps/powerpc/nofpu/fgetexcptflg.c: ... here. - * sysdeps/powerpc/soft-fp/fsetexcptflg.c: Moved to ... - * sysdeps/powerpc/nofpu/fsetexcptflg.c: ... here. - * sysdeps/powerpc/soft-fp/fedisblxcpt.c: Moved to ... - * sysdeps/powerpc/nofpu/fedisblxcpt.c: ... here. - * sysdeps/powerpc/soft-fp/feenablxcpt.c: Moved to ... - * sysdeps/powerpc/nofpu/feenablxcpt.c: ... here. - * sysdeps/powerpc/soft-fp/fegetenv.c: Moved to ... - * sysdeps/powerpc/nofpu/fegetenv.c: ... here. - * sysdeps/powerpc/soft-fp/fesetenv.c: Moved to ... - * sysdeps/powerpc/nofpu/fesetenv.c: ... here. - * sysdeps/powerpc/soft-fp/fegetround.c: Moved to ... - * sysdeps/powerpc/nofpu/fegetround.c: ... here. - * sysdeps/powerpc/soft-fp/fesetround.c: Moved to ... - * sysdeps/powerpc/nofpu/fesetround.c: ... here. - * sysdeps/powerpc/soft-fp/feupdateenv.c: Moved to ... - * sysdeps/powerpc/nofpu/feupdateenv.c: ... here. - * sysdeps/powerpc/soft-fp/feholdexcpt.c: Moved to ... - * sysdeps/powerpc/nofpu/feholdexcpt.c: ... here. - * sysdeps/powerpc/soft-fp/fenv_const.c: Moved to ... - * sysdeps/powerpc/nofpu/fenv_const.c: ... here. - * sysdeps/powerpc/soft-fp/libm-test-ulps: Moved to ... - * sysdeps/powerpc/nofpu/libm-test-ulps: ... here. - * sysdeps/powerpc/soft-fp/soft-supp.h: Moved to ... - * sysdeps/powerpc/nofpu/soft-supp.h: ... here. - * sysdeps/powerpc/soft-fp/Versions (libc: GLIBC_2.3.2): Moved to ... - * sysdeps/powerpc/nofpu/Versions: ... here, new file. - -2002-10-19 Bruno Haible - - * sysdeps/unix/bsd/bsd4.4/freebsd/sys/sysmacros.h: New file. - -2002-10-18 Roland McGrath - - * io/Makefile (routines): Add lchmod. - * io/sys/stat.h [__USE_BSD] (lchmod): Declare it. - * sysdeps/generic/lchmod.c: New file. - * sysdeps/mach/hurd/lchmod.c: New file. - * io/Versions (libc: GLIBC_2.3.2): New set, add lchmod. - -2002-10-18 Art Haas - - * configure.in: Remove remaining AC_FD_CC macros, and replace - AC_FD_MSG with AS_MESSAGE_FD. - -2002-10-18 Roland McGrath - - * sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela): Fix - typos: VALUE -> FINALADDR. - - * sysdeps/unix/alpha/sysdep.h (INLINE_SYSCALL, INLINE_SYSCALL1) - (inline_syscall_clobbers, inline_syscall0, inline_syscall1) - (inline_syscall2, inline_syscall3, inline_syscall4, inline_syscall5) - (inline_syscall6): Move these macros ... - * sysdeps/unix/sysv/linux/alpha/sysdep.h: ... to here. - - * configure.in (libc_link_dests, libc_link_sources): Remove these - variables and the AC_LINK_FILES call. - - * sysdeps/powerpc/soft-fp/Versions (libc: GLIBC_2.3.2): Fix last - change to put new symbols here instead of in GLIBC_2.2. - * sysdeps/powerpc/Subdirs: Move this file ... - * sysdeps/powerpc/soft-fp/Subdirs: ... here. - -2002-10-07 Roland McGrath - - * sysdeps/generic/bits/time.h: Replaced with contents of the - sysdeps/unix/sysv/linux/i386/bits/time.h file. All the following - files were identical except for the absence of CLOCK_THREAD_CPUTIME_ID - and CLOCK_PROCESS_CPUTIME_ID in .../linux/bits/time.h; adding these - macros is ok even for architectures that don't now implement them. - * sysdeps/mach/hurd/bits/time.h: File removed. - * sysdeps/unix/sysv/linux/bits/time.h: File removed. - * sysdeps/unix/sysv/linux/i386/bits/time.h: File removed. - * sysdeps/unix/sysv/linux/ia64/bits/time.h: File removed. - * sysdeps/unix/sysv/linux/sparc/bits/time.h: File removed. - * sysdeps/unix/sysv/linux/x86_64/bits/time.h: File removed. - -2002-10-18 Jeff Bailey - - * configure.in: Replace obsolete AC_OUTPUT syntax with - AC_CONFIG_FILES, AC_CONFIG_COMMANDS, and new-type AC_OUTPUT trio. - - * aclocal.m4 (GLIBC_PROVIDES): Add AC_PROVIDEs for - _AS_PATH_SEPARATOR_PREPARE and _AS_TEST_PREPARE. - - * configure.in: Replace AC_FD_CC with AS_MESSAGE_LOG_FD. - * sysdeps/alpha/elf/configure.in: Likewise. - * sysdeps/i386/elf/configure.in: Likewise. - * sysdeps/mach/hurd/configure.in: Likewise. - * sysdeps/x86_64/elf/configure.in: Likewise. - - * configure.in: Use AC_CONFIG_SRCDIR and new AC_INIT syntax. - - * sysdeps/alpha/elf/configure.in: Remove unneeded sinclude statement. - * sysdeps/generic/configure.in: Likewise. - * sysdeps/i386/elf/configure.in: Likewise. - * sysdeps/ia64/elf/configure.in: Likewise. - * sysdeps/mach/configure.in: Likewise. - * sysdeps/mach/hurd/configure.in: Likewise. - * sysdeps/unix/configure.in: Likewise. - * sysdeps/unix/common/configure.in: Likewise. - * sysdeps/unix/sysv/aix/configure.in: Likewise. - * sysdeps/unix/sysv/linux/configure.in: Likewise. - * sysdeps/unix/sysv/linux/mips/configure.in: Likewise. - * sysdeps/x86_64/elf/configure.in: Likewise. - - * aclocal.m4: Use just the bits from AS_INIT that are needed for the - GLIBC_PROVIDES. Use plain comment instead of HEADER-COMMENT so - that it's obvious when extra autoconf machinery is being dragged in. - -2002-10-18 Roland McGrath - - * configure.in: Remove bogus echo included in - 2002-10-08 Aldy Hernandez change. - * configure: Regenerated. - -2002-10-18 Jakub Jelinek - - * sysdeps/unix/sysv/linux/pathconf.h (statfs_link_max): Add inline. - (statfs_filesize_max): New function. - * sysdeps/unix/sysv/linux/linux_fsinfo.h (JFFS_SUPER_MAGIC, - JFFS2_SUPER_MAGIC, JFS_SUPER_MAGIC, NTFS_SUPER_MAGIC, - ROMFS_SUPER_MAGIC, UDF_SUPER_MAGIC): Define. - * sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Use - statfs_filesize_max. - * sysdeps/unix/sysv/linux/pathconf.c (__pathconf): Likewise. - * sysdeps/unix/sysv/linux/alpha/fpathconf.c: Removed. - * sysdeps/unix/sysv/linux/alpha/pathconf.c: Removed. - -2002-10-17 Roland McGrath - - * configure.in (MIG): Just AC_SUBST it here. - * configure: Regenerated. - * sysdeps/mach/configure.in (MIG): Do the AC_CHECK_TOOL here. - Adding final - argument to all AC_CHECK_HEADER uses for .defs files. - * sysdeps/mach/configure: Regenerated. - - * aclocal.m4 (GLIBC_PROVIDES): Add AC_PROVIDE([_AS_TR_SH_PREPARE]) - and AC_PROVIDE([_AS_CR_PREPARE]). - - * aclocal.m4 (GLIBC_PROVIDES): Add AC_PROVIDE([_AS_ECHO_N_PREPARE]). - Remove AC_LANG(C) call, instead just define([_AC_LANG], [C]). - - * elf/dl-support.c: Move _dl_tls_* variables to ... - * sysdeps/generic/libc-tls.c: ... here. - - * elf/dl-close.c (remove_slotinfo): Take new argument. If false, - allow IDX to be one past the current last slotinfo entry. - (_dl_close): Pass IMAP->l_init_called for that parameter. - -2002-10-07 Andreas Schwab - - * aclocal.m4: Fix for autoconf 2.53. - * configure.in: Likewise. Require autoconf 2.53. - -2002-10-08 Richard Henderson - - * soft-fp/op-4.h: Handle carry correctly in - __FP_FRAC_ADD_3, __FP_FRAC_ADD_4, __FP_FRAC_SUB_3, - __FP_FRAC_SUB_4, __FP_FRAC_DEC_3, __FP_FRAC_DEC_4. - * soft-fp/op-common.h: New macros _FP_DIV_MEAT_N_loop. - -2002-10-08 Aldy Hernandez - - * configure.in: Compute completely-soft. - * config.make.in: Make completely-soft available to sub-makes. - * sysdeps/powerpc/soft-fp/Makefile: Add gcc-single-routines and - gcc-double-routines. Add sim-full.c. Add fenv_const and - fe_nomask to libm-support. - * sysdeps/powerpc/soft-fp/sim-full.c: New file. - * sysdeps/powerpc/soft-fp/fraiseexcpt.c: New file. - * sysdeps/powerpc/soft-fp/fegetexcept.c: New file. - * sysdeps/powerpc/soft-fp/fclrexcpt.c: New file. - * sysdeps/powerpc/soft-fp/ftestexcept.c: New file. - * sysdeps/powerpc/soft-fp/fgetexcptflg.c: New file. - * sysdeps/powerpc/soft-fp/fsetexcptflg.c: New file. - * sysdeps/powerpc/soft-fp/fedisblxcpt.c: New file. - * sysdeps/powerpc/soft-fp/feenablxcpt.c: New file. - * sysdeps/powerpc/soft-fp/fegetenv.c: New file. - * sysdeps/powerpc/soft-fp/fesetenv.c: New file. - * sysdeps/powerpc/soft-fp/fegetround.c: New file. - * sysdeps/powerpc/soft-fp/fesetround.c: New file. - * sysdeps/powerpc/soft-fp/feupdateenv.c: New file. - * sysdeps/powerpc/soft-fp/feholdexcpt.c: New file. - * sysdeps/powerpc/soft-fp/fenv_const.c: New file. - * sysdeps/powerpc/soft-fp/libm-test-ulps: New file. - * sysdeps/powerpc/soft-fp/soft-supp.h: New file. - * sysdeps/powerpc/soft-fp/Versions: Add libgcc soft-float - symbols. Add __sim_disabled_exceptions, __sim_exceptions, - __sim_round_mode. - * sysdeps/powerpc/soft-float/Dist: Add sim-full.c, fenv_const.c. - * sysdeps/powerpc/soft-float/sfp-machine.h: Define - FP_HANDLE_EXCEPTIONS. - Define FP_ROUNDMODE. - Redefine FP_* macros to correspond to the FE_* bit positions. - Define FP_DIV_MEAT_S to _FP_DIV_MEAT_1_loop. - Define externs for __sim_exceptions, __sim_disabled_exceptions, - __sim_round_mode, __simulate_exceptions. - * sysdeps/powerpc/fpu/bits/fenv.h: Move file from here... - * sysdeps/powerpc/bits/fenv.h: ...to here. - -2002-10-06 Jakub Jelinek - - * sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela): - Store R_PPC_UADDR32 and R_PPC_UADDR16 one byte at a time. - Use __builtin_expect for R_PPC_ADDR24 overflow check. Fix - R_PPC_ADDR16, R_PPC_UADDR16 and R_PPC_ADDR14* overflow check, use - __builtin_expect. - -2002-10-15 Jakub Jelinek - - * include/resolv.h (__libc_res_nquery, __libc_res_nsearch, - __libc_res_nsend): New prototypes. - * resolv/res_query.c (QUERYSIZE): Define. - (__libc_res_nquery): Renamed from res_nquery. Added answerp - argument. Allocate only QUERYSIZE bytes first, if res_nmkquery - fails use MAXPACKET buffer. Call __libc_res_nsend instead of - res_nsend, pass answerp. - (res_nquery): Changed into wrapper around __libc_res_nquery. - (__libc_res_nsearch): Renamed from res_nsearch. Added answerp - argument. Call __libc_res_nquerydomain and __libc_res_nquery - instead of the non-__libc_ variants, pass them answerp. - (res_nsearch): Changed into wrapper around __libc_res_nsearch. - (__libc_res_nquerydomain): Renamed from res_nquerydomain. - Added answerp argument. Call __libc_res_nquery instead of - res_nquery, pass answerp. - (res_nquerydomain): Changed into wrapper around - __libc_res_nquerydomain. - * resolv/res_send.c: Include sys/ioctl.h. - (MAXPACKET): Define. - (send_vc): Change arguments. Reallocate answer buffer if it is - too small. - (send_dg): Likewise. - (__libc_res_nsend): Renamed from res_nsend. Added ansp argument. - Reallocate answer buffer if it is too small and hooks are in use. - Adjust calls to send_vc and send_dg. - (res_nsend): Changed into wrapper around __libc_res_nsend. - * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Allocate - just 1K answer buffer on the stack, use __libc_res_nsearch instead - of res_nsearch. - (_nss_dns_gethostbyaddr_r): Similarly with __libc_res_nquery. - * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise. - (_nss_dns_getnetbyname_r): Similarly with __libc_res_nsearch. - * resolv/gethnamaddr.c (gethostbyname2): Likewise. - (gethostbyaddr): Similarly with __libc_res_nquery. - * resolv/Versions (libresolv): Export __libc_res_nquery and - __libc_res_nsearch at GLIBC_PRIVATE. - -2002-10-17 Roland McGrath - - * configure.in: Grok --without-__thread and disable HAVE___THREAD. - * configure: Regenerated. - - * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Do CHECK_STATIC_TLS - before performing the reloc, not after. - * sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise. - -2002-10-17 Ulrich Drepper - - * locale/programs/locale.c (write_locales): Use 'm' flag in fopen call. - * locale/programs/linereader.c (lr_open): Likewise. - * locale/programs/charmap-dir.c (charmap_open): Likewise. - * locale/programs/locarchive.c (add_locale_to_archive): Likewise. - -2002-10-17 Isamu Hasegawa - - * posix/bug-regex11.c: Add a test case for the bug reported by - Paolo Bonzini . - * posix/regexec.c (sift_states_bkref): Use correct destination of - the back reference. - -2002-10-17 Roland McGrath - - * elf/dl-load.c (_dl_map_object_from_fd): Don't check DF_STATIC_TLS. - * elf/dl-reloc.c (_dl_relocate_object: CHECK_STATIC_TLS): New macro - to signal error if an IE-model TLS reloc resolved to a dlopen'd module. - * sysdeps/i386/dl-machine.h (elf_machine_rel, elf_machine_rela): - Call it after performing TPOFF relocs. - * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise. - * sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise. - * elf/dl-conflict.c (CHECK_STATIC_TLS): New macro (no-op). - - * elf/dl-close.c (remove_slotinfo): Change asserts so as not to crash - when closing a partially-initialized object. - - * elf/dl-load.c (_dl_map_object_from_fd) [! USE_TLS]: Call lose - instead of _dl_fatal_printf when we see PT_TLS. - - * Makeconfig (CPPFLAGS): Fix last change to use $(libof-$( - - * cppflags-iterator.mk (CPPFLAGS-$(cpp-src)): Variable removed. - instead of += to append, to be sure $(lib) gets expanded at defn time. - (libof-$(cpp-src)): New variable, define this instead. - * extra-lib.mk (cpp-srcs-left): Reduce duplication in include setup. - (lib): Don't use override. - (CPPFLAGS-$(lib)): New variable, put -D's here. - * Makeconfig (CPPFLAGS): Use basename fn for CPPFLAGS-basename. - Also add $(CPPFLAGS-LIB) before the file-specific flags, for each - LIB found by $(libof-*) for basename, target, or source. - * Makerules (CPPFLAGS-nonlib): New variable. - * nscd/Makefile (lib): Set to nonlib when using cppflags-iterator.mk. - * locale/Makefile (lib): Likewise. - * sunrpc/Makefile (lib): Likewise. - - * sysdeps/unix/sysv/linux/fpathconf.c (LINUX_LINK_MAX): Move macro ... - * sysdeps/unix/sysv/linux/linux_fsinfo.h (LINUX_LINK_MAX): ... here. - * sysdeps/unix/sysv/linux/pathconf.h: New file. - (statfs_link_max): New function, guts from fpathconf.c. - * sysdeps/unix/sysv/linux/fpathconf.c: Rewritten using that. - * sysdeps/unix/sysv/linux/pathconf.c (__pathconf): Likewise. - * sysdeps/unix/sysv/linux/alpha/pathconf.c (__pathconf): Rewritten - to use the linux/pathconf.c code by #include rather than duplication. - * sysdeps/unix/sysv/linux/alpha/fpathconf.c (__pathconf): Likewise. - -2002-10-16 Jakub Jelinek - - * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): - Use __libc_errno only for libc itself. - -2002-10-16 Andreas Jaeger - - * sysdeps/x86_64/_mcount.S: Fix off-by-1 error in argument access. - -2002-10-16 Ulrich Drepper - - * sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER): - Use __libc_errno only for libc itself. - -2002-10-15 Roland McGrath - Jakub Jelinek - - * sysdeps/unix/sysv/linux/Makefile - ($(objpfx)syscall-%.h $(objpfx)syscall-%.d): Take code from - sparc/Makefile to produce a bi-arch file as needed. - That's now parameterized by the variable $(64bit-predefine). - Use LC_ALL=C for `comm' commands in that rule. - No longer conditional on [$(no_syscall_list_h)]. - * sysdeps/unix/sysv/linux/sparc/Makefile: Remove replacement rules. - (64bit-predefine): New variable. - * sysdeps/unix/sysv/linux/x86_64/Makefile: Likewise. - * sysdeps/unix/sysv/linux/s390/Makefile: New file. - * sysdeps/unix/sysv/linux/powerpc/Makefile - (64bit-predefine): New variable. - -2002-10-15 Roland McGrath - - * sysdeps/unix/sysv/linux/Makefile - ($(objpfx)syscall-%.h $(objpfx)syscall-%.d) - - * login/utmp-private.h: Declare __libc_utmp_lock. - * sysdeps/unix/getlogin_r.c (getlogin_r): Take __libc_utmp_lock once - and call __libc_utmp_jump_table functions directly, instead of using - __setutent et al. - - * sysdeps/unix/sysv/linux/configure.in: Use case instead of if. - * sysdeps/unix/sysv/linux/configure: Regenerated. - - * sysdeps/gnu/bits/utmp.h: Include . - (struct lastlog) [__WORDSIZE == 64 && __WORDSIZE_COMPAT32]: - Use int32_t for ll_time. - (struct utmp) [__WORDSIZE == 64 && __WORDSIZE_COMPAT32]: - Use int32_t instead of long int for ut_session. - Use an anonymous struct with 32-bit fields for ut_tv. - * sysdeps/gnu/bits/utmpx.h: Include . - (struct utmpx) [__WORDSIZE == 64 && __WORDSIZE_COMPAT32]: Do the same - here as in utmp.h for `struct utmp'. - * sysdeps/unix/sysv/linux/powerpc/bits/utmp.h: File removed. - * sysdeps/unix/sysv/linux/powerpc/bits/utmpx.h: File removed. - * sysdeps/unix/sysv/linux/sparc/bits/utmp.h: File removed. - * sysdeps/unix/sysv/linux/sparc/bits/utmpx.h: File removed. - * sysdeps/unix/sysv/linux/x86_64/bits/utmp.h: File removed. - * sysdeps/unix/sysv/linux/x86_64/bits/utmpx.h: File removed. - - * sysdeps/unix/sysv/linux/bits/resource.h: Replaced with the contents - of the sysdeps/unix/sysv/linux/i386/bits/resource.h file. - All the following files were identical or equivalent to it. - * sysdeps/unix/sysv/linux/i386/bits/resource.h: File removed. - * sysdeps/unix/sysv/linux/arm/bits/resource.h: File removed. - * sysdeps/unix/sysv/linux/cris/bits/resource.h: File removed. - * sysdeps/unix/sysv/linux/hppa/bits/resource.h: File removed. - * sysdeps/unix/sysv/linux/ia64/bits/resource.h: File removed. - * sysdeps/unix/sysv/linux/m68k/bits/resource.h: File removed. - * sysdeps/unix/sysv/linux/powerpc/bits/resource.h: File removed. - * sysdeps/unix/sysv/linux/s390/bits/resource.h: File removed. - * sysdeps/unix/sysv/linux/sh/bits/resource.h: File removed. - * sysdeps/unix/sysv/linux/x86_64/bits/resource.h: File removed. - - * sysdeps/unix/sysv/linux/bits/socket.h (struct msghdr): Use size_t - instead of int for msg_iovlen, instead of socklen_t for msg_controllen. - Other than the previously incorrect sign of msg_iovlen, this is a - no-op on 32-bit platforms. On 64-bit platforms it makes this header - match their layouts as well, so the following are now identical to it. - * sysdeps/unix/sysv/linux/s390/bits/socket.h: File removed. - * sysdeps/unix/sysv/linux/sparc/bits/socket.h: File removed. - * sysdeps/unix/sysv/linux/x86_64/bits/socket.h: File removed. - * sysdeps/unix/sysv/linux/ia64/bits/socket.h: File removed. - * sysdeps/unix/sysv/linux/alpha/bits/socket.h: File removed. - -2002-10-15 Ulrich Drepper - - * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_VFORK_SYSCALL): - Define for 2.4+ kernels. - - * sysdeps/unix/sysv/linux/i386/vfork.S: Optimize for kernels which - are known to have the vfork syscall. Don't confuse the CPUs - branch prediction unit by jumping to the return address. - - * sysdeps/unix/sysv/linux/alpha/fpathconf.c (__fpathconf): Add - support for reiserfs and xfs. - - * sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Add case for - XFS link count. - * sysdeps/unix/sysv/linux/linux_fsinfo.h: Define XFS_SUPER_MAGIC - and XFS_LINK_MAX. - Patch by Eric Sandeen [PR libc/4706]. - -2002-10-16 Jakub Jelinek - - * include/libc-symbols.h (attribute_tls_model_ie): Define. - * include/errno.h (errno): Define to __libc_errno in libc.so. - Add attribute_tls_model_ie. - * include/netdb.h (h_errno): Define to __libc_h_errno in libc.so. - Add attribute_tls_model_ie. - * include/resolv.h (_res): Define to __libc_res in libc.so. Add - attribute_tls_model_ie. - * inet/herrno.c (__libc_h_errno): Add hidden alias to h_errno. - (h_errno): Define. - * resolv/res_libc.c (__libc_res): Add hidden alias to _res. - (_res): Define. - * sysdeps/generic/bits/libc-tsd.h (__libc_tsd_define): Add - attribute_tls_model_ie. - * sysdeps/generic/errno-loc.c (errno): Only undefine if not using - __thread. - * sysdeps/generic/errno.c (__libc_errno): Add hidden alias to errno. - * sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER): Use - __libc_errno in USE___THREAD case. - * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): - Likewise. - * configure.in (HAVE_TLS_MODEL_ATTRIBUTE): Check for - __attribute__((tls_model (""))). - * configure: Rebuilt. - * config.h.in (HAVE_TLS_MODEL_ATTRIBUTE): Add. - -2002-10-15 Ulrich Drepper - - * timezone/asia: Update from tzdata2002d. - * timezone/australasia: Likewise. - * timezone/iso3166.tab: Likewise. - * timezone/southamerica: Likewise. - * timezone/zone-tab: Likewise. - -2002-10-15 Roland McGrath - - * sysdeps/generic/dl-tls.c (_dl_deallocate_tls) [TLS_TCB_AT_TP]: - Adjust TCB pointer before calling free, so we get the whole block. - -2002-10-14 Roland McGrath - - * sysdeps/unix/sysv/linux/x86_64/sigaction.c - [HAVE_HIDDEN && !HAVE_BROKEN_VISIBILITY_ATTRIBUTE]: Declare restore_rt - extern using attribute_hidden instead of static, avoids warning. - -2002-10-09 Jakub Jelinek - - * sysdeps/unix/sysv/linux/configure.in: Use */lib64 for s390x too. - * sysdeps/unix/sysv/linux/configure: Rebuilt. - -2002-10-14 Ulrich Drepper - - * po/sv.po: Update from translation team. - -2002-10-12 H.J. Lu - - * sunrpc/thrsvc.c (PROCQUIT): New. - (struct rpc_arg): New. - (dispatch): Call exit (0) if request->rq_proc == PROCQUIT. - (test_one_call): Take struct rpc_arg * instead of CLIENT *c. - (thread_wrapper): Modified for struct rpc_arg * and call PROCQUIT. - (main): Modified for struct rpc_arg *. - -2002-10-14 Ulrich Drepper - - * dirent/scandir.c: Rearrange code a bit to reduce binary size. - -2002-10-14 Jakub Jelinek - - * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Include tls.h. - (SYSCALL_ERROR_HANDLER): Use RTLD_PRIVATE_ERRNO sequence - in ld.so even if __thread is supported. - -2002-10-13 Jakub Jelinek - - * sysdeps/unix/sysv/linux/arm/profil-counter.h (profil_counter): - Add hack to prevent the compiler from clobbering the signal context. - * sysdeps/unix/sysv/linux/sh/profil-counter.h (profil_counter): - Likewise. - * sysdeps/unix/sysv/linux/x86_64/profil-counter.h (profil_counter): - Likewise. - -2002-10-14 Andreas Jaeger - - * sysdeps/mips/fpu/libm-test-ulps: Regenerated by - Guido Guenther . - -2002-10-14 Ulrich Drepper - - * po/sk.po: Update from translation team. - -2002-09-26 Roland McGrath - - * elf/dl-load.c (_dl_dst_count, _dl_dst_substitute): Handle $LIB - dynamic string tag. - * elf/Makefile ($(objpfx)trusted-dirs.st): Make the output define - DL_DST_LIB based on $(slibdir). - -2002-10-13 Roland McGrath - - * elf/rtld-Rules ($(objpfx)rtld-libc.a): Use $(verbose) in ar command. - - * sysdeps/mach/hurd/getresuid.c: New file. - * sysdeps/mach/hurd/getresgid.c: New file. - * sysdeps/mach/hurd/setresuid.c: New file. - * sysdeps/mach/hurd/setresgid.c: New file. - - * posix/unistd.h [__USE_GNU] (getresuid, getresgid, setresuid, - setresgid): Declare them. - * NEWS: Mention it. - * include/unistd.h - (__getresuid, __getresgid, __setresuid, __setresgid): Declare them, - add libc_hidden_proto. - * posix/Versions (libc: GLIBC_2.3.2): New set. Add - getresuid, getresgid, setresuid, setresgid here. - * Versions.def (libc): Define GLIBC_2.3.2 set. - * sysdeps/generic/getresuid.c (__getresuid): Fix argument types. - Add libc_hidden_def. - * sysdeps/generic/getresgid.c (__getresgid): Likewise. - * sysdeps/generic/setresgid.c: New file. - * sysdeps/generic/setresuid.c: New file. - * sysdeps/unix/sysv/linux/Makefile [$(subdir) = misc] - (sysdep_routines): Don't add getresuid and getresgid here. - * sysdeps/unix/sysv/linux/arm/Makefile [$(subdir) = misc] - (sysdep_routines): Don't add setresuid and setresgid here. - * sysdeps/unix/sysv/linux/cris/Makefile: Likewise. - * sysdeps/unix/sysv/linux/sh/Makefile: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/Makefile: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Likewise. - * sysdeps/unix/sysv/linux/i386/Makefile: Likewise. - * sysdeps/unix/sysv/linux/m68k/Makefile: Likewise. - * posix/Makefile (routines): Add them all here instead. - * sysdeps/unix/sysv/linux/i386/getresuid.c (getresuid): Renamed to - __getresuid. Add libc_hidden_def for that, and weak alias to old name. - * sysdeps/unix/sysv/linux/i386/getresgid.c (getresgid): Renamed to - __getresgid. Add libc_hidden_def for that, and weak alias to old name. - * sysdeps/unix/sysv/linux/i386/setresuid.c: Add libc_hidden_def. - [! __NR_setresuid]: Include generic file. - * sysdeps/unix/sysv/linux/i386/setresgid.c (setresgid): Renamed to - __setresgid. Add libc_hidden_def for that, and weak alias to old name. - [! __NR_setresuid]: Include generic file. - * sysdeps/unix/sysv/linux/syscalls.list (setresuid, setresgid): - Caller is - now, not EXTRA. - * sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list - (setresuid, setresgid, getresuid, getresgid): Likewise. - * sysdeps/unix/sysv/linux/syscalls.list (getresuid, getresgid): - Add these calls here. - * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove them here. - * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise. - * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Likewise. - * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Likewise. - * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Likewise. - * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. - * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. - - * sysdeps/unix/sysv/linux/Makefile [$(subdir) = misc] - (sysdep_routines): Add setfsuid and setfsgid here. - * sysdeps/unix/sysv/linux/arm/Makefile: Not here. - * sysdeps/unix/sysv/linux/sparc/sparc32/Makefile: Likewise. - * sysdeps/unix/sysv/linux/cris/Makefile: Likewise. - * sysdeps/unix/sysv/linux/sh/Makefile: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/Makefile: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Likewise. - * sysdeps/unix/sysv/linux/i386/Makefile: Likewise. - * sysdeps/unix/sysv/linux/m68k/Makefile: Likewise. - - * hurd/errno.c: Renamed to ... - * hurd/errno-loc.c: ... this. - * hurd/Makefile (routines): errno -> errno-loc - -2002-10-13 Ulrich Drepper - - * po/de.po: Update from translation team. - - * MakeTAGS: Add -E flag to xgettext runs. - -2002-10-12 Ulrich Drepper - - * po/fr.po: Update from translation team. - - * sysdeps/posix/system.c: Remove support for old and buggy SCO systems. - Optimize a bit for use in glibc. - -2002-10-12 Roland McGrath - - * stdio-common/tst-rndseek.c (TIMEOUT): Increase to 10 seconds. - Some machines are slow. Guido Guenther has one. - -2002-10-12 Ulrich Drepper - - * po/sv.po: Update from translation team. - -2002-10-11 Isamu Hasegawa - - * posix/regcomp.c (re_compile_fastmap_iter): Remove the handling - OP_CONTEXT_NODE. - (regfree): Likewise. - (create_initial_state): Likewise. - (analyze): Remove the substitutions which became useless. - (calc_first): Likewise. - (calc_epsdest): Use edests of OP_BACK_REF in case that it has - epsilon destination. - (duplicate_node_closure): New function. - (duplicate_node): Remove the handling OP_CONTEXT_NODE. - (calc_inveclosure): Likewise. - (calc_eclosure): Likewise. - (calc_eclosure_iter): Invoke duplicate_node_closure instead of - direct invocation of duplicate_node. - (parse): Don't use comma operator in the return to avoid compiler - warning. - (parse_reg_exp): Likewise. - (parse_branch): Likewise. - (parse_expression): Likewise. - (parse_sub_exp): Likewise. - (parse_dup_op): Likewise. - * posix/regex_internal.c (re_dfa_add_node): Remove the substitutions - which became useless. - (create_ci_newstate): Remove the handling OP_CONTEXT_NODE. - (create_cd_newstate): Likewise. - * posix/regex_internal.h (re_token_type_t): Remove the obsolete type. - (re_token_t): Likewise. - (re_dfa_t): Likewise. - (re_node_set_remove): New macro. - * posix/regexec.c (check_matching): Remove the handling - OP_CONTEXT_NODE. - (check_halt_node_context): Likewise. - (proceed_next_node): Likewise. - (pop_fail_stack): Fix the memory leak. - (set_regs): Likewise. - (free_fail_stack_return): New function. - (sift_states_backward): Fix the memory leak. Remove the handling - OP_CONTEXT_NODE. - (update_cur_sifted_state): Append some if clause to avoid redundant - call. - (sub_epsilon_src_nodes): Use IS_EPSILON_NODE since it might be a - back reference. - (check_dst_limits): Remove the handling OP_CONTEXT_NODE. - (check_subexp_limits): Likewise. - (search_subexp): Likewise. - (sift_states_bkref): Likewise. - (transit_state_mb): Likewise. - (transit_state_bkref_loop): Likewise. - (transit_state_bkref_loop): Likewise. - (group_nodes_into_DFAstates): Likewise. - (check_node_accept): Likewise. - (sift_ctx_init): Add initializing. - -2002-10-12 Ulrich Drepper - - * sysdeps/unix/sysv/linux/i386/sysdep.h (INLINE_SYSCALL): Use - __builtin_expect. - -2002-10-11 Ulrich Drepper - - * elf/dl-load.c (_dl_map_object_from_fd): Remove unnecessarily - duplicated variable c. - - * sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Use INTERNAL_SYSCALL - if possible. - - * sysdeps/unix/sysv/linux/i386/sysdep.h - (INTERNAL_SYSCALL_ERROR_P): New define. - (INTERNAL_SYSCALL_ERRNO): Likewise. - - * sysdeps/unix/sysv/linux/i386/profil-counter.h (profil_counter): - Add hack to prevent the compiler from clobbering the signal context. - -2002-10-11 Roland McGrath - - * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): - Fix typos. - - * sysdeps/generic/dl-lookupcfg.h: Include . - * sysdeps/sh/dl-lookupcfg.h: File removed. - * sysdeps/i386/dl-lookupcfg.h: File removed. - - * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): Add - missing labels and ; from last change. - - * stdio-common/tst-sscanf.c (val_double): Append .0 to large whole - number literals, so they are doubles instead of ints. - -2002-10-09 Roland McGrath - - * sysdeps/generic/bits/libc-tsd.h [USE___THREAD]: Conditional - changed from [USE_TLS && HAVE___THREAD]. - - * sysdeps/i386/dl-machine.h (elf_machine_type_class, elf_machine_rel): - Disable TLS relocs if [RTLD_BOOTSTRAP && !USE___THREAD]. - * sysdeps/x86_64/dl-machine.h - (elf_machine_type_class, elf_machine_rela): Likewise. - * sysdeps/sh/dl-machine.h (elf_machine_type_class, elf_machine_rela): - Likewise. - - * include/link.h (struct link_map): Remove member l_tls_tp_initialized. - * elf/rtld.c (_dl_start_final, dl_main): Don't use it. - (_dl_start): Conditionalize PT_TLS check on [USE___THREAD]. - - * sysdeps/i386/dl-tls.h (__TLS_GET_ADDR): Use ___tls_get_addr_internal - instead of ___tls_get_addr. - (___tls_get_addr_internal): Add attribute_hidden to decl. - - * sysdeps/generic/ldsodefs.h (struct rtld_global): New variable - _dl_error_catch_tsd. - * elf/rtld.c (startup_error_tsd): New function. - (dl_main): Point _dl_error_catch_tsd at that. - * elf/dl-error.c: Don't use libc-tsd.h for DL_ERROR, - use new function pointer instead. - * elf/dl-tsd.c: New file. - * elf/Makefile (routines): Add it. - -2002-10-07 Roland McGrath - - * elf/dl-misc.c (_dl_debug_vdprintf): Use INTERNAL_SYSCALL macro for - writev if it's available. Otherwise if [RTLD_PRIVATE_ERRNO] then - take _dl_load_lock around calling __writev. - - * sysdeps/unix/sysv/linux/i386/sysdep.h (INTERNAL_SYSCALL): New macro. - (INLINE_SYSCALL): Use that. - - * sysdeps/generic/dl-sysdep.h: New file. - * sysdeps/mach/hurd/dl-sysdep.h: New file. - * sysdeps/generic/ldsodefs.h: Include . - * include/errno.h [IS_IN_rtld]: Include to define ... - [RTLD_PRIVATE_ERRNO]: Use a hidden global variable for errno and - access it directly. - * elf/dl-minimal.c (__errno_location): Removed. - * sysdeps/unix/i386/sysdep.S (__syscall_errno) [RTLD_PRIVATE_ERRNO]: - Use GOTOFF access for errno. - * sysdeps/unix/sysv/linux/i386/sysdep.h - [RTLD_PRIVATE_ERRNO] (SYSCALL_ERROR_HANDLER): Likewise. - - * sysdeps/unix/x86_64/sysdep.S (__syscall_errno) [RTLD_PRIVATE_ERRNO]: - Use PC-relative access for errno. - * sysdeps/unix/sysv/linux/x86_64/sysdep.h - [RTLD_PRIVATE_ERRNO] (SYSCALL_ERROR_HANDLER): Likewise. - - * include/tls.h: New file. - (USE___THREAD): New macro. - Define to 1 under [USE_TLS && HAVE___THREAD] and only when compiling - libc or libpthread. - * sysdeps/unix/sysv/linux/i386/sysdep.h [USE___THREAD]: Conditional - changed from [USE_TLS && HAVE___THREAD]. - * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. - * sysdeps/unix/i386/sysdep.S: Likewise. - * sysdeps/unix/x86_64/sysdep.S: Likewise. - * include/errno.h: Likewise. - * include/netdb.h: Likewise. - * include/resolv.h: Likewise. - - * sysdeps/generic/errno.c: New file. - * csu/Makefile (aux): New variable, list errno. - * sysdeps/unix/sysv/linux/i386/sysdep.S (errno, _errno): Remove defns. - * sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/x86_64/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/arm/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/cris/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/hppa/sysdep.c: Likewise. - * sysdeps/unix/sysv/linux/ia64/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/powerpc/sysdep.c: Likewise. - * sysdeps/unix/sysv/linux/sparc/sysdep.S: Likewise. - * sysdeps/unix/sysv/linux/sh/sysdep.S: Likewise. - * sysdeps/unix/alpha/sysdep.S: Likewise. - * sysdeps/generic/start.c: Likewise. - * sysdeps/unix/start.c: Likewise. - * sysdeps/unix/arm/start.c: Likewise. - * sysdeps/unix/bsd/ultrix4/mips/start.S: Likewise. - * sysdeps/unix/sparc/start.c: Likewise. - * sysdeps/unix/sysv/irix4/start.c: Likewise. - * sysdeps/unix/sysv/linux/mips/sysdep.S: File removed. - - * manual/search.texi (Tree Search Function, Hash Search Function): - Mention search.h clearly. - -2002-10-05 Roland McGrath - - * elf/dl-fxstat64.c: File removed. - * elf/dl-xstat64.c: File removed. - * elf/Makefile (rtld-routines): Remove them. - * sysdeps/unix/sysv/linux/xstat64.c: Remove RTLD_STAT64 conditionals. - Instead, use strong_alias instead of versioned_symbol in the - !SHLIB_COMPAT case. - * sysdeps/unix/sysv/linux/fxstat64.c: Likewise. - * sysdeps/unix/sysv/linux/lxstat64.c: Likewise. - - * include/shlib-compat.h - (SHLIB_COMPAT): Require that IS_IN_##lib be defined nonzero. - [! NOT_IN_libc] (IS_IN_libc): Define it. - * cppflags-iterator.mk (CPPFLAGS-$(cpp-src)): Use -Dx=1 not just -Dx. - * elf/Makefile (CPPFLAGS-.os): Likewise. - - * sunrpc/rpc_main.c (main): Don't declare with noreturn attribute. - Return the status instead of calling exit. - - * Makeconfig (CFLAGS): Prepend -std=gnu99. - * Makerules (+make-deps): Use $(CFLAGS) only for .c sources. - Remove superfluous rm command, whose @ plus make bugs hid - all these commands from the make output. - - * include/stubs-prologue.h: New file. Give #error under #ifdef _LIBC. - * Makefile ($(inst_includedir)/gnu/stubs.h): Depend on it. - Use that file's contents instead of literal echo's for the prologue. - * include/features.h: Include unconditionally. - * include/gnu/stubs.h: New file. - -2002-09-30 Roland McGrath - - * elf/rtld-Rules: New file. - * elf/Makefile ($(objpfx)librtld.map, $(objpfx)librtld.mk, - $(objpfx)rtld-libc.a): New targets. - (generated): Add them. - (reloc-link): Remove -o $@ from the variable. - ($(objpfx)dl-allobjs.os): Add -o $@ after $(reloc-link). - (distribute): Add rtld-Rules. - (CPPFLAGS-.os): Define this instead of CFLAGS-.os. - * Makerules ($(+sysdir_pfx)sysd-rules): Emit rules for rtld-% targets. - (common-mostlyclean, common-clean): Clean up rtld-* files. - * sysdeps/unix/make-syscalls.sh: Add rtld-*.os target name to rules. - -2003-05-20 Jakub Jelinek - - * elf/dynamic-link.h (elf_get_dynamic_info): Add temp argument. - If temp != NULL, copy dynamic entries which need relocation to temp - array before relocating. - (DL_RO_DYN_TEMP_CNT): Define. - * elf/dl-load.c (_dl_map_object_from_fd): Adjust caller. - * elf/rtld.c (_dl_start): Likewise. - (dl_main): Likewise. Add dyn_temp static variable. - -2002-10-11 Roland McGrath - - * sysdeps/generic/dl-tls.c (__tls_get_addr): After freeing block in - now-unused dtv slot, reset the slot to TLS_DTV_UNALLOCATED. - - * elf/tls-macros.h [__x86_64__] (TLS_GD): Fix the sequence with the - proper set of no-op insn prefixes. - - * elf/tst-tls8.c (do_test): Use %zd format for l_tls_modid members. - -2002-10-11 Ulrich Drepper - - * sysdeps/unix/sysv/linux/execve.c: Don't try calling - __pthread_kill_other_threads_np. - - * sysdeps/generic/pselect.c: Avoid unnecessary sigprocmask calls. - -2002-10-08 Roland McGrath - - * locale/newlocale.c (__newlocale): If setting all categories to "C", - just return &_nl_C_locobj instead of copying it. - * locale/freelocale.c (__freelocale): Check for &_nl_C_locobj. - * locale/duplocale.c (__duplocale): Likewise. - -2002-10-07 Roland McGrath - - * config.h.in (HAVE_I386_SET_GDT): New #undef. - * sysdeps/mach/configure.in: Define it with new check for i386_set_gdt. - * sysdeps/mach/configure: Regenerated. - -2002-10-06 Franz Sirl - - * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INLINE_SYSCALL): - Add all necessary register outputs for syscall-clobbered registers. - -2002-10-02 David Mosberger - - * sysdeps/ia64/bzero.S: Rewritten by Sverre Jarp to tune for - Itanium 2 (and Itanium). - Fix unwind directives and make it fit in 80 columns. - * sysdeps/ia64/memset.S: Likewise. - * sysdeps/ia64/memcpy.S: Likewise. - Move jump table to .rodata section. - -2002-10-03 Roland McGrath - - * sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Add - clobbers to asm. - -2002-10-10 Andreas Jaeger - - * sysdeps/x86_64/_mcount.S: Restore correct registers. - -2002-10-10 Ulrich Drepper - - * posix/Versions (libc) [GLIBC_PRIVATE]: Add __pselect. - -2002-10-09 Ulrich Drepper - - * sysdeps/generic/ldsodefs.h: Remove attribute_hidden from - _dl_allocate_tls_init. Add rtld_hidden_proto. - * sysdeps/generic/dl-tls.c (_dl_allocate_tls_init): Add - rtld_hidden_def. - * elf/Versions (ld) [GLIBC_PRIVATE]: Add _dl_allocate_tls_init. - - * version.h (VERSION): Bump to 2.3.1. - - * Make-dist: Add back one of the tar invocations removed before. - - * stdlib/Makefile (distribute): Add allocalim.h. - - * sysdeps/generic/bits/libc-tsd.h [!(USE_TLS && HAVE___THREAD)] - (__libc_tsd_address): Use correct variable name. - Patch by Stefan Jones . - - * sysdeps/unix/sysv/linux/ia64/getcontext.S: Add missing ;;. - Reported by edwardsg@sgi.com [PR libc/4678]. - - * Versions.def (libc): Add GLIBC_2.3.1. - (libpthread): Add GLIBC_2.3.1. - - * include/signal.h: Add libc_hidden_proto for __sigwait, __sigwaitinfo, - and __sigtimedwait. - * signal/Versions: Add __sigtimedwait, __sigwait, and __sigwaitinfo. - * sysdeps/unix/sysv/linux/sigtimedwait.c (__sigtimedwait): Add - libc_hidden_def. - * sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Likewise. - * sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise. - - * include/sys/msg.h: Declare __libc_msgrcv and __libc_msgsnd. - * sysdeps/unix/sysv/linux/msgrcv.c (__msgrcv): Rename to __libc_msgrcv - and make old name an alias. - * sysdeps/unix/sysv/linux/msgsnd.c (__msgsnd): Rename to __libc_msgsnd - and make old name an alias. - * sysvipc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_msgrcv and - __libc_msgsnd. - - * include/sys/uio.h: Declare __libc_readv and __libc_writev. - * misc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_readv and - __libc_writev. - * sysdeps/generic/readv.c (__readv): Rename to __libc_readv and make - old name an alias. - * sysdeps/posix/readv.c: Likewise - * sysdeps/unix/sysv/aix/readv.c: Likewise. - * sysdeps/unix/sysv/linux/readv.c: Likewise. - * sysdeps/generic/writev.c (__writev): Rename to __libc_writev and make - old name an alias. - * sysdeps/posix/writev.c: Likewise - * sysdeps/unix/sysv/aix/writev.c: Likewise. - * sysdeps/unix/sysv/linux/writev.c: Likewise. - - * include/sys/wait.h: Declare __waitid. - * posix/Versions (libc) [GLIBC_PRIVATE]: Add __waitid. - * sysdeps/generic/waitid.c (waitid): Rename to __waitid and make old - name an alias. - * sysdeps/posix/waitid.c: Likewise. - * sysdeps/unix/sysv/aix/waitid.c: Likewise. - - * sysdeps/unix/sysv/linux/syscalls.list: Add creat syscall. - -2002-10-07 Jakub Jelinek - - * include/alloca.h (__libc_use_alloca, __libc_alloca_cutoff): New - prototypes. - (__MAX_ALLOCA_CUTOFF): Define. - Include allocalim.h. - * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r, - _nss_dns_gethostbyaddr_r): Use alloca or malloc to allocate - host_buffer depending on __libc_use_alloca. - * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r, - _nss_dns_getnetbyaddr_r): Use alloca or malloc to allocate - net_buffer depending on __libc_use_alloca. - * resolv/res_query.c (res_nquery): Use alloca or malloc to allocate - buf depending on __libc_use_alloca. - * resolv/gethnamaddr.c (gethostbyname2, gethostbyaddr): Likewise. - * stdio-common/vfprintf.c (vfprintf): Use __libc_use_alloca - instead of hardcoded constants. - Pass proper size argument to alloca and compute end for wide char - version. - * stdio-common/printf_fp.c (__printf_fp): Use __libc_use_alloca - instead of hardcoded constants. - * string/strcoll.c (strcoll): Likewise. - * string/strxfrm.c (strxfrm): Likewise. - * sysdeps/posix/readv.c (__readv): Likewise. - * sysdeps/posix/writev.c (__writev): Likewise. - * sysdeps/generic/allocalim.h: New file. - -2002-10-08 Roland McGrath - - * configure.in (aux_missing warning): Change "too old" to - "incompatible versions", since for autoconf it's "too new" right now. - * configure: Regenerated. - - * configure.in (AUTOCONF): New check to set it. Set to "no" if the - one found doesn't work on our configure.in. - * configure: Regenerated. - * config.make.in (AUTOCONF): New substituted variable. - * Makefile (autoconf-it-cvs): New canned sequence, broken out of ... - (autoconf-it): ... here, use that instead of defining conditionally. - Use $(AUTOCONF) instead of literal autoconf. - [$(AUTOCONF) != no] (configure, %/configure): Protect these rules - with this condition. - * Make-dist (autoconf-it, configure, %/configure): Copy those changes. - -2002-10-08 Ulrich Drepper - - * Make-dist (dist): Cleanup a bit. We are not interested in the - 14 char filename limit anymore. Remove intermediate files and - symlinks. - -2002-10-05 Ulrich Drepper - - * po/sk.po: Update from translation team. - * po/tr.po: Likewise. - * po/gl.po: Likewise. - -2002-10-05 Kaz Kojima - - * elf/tls-macros.h: Fix SH version of macros so as to match ABI syntax. - -2002-10-03 Ulrich Drepper - - * version.h (RELEASE): Change to stable. - -2002-10-03 Jakub Jelinek - - * sysdeps/unix/sysv/linux/_exit.c (__syscall_exit, - __syscall_exit_group): New prototypes. - -2002-10-03 Ulrich Drepper - - * glibc 2.3 released. - - -See ChangeLog.13 for earlier changes. Index: test/regex/tst-regex2.c =================================================================== --- test/regex/tst-regex2.c (revision 25087) +++ test/regex/tst-regex2.c (revision 25088) @@ -23,7 +23,7 @@ "((((((((((.?))))))))))Log\\.13" }; char *buf, *string; - const char *fname = "tst-regex2.data"; + const char *fname = "tst-regex2.dat"; struct stat st; unsigned len; int testno; Index: test/regex/tst-regex2.dat =================================================================== --- test/regex/tst-regex2.dat (revision 0) +++ test/regex/tst-regex2.dat (revision 25088) @@ -0,0 +1,2176 @@ +2002-11-19 Ulrich Drepper + + * intl/localealias.c (read_alias_file): Use only about 400 bytes + of stack space instead of 16k. + +2002-11-18 Wolfram Gloger + + * malloc/arena.c + (ptmalloc_lock_all, ptmalloc_unlock_all, ptmalloc_unlock_all2): Do + nothing if not initialized. Bug report from Marcus Brinkmann + . + +2002-11-19 Roland McGrath + + * posix/Versions (libc: GLIBC_2.3.2): Add sched_getaffinity and + sched_setaffinity. + + * configure.in (libc_cv_gcc_dwarf2_unwind_info check): Use libraries + `-lgcc -lgcc_eh -lgcc', not just `-lgcc -lgcc_eh' in link commands for + test leading to libc_cv_gcc_dwarf2_unwind_info=no_registry_needed. + * configure: Regenerated. + +2002-11-19 Ulrich Drepper + + * include/dlfcn.h: __libc_dlopen is now a macro calling + __libc_dlopen_mode with the extra parameter RTLD_LAZY. + (__libc_dlopen_mode): New prototype. + * elf/dl-libc.c (__libc_dlopen_mode): Renamed from __libc_dlopen. Add + new parameter. Store new parameter in mode field of structure passed + to do_dlopen. + (struct do_dlopen_args): Add new field mode. + (do_dlopen): Pass mode from parameter structure to _dl_open. + +2002-11-11 Randolf Chung + + * sysdeps/unix/sysv/linux/hppa/bits/fcntl.h [__USE_FILE_OFFSET64] + (F_GETLK, F_SETLK, F_SETLKW): Define to F_*64 versions. + * sysdeps/unix/sysv/linux/hppa/fcntl.c: New file. + + * sysdeps/hppa/fpu/libm-test-ulps: New file (generated). + + * sysdeps/hppa/Makefile (CFLAGS-rtld.c): New variable. + Set -mdisable-fpregs for this file. + +2002-11-11 Carlos O'Donell + + * sysdeps/unix/sysv/linux/configure.in: + Make 2.4.19 minimum linux kernel for hppa, and add unwind symbols + from gcc-3.0 era for backwards compatibility. + * sysdeps/unix/sysv/linux/configure: Regenerate. + + * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: + Define mcontext_t as a sigcontext. + +2002-11-18 Roland McGrath + + * dlfcn/dlerror.c (fini): New function, __attribute__ ((destructor)). + Free memory in `last_result' if it was used. + + * resolv/nss_dns/dns-network.c (getanswer_r): In BYNAME case, search + all aliases for one that matches the ".IN-ADDR.ARPA" form. + Do the parsing inline instead of copying strings and calling + inet_network, and properly skip all alias names not matching the form. + + * manual/pattern.texi (Variable Substitution): Fix # and ## examples. + +2002-11-17 Ulrich Drepper + + * manual/pattern.texi (Wordexp Example): Fix sample code. + + * sysdeps/unix/sysv/linux/i386/clone.S: Initialize word in the + childs stack which will be loaded into the %esi register. + +2002-11-14 Paul Eggert + + * resolv/nss_dns/dns-network.c (getanswer_r): Check for buffer + overflow when skipping the question part and when unpacking aliases. + +2002-11-15 Roland McGrath + + * math/Makefile (libm-calls): Remove s_copysign, s_isinf, s_isnan, + s_finite, s_modf, s_scalbn, s_frexp, m_ldexp, s_signbit. + Instead add $(calls:s_%=m_%) to get m_* versions of them all. + +2002-11-15 Jakub Jelinek + + * sysdeps/i386/dl-machine.h (elf_machine_rela): Handle R_386_COPY. + * sysdeps/arm/dl-machine.h (elf_machine_rela): Handle R_ARM_COPY. + +2002-11-15 Roland McGrath + + * math/Makefile (libm-calls): Change s_ldexp to m_ldexp. + * Makerules ($(+sysdir_pfx)sysd-rules): Emit pattern rules for m_%.[Sc] + from sysdeps/.../s_%.[Sc] with commands $(+make-include-of-dep). + (+make-include-of-dep): New canned sequence. + + * stdlib/canonicalize.c (__realpath): Check for malloc failure. + From Dmitry V. Levin . + +2002-11-14 Roland McGrath + + * sysdeps/generic/errno.c (__libc_errno): Remove alias. + * inet/herrno.c (__libc_h_errno): Likewise. + * resolv/res_libc.c (__libc_res): Likewise. + [USE___THREAD]: Use this in place of [USE_TLS && HAVE___THREAD]. + (__res_state) [! USE___THREAD]: Don't define as weak. + * csu/Versions: Revert last change. + * resolv/Versions: Revert last change. + + * Makerules ($(common-objpfx)%.make): New pattern rule. + * tls.make.c: New file. + * Makefile (distribute): Add it. + + * sysdeps/generic/errno.c [! USE___THREAD] + [HAVE_ELF && SHARED && DO_VERSIONING] (errno, _errno): Declare these + with compat_symbol so they are not link-time visible. + [! USE___THREAD] (__libc_errno): New alias for errno. + * csu/Versions [!(USE_TLS && HAVE___THREAD)] (libc: GLIBC_PRIVATE): + Add __libc_errno here. + * inet/herrno.c [USE___THREAD]: Use this conditional + in place of [USE_TLS && HAVE___THREAD]. + [! USE___THREAD] [HAVE_ELF && SHARED && DO_VERSIONING] + (h_errno, _h_errno): Declare these with compat_symbol so they are not + link-time visible. + [! USE___THREAD] (__libc_h_errno): New alias for h_errno. + * resolv/res_libc.c [! USE___THREAD] + [HAVE_ELF && SHARED && DO_VERSIONING] (_res): Likewise. + (_res): Use __attribute__ ((section (".bss"))) so we can have an alias. + (__libc_res): Define as alias for _res. + * resolv/Versions [!(USE_TLS && HAVE___THREAD)] (libc: GLIBC_PRIVATE): + Add __libc_h_errno and __libc_res here. + +2002-11-14 Jakub Jelinek + + * csu/Versions (errno): Move STT_TLS symbol to GLIBC_PRIVATE for now. + * resolv/Versions (h_errno, _res): Likewise. + +2002-11-14 Roland McGrath + + * Makerules (%.dynsym): Remove $(objpfx) from target and dep. + (%.symlist): Likewise. + +2002-11-13 Roland McGrath + + * scripts/abilist.awk: New file. + * Makefile (distribute): Add it. + * Makerules ($(objpfx)%.dynsym, $(objpfx)%.symlist): New rules. + (tests): Depend on .symlist file for each $(install-lib.so-versioned). + [$(subdir) = elf] (tests): Depend on libc.symlist. + (generated, common-generated): Add those files. + + * aclocal.m4 (LIBC_PROG_BINUTILS): Check for objdump, set OBJDUMP. + * configure: Regenerated. + * config.make.in (OBJDUMP): New variable, substituted by configure. + + * malloc/mcheck.c (struct hdr): New members `block' and `magic2'. + (mallochook, reallochook): Set them up. + (checkhdr): Check HDR->magic2 value. + (freehook): Reset HDR->magic2. + (memalignhook): New static function. + (old_memalign_hook): New static variable. + (mcheck, reallochook): Set __memalign_hook to memalignhook. + + * sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage): Zero the space + for the new TCB. + +2002-11-13 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Check for visibility + attribute. + * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. + +2002-11-11 Paul Eggert + + * manual/crypt.texi (Cryptographic Functions): Mention that + the MD5 one-way algorithm is compatible with BSD's. + +2002-11-11 Isamu Hasegawa + + * posix/regex_internal.c (re_string_skip_chars): Also return the last + wide character. + (re_string_reconstruct): Calculate the context by itself when the + offset points out of the valid range. + (re_string_context_at): Use wide character when MB_CUR_MAX > 1. + * posix/regex_internal.h (WIDE_NEWLINE_CHAR): New macro. + (IS_WIDE_WORD_CHAR): New macro. + (IS_WIDE_NEWLINE): New macro. + +2002-11-12 Andreas Jaeger + + * sysdeps/x86_64/strchr.S: Don't use one register for two + purposes, this fixes a bug noticed by test-strchr.c. + + * sysdeps/x86_64/strcat.S: Fix algorithm to align source pointer + correctly. + +2002-11-12 Roland McGrath + + * libio/libioP.h [_LIBC && !SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)] + (_G_IO_NO_BACKWARD_COMPAT): Define it. + + * sysdeps/ia64/dl-fptr.c [_LIBC_REENTRANT]: Include + instead of . + [_LIBC_REENTRANT] (lock, unlock): Use __sync_lock_* macros instead of + testandset. + From Ian Wienand . + +2002-11-10 Roland McGrath + + * libio/bug-wfflush.c (do_test): Call rewind instead of fsetpos. + Call fputs instead of fwprintf (simpler to follow in debugger). + + * crypt/md5-crypt.c: Doc fix. + + * sysdeps/unix/make-syscalls.sh: Insert $(make-target-directory) at + the beginning of generated target commands. + + * csu/Makefile ($(objpfx)crti.o, $(objpfx)crtn.o): Add explicit + dependencies for these in case implicit rule search skipped the + nonexistent source directory. + * sysdeps/gnu/Makefile ($(objpfx)errlist.d): Give this rule all the + files with $(object-suffixes) as targets too. + * Makerules [no_deps && objpfx] (before-compile): Add $(objpfx). + and a target for it using $(make-target-directory). + + * Rules (before-compile): Add $(common-objpfx)bits/stdio-lim.h. + +2002-11-10 Roland McGrath + + * sysdeps/unix/sysv/linux/bits/pthreadtypes.h: Moved to ... + * sysdeps/generic/bits/pthreadtypes.h: ... here. + + * sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Treat a struct flock with + l_start == 0 and l_len == 1 as we do l_len == 0. + +2002-11-10 Ulrich Drepper + + * po/da.po: Update from translation team. + +2002-11-10 Roland McGrath + + * config.make.in (includedir): New variable, substituted by configure. + Reported missing by Jocelyn Fournier . + * Makeconfig (includedir): Use $(prefix), not $(exec_prefix). + +2002-11-10 Andreas Jaeger + + * sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h (enum): Add + REG_OLDMASK and REG_CR2 to synch with kernel header. + (NGREG): Increase. + + * nss/getXXent.c (GETFUNC_NAME): Use union type to avoid strict + aliasing problem. + * nss/getXXbyYY_r.c (INTERNAL): Likewise. + * nss/getnssent_r.c (__nss_getent_r): Likewise. + (__nss_setent): Likewise. + (__nss_getent_r): Likewise. + * inet/getnetgrent_r.c (innetgr): Likewise. + (__internal_setnetgrent_reuse): Likewise. + (internal_getnetgrent_r): Likewise. + * inet/ether_hton.c (ether_hostton): Likewise. + * inet/ether_ntoh.c (ether_ntohost): Likewise. + * sunrpc/netname.c (netname2user): Likewise. + * sunrpc/publickey.c (getpublickey): Likewise. + (getsecretkey): Likewise. + +2002-11-09 Marcus Brinkmann + + * sysdeps/mach/hurd/i386/ioperm.c (ioperm): Correct off by one + error in range calculation. + +2002-10-09 Jakub Jelinek + + * string/test-strspn.c (do_test): Ensure zero termination. + * string/test-strpbrk.c (do_test): Likewise. + * string/test-strncmp.c (stupid_strncmp): Use strnlen, not strlen. + * string/test-strncpy.c (stupid_strncpy): Likewise. + * string/test-stpncpy.c (stupid_stpncpy): Likewise. + +2002-10-08 Roland McGrath + + * string/test-string.h (test_init): Fill BUF1 and BUF2 with + nonzero characters. + +2002-09-22 H.J. Lu + + * sysdeps/unix/sysv/linux/mmap64.c (MMAP2_PAGE_SHIFT): Renamed + from PAGE_SHIFT. Define if not defined. Check MMAP2_PAGE_SHIFT + only if __NR_mmap2 is defined. + + * sysdeps/unix/sysv/linux/powerpc/mmap64.c: Moved to ... + * sysdeps/unix/sysv/linux/mmap64.c: ... here. + * sysdeps/unix/sysv/linux/hppa/mmap64.c: File removed. + * sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c: FIle removed, + +2002-11-08 Jakub Jelinek + + * posix/bug-regex13.c (tests): Add new test. + + * string/test-strchr.c (stupid_strchr): New function. + (do_random_tests): Make sure the string is zero terminated. + * string/test-strpbrk.c (stupid_strpbrk): New function. + (do_random_tests): Make sure the string is zero terminated. + * string/test-strcmp.c (stupid_strcmp): New function. + (do_random_tests): Make sure the strings are zero terminated. + * string/test-strspn.c (stupid_strspn): New function. + (simple_strspn): Rename rej argument to acc. + (do_random_tests): Make sure the string is zero terminated. + * string/test-strcspn.c (stupid_strcspn): New function. + * string/test-strncpy.c (stupid_strncpy): New function. + * string/test-stpncpy.c (stupid_stpncpy): New function. + * string/test-strncmp.c (stupid_strncmp): New function. + (do_random_tests): Make sure the strings are zero terminated. + * string/test-string.h (impl_t): Change test into long. + (IMPL): Add __attribute__((aligned (sizeof (void *)))). + +2002-11-08 Roland McGrath + + * sysdeps/ia64/elf/configure.in: Add TLS check. + From Ian Wienand . + * sysdeps/ia64/elf/configure: Regenerated. + +2002-11-07 Roland McGrath + + * libio/fileops.c (_IO_new_file_overflow): Use INTUSE(_IO_do_write) in + place of _IO_new_do_write. + [_LIBC] (_IO_do_write): Define as macro for _IO_new_do_write and + #undef before versioned_symbol use. + +2002-11-07 Richard Henderson + + * configure.in (ASM_ALPHA_NG_SYMBOL_PREFIX): Remove test. + * configure: Regenerated. + * config.h.in (ASM_ALPHA_NG_SYMBOL_PREFIX): Remove #undef. + * sysdeps/alpha/dl-machine.h (TRAMPOLINE_TEMPLATE): Use !samegp. + (RTLD_START): Likewise. Access _dl_skip_args, _rtld_local, and + _dl_fini via gp-relative relocations. + * sysdeps/alpha/fpu/e_sqrt.c: Use !samegp. + + * elf/tls-macros.h: Add alpha versions. + * sysdeps/alpha/dl-machine.h (elf_machine_rela): Handle TLS relocs. + * sysdeps/unix/alpha/sysdep.S: Support USE___THREAD. + * sysdeps/unix/alpha/sysdep.h: Likewise. Add SYSCALL_ERROR_HANDLER. + * sysdeps/unix/sysv/linux/alpha/brk.S: Use it. + * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/getitimer.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/rt_sigaction.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/select.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/sigsuspend.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise. + * sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise. + + * sysdeps/unix/sysv/linux/alpha/sysdep.h: Re-include protect. + Kill argument registers across the inline syscall. + + * sysdeps/unix/sysv/linux/alpha/clone.S: Add user_tid and tls args. + + * linuxthreads/sysdeps/alpha/tls.h: New file. + * sysdeps/alpha/dl-tls.h: New file. + +2002-10-29 David Mosberger + + * sysdeps/ia64/elf/initfini.c [HAVE_INITFINI_ARRAY] + (gmon_initializer): New function. + (.init prologue): If HAVE_INITFINI_ARRAY is true, don't call + __gmon_start__ here. Call it from gmon_initializer() instead. + +2002-03-12 H.J. Lu + + * elf/Makefile [$(have-initfini-array) = yes] (tests): Add tst-array1, + tst-array2, and tst-array3. + [$(have-initfini-array) = yes] (tests-static): Add tst-array3. + [$(have-initfini-array) = yes] (modules-names): Add tst-array2dep. + ($(objpfx)tst-array1.out): New target. + ($(objpfx)tst-array2): Likewise. + ($(objpfx)tst-array2.out): Likewise. + ($(objpfx)tst-array3.out): Likewise. + * elf/tst-array1.c: New file. + * elf/tst-array1.exp: Likewise. + * elf/tst-array2.c: Likewise. + * elf/tst-array2dep.c: Likewise. + * elf/tst-array2.exp: Likewise. + * elf/tst-array3.c: Likewise. + +2002-10-28 David Mosberger + + * elf/dl-fini.c (_dl_fini): Invoke fini_array in _reverse_ order. + Don't add L->l_addr to array entry values. + +2002-11-07 Jakub Jelinek + + * string/test-string.h: New file. + * string/test-strlen.c: New file. + * string/test-string.h: New file. + * string/test-strcmp.c: New file. + * string/test-strchr.c: New file. + * string/test-strrchr.c: New file. + * string/test-strcpy.c: New file. + * string/test-stpcpy.c: New file. + * string/test-strncpy.c: New file. + * string/test-stpncpy.c: New file. + * string/test-strpbrk.c: New file. + * string/test-strcspn.c: New file. + * string/test-strspn.c: New file. + * string/test-strcat.c: New file. + * string/test-strncmp.c: New file. + * string/test-memchr.c: New file. + * string/test-memcmp.c: New file. + * string/test-memset.c: New file. + * string/test-memcpy.c: New file. + * string/test-mempcpy.c: New file. + * string/test-memmove.c: New file. + * string/Makefile (strop-tests): New variable. + (tests): Add strop-tests. + (distribute): Add test-string.h. + +2002-11-06 Ulrich Drepper + + * posix/regcomp.c: Use tabs instead of spaces. + * posix/regexec.c: Likewise. + * posix/regex_internal.h: Likewise. + + * posix/regcomp.c (re_compile_fastmap_iter): Use __wcrtomb not wctomb. + +2002-11-06 Jakub Jelinek + + * posix/regcomp.c (re_compile_pattern): Don't set regs_allocated + here. + (regcomp): Don't set can_be_null here. + (re_comp): Clear whole re_comp_buf with the exception of fastmap. + (re_compile_internal): Clear can_be_null, set regs_allocated. + + * posix/regcomp.c (re_set_fastmap): New function. + (re_compile_fastmap_iter): Use it. Remove redundant type == + COMPLEX_BRACKET check. + * posix/regexec.c (re_search_internal): Optimize searching with + fastmap. Call re_string_reconstruct even if match_first is + smaller than raw_mbs_idx. + +2002-11-06 Isamu Hasegawa + + * posix/regcomp (free_dfa_content): Use free_state. + * posix/regex_internal.c (re_string_realloc_buffers): Don't edit + pointers in case that realloc failed. + (re_node_set_merge): Likewise. + (register_state): Likewise. + (create_newstate_common): Invoke memory release functions in case of + error conditions. + (create_ci_newstate): Likewise. + (create_cd_newstate): Likewise. + (free_state): New function. + * posix/regexec.c (re_search_internal): Invoke memory release + functions in case of error conditions. + (sift_states_backward): Likewise. + (merge_state_array): Likewise. + (add_epsilon_src_nodes): Likewise. + (sub_epsilon_src_nodes): Likewise. + (search_subexp): Likewise. + (sift_states_bkref): Likewise. + (transit_state_sb): Likewise. + (transit_state_mb): Likewise. + (transit_state_bkref_loop): Likewise. + (group_nodes_into_DFAstates): Likewise. + (push_fail_stack): Don't edit pointers in case that realloc failed. + (extend_buffers): Likewise. + (match_ctx_add_entry): Likewise. + +2002-11-06 Roland McGrath + + * sysdeps/unix/sysv/linux/mips/configure.in: File removed. + * sysdeps/unix/sysv/linux/mips/configure: Likewise. + + * configure.in: Add checks on as and ld for binutils 2.13 or later. + * configure: Regenerated. + +2002-11-06 Ulrich Drepper + + * posix/regcomp.c (regcomp): __re_compile_fastmap can never fail. + If re_compile_internal failed free fastmap buffer. + (free_dfa_content): Broken out of regfree function. Frees all dfa + related data. + (regfree): Add free_dfa_content. + (re_compile_internal): If any of the called functions fails free + all dfa related memory. + +2002-11-05 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sys/sysctl.h: Add ugly hacks to prevent + warnings from the kernel headers. + +2002-11-05 Roland McGrath + + * sysdeps/unix/mips/sysdep.h [! __PIC__] (PSEUDO): Add nop after jump. + From Johannes Stezenbach . + + * sysdeps/unix/sysv/linux/mips/Versions (libc: GLIBC_2.0): Change + #errlist-compat magic comment to give 123 as size. + (libc: GLIBC_2.1): Remove this set, moving #errlist-compat magic to ... + (libc: GLIBC_2.2): ... here. + (libc: GLIBC_2.3): Likewise. + +2002-11-05 Ulrich Drepper + + * elf/dl-fini.c (_dl_fini): Correct the increment of l_opencount + which happens at the beginning so that we can unload modules in + __libc_freeres. + +2002-11-06 Kaz Kojima + + * sysdeps/sh/bits/setjmp.h (JB_SIZE): Define only + under [__USE_MISC || _ASM]. + + * elf/elf.h: Remove the obsolete SH TLS relocations. + +2002-11-05 Ulrich Drepper + + * posix/regcomp.c (regcomp): Initialize preg->can_be_null to zero. + +2002-11-05 Franz Sirl + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Handle + __NR_pread64 and __NR_pwrite64. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/pread.c: Remove __NR_pread64 + and __NR_pwrite64. + Revert change to use INLINE_SYSCALL. + * sysdeps/unix/sysv/linux/powerpc/pread64.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/pwrite.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/pwrite64.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/ftruncate64.c: Revert change to use + INLINE_SYSCALL. + * sysdeps/unix/sysv/linux/powerpc/truncate64.c: Likewise. + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INLINE_SYSCALL): + Update clobber list and add a comment about the syscall ABI. + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (s_pread64, + s_pwrite64, s_ftruncate, s_truncate): Re-add. + +2002-11-05 Jakub Jelinek + + * iconv/gconv_dl.c (free_mem): Clear loaded. + * locale/loadarchive.c (_nl_archive_subfreeres): Call locale_data's + cleanup if any. + +2002-11-05 Ulrich Drepper + + * sysdeps/unix/sysv/linux/fexecve.c: Include . + + * libio/ioseekoff.c: Remove INTDEF. Define _IO_seekoff_unlocked. Same + as old code without locking. _IO_seekoff calls this function after + locking the stream. + * libio/ioseekpos.c: Likewise for _IO_seekpos. + * libio/libioP.h: Replace _IO_seekoff_internal and _IO_seekpos_internal + prototypes with _IO_seekoff_unlocked and _IO_seekpos_unlocked + prototypes. + * libio/iolibio.h (_IO_fseek): Call _IO_seekoff_unlocked instead + of _IO_seekoff_internal. + (_IO_rewind): Likewise. + * libio/ioftell.c: Likewise. + * libio/ftello.c: Likewise. + * libio/ftello64.c: Likewise. + * libio/iofgetpos.c: Likewise. + * libio/iofgetpos64.c: Likewise. + * libio/oldiofgetpos.c: Likewise. + * libio/oldiofgetpos64.c: Likewise. + * libio/iofsetpos.c: Call _IO_seekpos_unlocked instead of + _IO_seekpos_internal. + * libio/iofsetpos64.c: Likewise. + * libio/oldiofsetpos.c: Likewise. + * libio/oldiofsetpos64.c: Likewise. + +2002-11-04 Roland McGrath + + * sysdeps/unix/sysv/linux/powerpc/chown.c: Use INLINE_SYSCALL macro. + * sysdeps/unix/sysv/linux/powerpc/ftruncate64.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/ioctl.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/pread.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/pread64.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/pwrite.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/pwrite64.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/tcgetattr.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/tcsetattr.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/truncate64.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (s_ioctl, + s_chown, s_ftruncate64, s_mmap2, s_pread64, s_pwrite64, s_truncate64, + sys_fstat, sys_lstat, sys_mknod, sys_readv, sys_stat, sys_writev): + Remove these, no longer used. + +2002-11-04 Franz Sirl + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list (s_ipc, + s_llseek, s_readahead, s_execve, s_fcntl, s_fcntl64, s_fstat64, + s_getcwd, s_getdents, s_getdents64, s_getpmsg, s_getpriority, + s_getrlimit, s_lstat64, s_poll, s_ptrace, s_putpmsg, s_reboot, + s_setrlimit, s_sigaction, s_sigpending, s_sigprocmask, s_sigsuspend, + s_stat64, s_sysctl, s_ugetrlimit, s_ustat, s_vfork): Remove now unused + syscall stubs. + + * sysdeps/unix/sysv/linux/pwrite.c: Fix typo. + * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/pread.c: Handle both __NR_pread64 + and __NR_pread. + * sysdeps/unix/sysv/linux/powerpc/pread64.c: Likewise. + * sysdeps/unix/sysv/linux/powerpc/pwrite.c: Handle both __NR_pwrite64 + and __NR_pwrite. + * sysdeps/unix/sysv/linux/powerpc/pwrite64.c: Likewise. + +2002-11-03 Roland McGrath + + * sysdeps/generic/ldsodefs.h (struct rtld_global): New member + `_dl_tls_static_used'. + * sysdeps/generic/libc-tls.c (_dl_tls_static_used): New variable. + (__libc_setup_tls): Initialize it. Let the initial value of + _dl_tls_static_size indicate some surplus space in the computed value. + * elf/dl-open.c (_dl_tls_static_size): New variable. + * sysdeps/generic/dl-tls.c (_dl_determine_tlsoffset): Initialize + _dl_tls_static_used. Add some surplus space into _dl_tls_static_size. + * elf/dl-reloc.c [USE_TLS] (allocate_static_tls): New function. + (CHECK_STATIC_TLS): Use it. + * elf/dl-close.c (_dl_close): Adjust _dl_tls_static_used when the + closed objects occupied a trailing contiguous chunk of static TLS area. + +2002-10-18 Bruno Haible + + * charmaps/ISO_5428: Use Greek characters introduced in Unicode 3.0. + +2002-11-04 Ulrich Drepper + + * libio/wfileops.c (_IO_wfile_seekoff): Don't modify _offset and + _wide_data->_IO_read_end if adjustment can be made in the current + buffer. + + * sysdeps/unix/sysv/linux/fexecve.c: New file. + + * libio/bug-wfflush.c (do_test): Using fseek is not allowed when + wide oriented streams are used. + + * nss/getXXent_r.c (ENDFUNC_NAME): Don't do anything if the + service hasn't been used [PR libc/4744]. + + * include/features.h: Use __STDC_VERSION__ not __STDC_VERSION. + Reported by Miloslav Trmac [PR libc/4766]. + + * manual/examples/dir.c: Don't include . + * manual/examples/select.c: Include for TEMP_FAILURE_RETRY. + Reported by Frédéric Delanoy . + +2002-11-02 H.J. Lu + + * stdio-common/reg-printf.c: Include . + +2002-11-03 Ulrich Drepper + + * sysdeps/generic/libc-tls.c: Define _dl_tls_static_used. + + * po/ca.po: Update from translation team. + * po/es.po: Likewise. + + * sysdeps/generic/segfault.c (catch_segfault): If HAVE_PROC_SELF + is defined write out memory map. + * sysdeps/unix/sysv/linux/segfault.c: New file. + +2002-11-02 Roland McGrath + + * sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): Use union type for + pointers that can alias. + Reported by Daniel Jacobowitz . + + * sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h: New file. + +2002-11-02 Roland McGrath + + * manual/filesys.texi (Reading/Closing Directory): Rewrite readdir_r + description to be clearer and to say that *RESULT is set to ENTRY. + +2002-10-30 Jakub Jelinek + + * posix/regexec.c (build_trtable): Alloca or malloc dests_node and + dests_ch arrays together. Alloca or malloc dest_states, + dest_states_word and dest_states_nl arrays together. Free memory on + error exit. + +2002-10-29 Daniel Jacobowitz + + * crypt/crypt_util.c (__init_des_r): Initialize current_salt + and current_saltbits. + +2002-11-02 Roland McGrath + + * stdio-common/reg-printf.c: Include . + +2002-11-02 H.J. Lu + + * sysdeps/unix/sysv/linux/mips/syscalls.list (s_execve): Set + caller to EXTRA instead of execve. + +2002-11-01 Roland McGrath + + * sysdeps/generic/errno-loc.c [! USE___THREAD]: Use this conditional + in place of [!(USE_TLS && HAVE___THREAD)]. + (__errno_location) [! USE___THREAD]: Define as strong, not weak. + +2002-10-31 Roger Sayle + + * sysdeps/i386/soft-fp/sfp-machine.h (_FP_NANFRAC_Q, _FP_NANSIGN_Q): + New macros. + * sysdeps/x86_64/soft-fp/sfp-machine.h: Likewise. + + * soft-fp/soft-fp.h: Allow sfp-machine.h to define FP_RND_NEAREST + without defining FP_ROUNDMODE. + +2002-10-29 Jakub Jelinek + + * sysdeps/gnu/siglist.c (PTR_SIZE_STR): Remove. + (__old_sys_siglist, __old_sys_sigabbrev): Use strong_alias and + declare_symbol. + * sysdeps/mach/hurd/siglist.h (OLD_SIGLIST_SIZE_STR): Remove. + (OLD_SIGLIST_SIZE): Define. + * sysdeps/unix/sysv/linux/siglist.h (OLD_SIGLIST_SIZE_STR): Remove. + (OLD_SIGLIST_SIZE): Define. + * sysdeps/unix/sysv/linux/arm/siglist.c: Remove. + +2002-11-01 Jakub Jelinek + + * sysdeps/ia64/strncpy.S: Fix recovery code. + +2002-10-30 Jakub Jelinek + + * include/libc-symbols.h (__libc_freeres_fn_section, libc_freeres_fn): + New macros. + * elf/dl-close.c (free_mem): Use libc_freeres_fn macro, remove + text_set_element. + * elf/dl-libc.c (free_mem): Likewise. + * iconv/gconv_conf.c (free_mem): Likewise. + * iconv/gconv_db.c (free_mem): Likewise. + * iconv/gconv_dl.c (free_mem): Likewise. + * iconv/gconv_cache.c (free_mem): Likewise. + * intl/finddomain.c (free_mem): Likewise. + * intl/dcigettext.c (free_mem): Likewise. + * locale/setlocale.c (free_mem): Likewise. + * misc/fstab.c (fstab_free): Likewise. + * nss/nsswitch.c (free_mem): Likewise. + * posix/regcomp.c (free_mem): Likewise. + * resolv/gai_misc.c (free_res): Likewise. + * stdlib/fmtmsg.c (free_mem): Likewise. + * sunrpc/clnt_perr.c (free_mem): Likewise. + * sysdeps/generic/setenv.c (free_mem): Likewise. + * sysdeps/unix/sysv/linux/shm_open.c (freeit): Likewise. + * sysdeps/pthread/aio_misc.c (free_res): Likewise. + * time/tzset.c (free_mem): Likewise. + * malloc/mtrace.c (release_libc_mem): Add __libc_freeres_fn_section. + * locale/loadarchive.c (_nl_archive_subfreeres): Likewise. + * malloc/set-freeres.c (__libc_freeres): Likewise. + + * login/getutent.c: Include stdlib.h instead of stddef.h. + (buffer): Change into pointer to utmp, add libc_freeres_ptr. + (__getutent): Allocate buffer the first time it is run. + * login/getutid.c: Include stdlib.h instead of stddef.h. + (buffer): Change into pointer to utmp, add libc_freeres_ptr. + (__getutid): Allocate buffer the first time it is run. + * login/getutline.c: Include stdlib.h instead of stddef.h. + (buffer): Change into pointer to utmp, add libc_freeres_ptr. + (__getutline): Allocate buffer the first time it is run. + * malloc/mtrace.c (malloc_trace_buffer): Change into char *. + (mtrace): Allocate malloc_trace_buffer. + * resolv/nsap_addr.c (inet_nsap_ntoa): Decrease size of tmpbuf. + * resolv/ns_print.c (ns_sprintrrf): Decrease size of t. + * string/strerror.c: Include libintl.h and errno.h. + (buf): New variable. + (strerror): Only allocate buffer if actually needed (unknown error). + * time/tzfile.c (transitions): Add libc_freeres_ptr. + (freeres): Remove. + +2002-10-25 Jakub Jelinek + + * include/libc-symbols.h (libc_freeres_ptr): New macro. + * malloc/set-freeres.c (__libc_freeres_ptrs): Define using + symbol_set_define. + (__libc_freeres): Free all pointers in that section. + * Makerules (build-shlib): Add $(LDSEDCMD-$(@F:lib%.so=%).so) to sed + commands when creating .lds script. + (LDSEDCMD-c.so): New variable. + * inet/rcmd.c (ahostbuf): Change into char *. Add libc_freeres_ptr. + (rcmd_af): Use strdup to allocate ahostbuf. + * inet/rexec.c (ahostbuf): Change into char *. Add libc_freeres_ptr. + (rexec_af): Use strdup to allocate ahostbuf. + * stdio-common/reg-printf.c (printf_funcs): Remove. + (__printf_arginfo_table): Change into printf_arginfo_function **. + Add libc_freeres_ptr. + (__register_printf_function): Allocate __printf_arginfo_table + and __printf_function_table the first time it is called. + * stdio-common/printf-parse.h (__printf_arginfo_table): Change into + printf_arginfo_function **. + (parse_one_spec): Add __builtin_expect. + * grp/fgetgrent.c (buffer): Add libc_freeres_ptr. + (free_mem): Remove. + * inet/getnetgrent.c (buffer): Add libc_freeres_ptr. + (free_mem): Remove. + * intl/localealias.c (libc_freeres_ptr): Define if !_LIBC. + (string_space, map): Add libc_freeres_ptr. + (free_mem): Remove. + * misc/efgcvt.c (FCVT_BUFPTR): Add libc_freeres_ptr. + (free_mem): Remove. + * misc/mntent.c (getmntent_buffer): Add libc_freeres_ptr. + (free_mem): Remove. + * crypt/md5-crypt.c (libc_freeres_ptr): Define if !_LIBC. + (buffer): Add libc_freeres_ptr. + (free_mem): Remove for _LIBC. + * nss/getXXbyYY.c (buffer): Add libc_freeres_ptr. + (free_mem): Remove. + * nss/getXXent.c (buffer): Add libc_freeres_ptr. + (free_mem): Remove. + * pwd/fgetpwent.c (buffer): Add libc_freeres_ptr. + (free_mem): Remove. + * resolv/res_hconf.c (ifaddrs): Add libc_freeres_ptr. + (free_mem): Remove. + * shadow/fgetspent.c (buffer): Add libc_freeres_ptr. + (free_mem): Remove. + * sysdeps/posix/ttyname.c (getttyname_name): Add libc_freeres_ptr. + (free_mem): Remove. + * sysdeps/unix/sysv/linux/getsysstats.c (mount_proc): Add + libc_freeres_ptr. + (free_mem): Remove. + * sysdeps/unix/sysv/linux/ttyname.c (getttyname_name, ttyname_buf): Add + libc_freeres_ptr. + (free_mem): Remove. + +2002-10-30 Jakub Jelinek + + * malloc/obstack.c [_LIBC] (obstack_free): Change into strong_alias + instead of duplicating the whole function in libc. + +2002-10-31 Roland McGrath + + * sysdeps/i386/bits/byteswap.h [__GNUC__ < 2] (__bswap_32): + Renamed from __bswap_16 (typo fix). Reported by . + +2002-10-30 Jakub Jelinek + + * sysdeps/unix/sysv/linux/Makefile (syscall-%.h): Add -D for each + 32bit-predefine when creating .new32 list and -U for each + 32bit-predefine when creating .new64 list. + * sysdeps/unix/sysv/linux/x86_64/Makefile (32bit-predefine): New. + +2002-10-29 Andreas Schwab + + * sysdeps/generic/allocrtsig.c: Include , not + "testrtsig.h". Reported by Daniel Jacobowitz . + +2002-10-25 Roland McGrath + + * sysdeps/unix/sysv/linux/configure.in: Fix typo in last change. + * sysdeps/unix/sysv/linux/configure: Regenerated. + + * sysdeps/generic/ldsodefs.h: Remove [! SHARED] conditional from + _dl_starting_up decl. + +2002-10-20 H.J. Lu + + * sysdeps/unix/sysv/linux/configure.in: Don't check + /lib/modules/`uname -r`/build/include for kernel headers if + cross compiling. + * sysdeps/unix/sysv/linux/configure: Regenerated. + +2002-10-25 Roland McGrath + + * math/math.h (M_LOG2El): Correct the value. + From Stephen L Moshier . + + * sysdeps/unix/sysv/linux/init-first.c (init): Remove [! SHARED] + conditional from __libc_multiple_libcs access. Remove kludge for weak + symbol access with old compilers we no longer support. + * sysdeps/unix/sysv/aix/init-first.c (init): Likewise. + * sysdeps/generic/libc-start.c (__libc_start_main): Likewise. + +2002-10-25 Roland McGrath + + * sysdeps/posix/sigvec.c [SA_RESETHAND]: Disable wrapper hacks and + implement SV_RESETHAND by translating it to SA_RESETHAND. + +2002-10-23 Alexandre Oliva + + * elf/dl-reloc.c (_dl_reloc_bad_use): Print the full 32-bit relocation + type on ELF64 platforms. + +2002-10-24 Ulrich Drepper + + * elf/elf.h (R_X86_64_GOTTPOFF): Renamed from r_x86_64_GOTTPOFF. + + * elf/elf.h: Define ELF_NOTE_OS_FREEBSD and NT_TASKSTRUCT. + +2002-10-24 Jakub Jelinek + + * elf/dl-misc.c: Include . + (_dl_debug_vdprintf): Only take dl_load_lock if not _dl_starting_up. + + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL, + INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros. + (INLINE_SYSCALL): Use that. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL, + INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros. + (INLINE_SYSCALL): Use that. + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL, + INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros. + (INLINE_SYSCALL): Use that. + * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include + dl-sysdep.h. + (SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant. + (__INTERNAL_SYSCALL_STRING): Define. + * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include + dl-sysdep.h. + (SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant. + (__INTERNAL_SYSCALL_STRING): Define. + * sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass + __SYSCALL_STRING to inline_syscall*. + (INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): + New macros. + (inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3, + inline_syscall4, inline_syscall5, inline_syscall6): Add string + argument. + +2002-10-24 Roland McGrath + + * sysdeps/generic/ldsodefs.h (_dl_starting_up): Declare it here. + * sysdeps/unix/sysv/linux/init-first.c: Not here. + * sysdeps/powerpc/elf/libc-start.c: Or here. + * sysdeps/unix/sysv/aix/libc-start.c: Or here. + * sysdeps/unix/sysv/aix/start-libc.c: Or here. + * sysdeps/unix/sysv/aix/init-first.c: Or here. + * sysdeps/generic/libc-start.c: Or here. + * sysdeps/unix/sysv/linux/init-first.c (init): Protect _dl_starting_up + access with [! SHARED]. + * sysdeps/unix/sysv/aix/init-first.c (init): Likewise. + + * libio/bug-wfflush.c: New file. + * libio/Makefile (tests): Add bug-wfflush. + +2002-10-23 Roland McGrath + + * stdio-common/tst-fphex.c: New file. + * stdio-common/Makefile (tests): Add tst-fphex. + * sysdeps/generic/printf_fphex.c (__printf_fphex): Fix initialization + of WNUMEND. Fix counting of decimal point in WIDTH. Print '0' pad + chars always before the value digits. + Reported by James Antill . + +2002-10-24 Jakub Jelinek + + * posix/regcomp.c (re_comp): Call __regfree on re_comp_buf. + (free_mem): New function. + * posix/Makefile (tests): Add bug-regex14. Add bug-regex14-mem + if not cross compiling. + (generated): Add bug-regex14-mem and bug-regex14.mtrace. + (bug-regex14-ENV): Set. + (bug-regex14-mem): New target. + * posix/bug-regex14.c: New file. + +2002-10-23 Roland McGrath + + * elf/Makefile ($(objpfx)librtld.map): Use temporary file for output + target, so we don't touch it when the link fails. + + * libio/ftello.c (ftello): Use _IO_off64_t for type of POS. + Check for the result overflowing off_t and fail with EOVERFLOW. + * libio/ioftell.c (_IO_ftell): Likewise. + * libio/iofgetpos.c (_IO_new_fgetpos): Likewise. + + * login/logwtmp.c (logwtmp): If sizeof ut_tv != sizeof struct timeval, + use a temporary timeval on the stack for gettimeofday and copy it. + * login/logout.c (logout): Likewise. + Reported by Steven Munroe . + + * sysdeps/unix/sysv/linux/bits/statfs.h (struct statfs): + Use __SWORD_TYPE instead of int for member types. + (struct statfs64): Likewise. + * sysdeps/unix/sysv/linux/alpha/bits/statfs.h: New file. + * sysdeps/unix/sysv/linux/s390/bits/statfs.h: New file. + * sysdeps/unix/sysv/linux/ia64/bits/statfs.h: File removed. + * sysdeps/unix/sysv/linux/sparc/bits/statfs.h: File removed. + * sysdeps/unix/sysv/linux/x86_64/bits/statfs.h: File removed. + + * sysdeps/unix/sysv/linux/sparc/bits/statvfs.h: Moved to ... + * sysdeps/unix/sysv/linux/bits/statvfs.h: ... here. + (ST_NODIRATIME): Restore fixed value of 2048. + * sysdeps/unix/sysv/linux/alpha/bits/statvfs.h: File removed. + * sysdeps/unix/sysv/linux/ia64/bits/statvfs.h: File removed. + + Rearranged definitions to reduce duplication. + * sysdeps/generic/bits/types.h: Rewritten, using macros from + and new header . + * posix/Makefile (headers): Add bits/typesizes.h here. + * sysdeps/generic/bits/typesizes.h: New file. + * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h: New file. + * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h: New file. + * sysdeps/mach/hurd/bits/typesizes.h: New file. + * sysdeps/unix/sysv/linux/alpha/bits/types.h: File removed. + * sysdeps/unix/sysv/linux/bits/types.h: File removed. + * sysdeps/unix/sysv/linux/ia64/bits/types.h: File removed. + * sysdeps/unix/sysv/linux/mips/bits/types.h: File removed. + * sysdeps/unix/sysv/linux/s390/bits/types.h: File removed. + * sysdeps/unix/sysv/linux/sparc/bits/types.h: File removed. + * sysdeps/unix/sysv/linux/x86_64/bits/types.h: File removed. + * posix/sys/types.h [__USE_POSIX199506 || __USE_UNIX98]: Include + here, not in . + * signal/signal.h: Likewise. + + * streams/stropts.h: Include . + * streams/Makefile (headers): Add bits/xtitypes.h here. + * sysdeps/generic/bits/xtitypes.h: New file. + * sysdeps/s390/bits/xtitypes.h: New file. + * sysdeps/ia64/bits/xtitypes.h: New file. + * sysdeps/x86_64/bits/xtitypes.h: New file. + + * sysvipc/Makefile (headers): Add bits/ipctypes.h here. + * sysdeps/generic/bits/ipctypes.h: New file. + * sysdeps/mips/bits/ipctypes.h: New file. + * sysdeps/gnu/bits/shm.h: Include . + * sysdeps/gnu/bits/msq.h: Likewise. + * sysvipc/sys/ipc.h: Likewise. + +2002-10-22 Ulrich Drepper + + * elf/dl-load.c (struct filebuf): For buf element to have the + alignment of ElfXX_Ehdr since this is what will be stored in it. + +2002-10-22 Jakub Jelinek + + * locale/programs/locarchive.c (add_alias): Change locrec_offset arg + into pointer to locrec_offset. + (add_locale_to_archive): Adjust callers. Free normalized_name right + before returning, not immediately after add_locale, pass it to + add_alias if not NULL instead of name. Rename second normalized_name + occurence to nnormalized_codeset_name. + + * locale/programs/locarchive.c (enlarge_archive): Make sure + string_size is always a multiple of 4. + Reported by Andreas Schwab . + +2002-10-21 Andreas Schwab + + * sysdeps/unix/sysv/linux/ia64/syscalls.list (s_execve): Set + caller to EXTRA instead of execve, since the latter has a + higher-priority implementation in linuxthreads. + +2002-10-21 Roland McGrath + + * sysdeps/generic/libc-tls.c (__libc_setup_tls): Initialize the static + slotinfo list's len member to the proper size, not just 1. + Initialize static_map.l_tls_initimage. + + * elf/dl-open.c (dl_open_worker): Fix loop searching for + dtv_slotinfo_list element containing new modules' l_tls_modid. + + * elf/tst-tls9.c, elf/tst-tls9-static.c: New files. + * elf/tst-tlsmod5.c, elf/tst-tlsmod6.c: New files. + * elf/Makefile (tests): Add tst-tls9. + (tests-static): Add tst-tls9-static. + (tst-tls9-static-ENV): New variable. + ($(objpfx)tst-tls9-static, $(objpfx)tst-tls9-static.out): New targets. + + * elf/dl-close.c (remove_slotinfo): Remove an assert; the number of + modids used by partially loaded modules being closed can't be known. + +2002-10-21 Isamu Hasegawa + + * posix/Makefile: Add a test case for the bug reported by Aharon + Robbins . + * posix/bug-regex13.c: New file. + * posix/regcomp.c (peek_token_bracket): Skip the byte already read. + +2002-10-21 Ulrich Drepper + + * csu/gmon-start.c: Pretty printing. + +2002-10-19 Art Haas + + * configure.in: Replace AC_CONFIG_HEADER with AC_CONFIG_HEADERS, + add AC_HELP_STRING to all AC_ARG_WITH and AC_ARG_ENABLE macros, + add autoconf quotes to the AC_CONFIG_AUX_DIR macro. + * configure: Regenerated. + +2002-10-19 Roland McGrath + + * configure.in: Call AC_CONFIG_SUBDIRS with empty argument + and then set $subdirs directly, because the new Autoconf breaks + compatibility in every way imaginable and insists on whining + about usage that worked since the dawn of time. + * configure: Regenerated. + + * configure: Regenerated (using Autoconf 2.54). + * sysdeps/alpha/elf/configure: Likewise. + * sysdeps/generic/configure: Likewise. + * sysdeps/i386/elf/configure: Likewise. + * sysdeps/ia64/elf/configure: Likewise. + * sysdeps/mach/hurd/configure: Likewise. + * sysdeps/mach/configure: Likewise. + * sysdeps/unix/configure: Likewise. + * sysdeps/unix/common/configure: Likewise. + * sysdeps/unix/sysv/aix/configure: Likewise. + * sysdeps/unix/sysv/linux/configure: Likewise. + * sysdeps/unix/sysv/linux/mips/configure: Likewise. + * sysdeps/x86_64/elf/configure: Likewise. + + * config.make.in: Nix completely-soft nonsense. + * configure.in: Likewise. Under --without-fp, use nofpu subdirectory + of machine directories instead of fpu subdirectory. + * sysdeps/powerpc/soft-fp/Makefile: Remove cruft added in last change. + * sysdeps/powerpc/nofpu/Makefile: Put it in this new file instead. + * sysdeps/powerpc/soft-fp/sim-full.c: Moved to ... + * sysdeps/powerpc/nofpu/sim-full.c: ... here. + * sysdeps/powerpc/soft-fp/fraiseexcpt.c: Moved to ... + * sysdeps/powerpc/nofpu/fraiseexcpt.c: ... here. + * sysdeps/powerpc/soft-fp/fegetexcept.c: Moved to ... + * sysdeps/powerpc/nofpu/fegetexcept.c: ... here. + * sysdeps/powerpc/soft-fp/fclrexcpt.c: Moved to ... + * sysdeps/powerpc/nofpu/fclrexcpt.c: ... here. + * sysdeps/powerpc/soft-fp/ftestexcept.c: Moved to ... + * sysdeps/powerpc/nofpu/ftestexcept.c: ... here. + * sysdeps/powerpc/soft-fp/fgetexcptflg.c: Moved to ... + * sysdeps/powerpc/nofpu/fgetexcptflg.c: ... here. + * sysdeps/powerpc/soft-fp/fsetexcptflg.c: Moved to ... + * sysdeps/powerpc/nofpu/fsetexcptflg.c: ... here. + * sysdeps/powerpc/soft-fp/fedisblxcpt.c: Moved to ... + * sysdeps/powerpc/nofpu/fedisblxcpt.c: ... here. + * sysdeps/powerpc/soft-fp/feenablxcpt.c: Moved to ... + * sysdeps/powerpc/nofpu/feenablxcpt.c: ... here. + * sysdeps/powerpc/soft-fp/fegetenv.c: Moved to ... + * sysdeps/powerpc/nofpu/fegetenv.c: ... here. + * sysdeps/powerpc/soft-fp/fesetenv.c: Moved to ... + * sysdeps/powerpc/nofpu/fesetenv.c: ... here. + * sysdeps/powerpc/soft-fp/fegetround.c: Moved to ... + * sysdeps/powerpc/nofpu/fegetround.c: ... here. + * sysdeps/powerpc/soft-fp/fesetround.c: Moved to ... + * sysdeps/powerpc/nofpu/fesetround.c: ... here. + * sysdeps/powerpc/soft-fp/feupdateenv.c: Moved to ... + * sysdeps/powerpc/nofpu/feupdateenv.c: ... here. + * sysdeps/powerpc/soft-fp/feholdexcpt.c: Moved to ... + * sysdeps/powerpc/nofpu/feholdexcpt.c: ... here. + * sysdeps/powerpc/soft-fp/fenv_const.c: Moved to ... + * sysdeps/powerpc/nofpu/fenv_const.c: ... here. + * sysdeps/powerpc/soft-fp/libm-test-ulps: Moved to ... + * sysdeps/powerpc/nofpu/libm-test-ulps: ... here. + * sysdeps/powerpc/soft-fp/soft-supp.h: Moved to ... + * sysdeps/powerpc/nofpu/soft-supp.h: ... here. + * sysdeps/powerpc/soft-fp/Versions (libc: GLIBC_2.3.2): Moved to ... + * sysdeps/powerpc/nofpu/Versions: ... here, new file. + +2002-10-19 Bruno Haible + + * sysdeps/unix/bsd/bsd4.4/freebsd/sys/sysmacros.h: New file. + +2002-10-18 Roland McGrath + + * io/Makefile (routines): Add lchmod. + * io/sys/stat.h [__USE_BSD] (lchmod): Declare it. + * sysdeps/generic/lchmod.c: New file. + * sysdeps/mach/hurd/lchmod.c: New file. + * io/Versions (libc: GLIBC_2.3.2): New set, add lchmod. + +2002-10-18 Art Haas + + * configure.in: Remove remaining AC_FD_CC macros, and replace + AC_FD_MSG with AS_MESSAGE_FD. + +2002-10-18 Roland McGrath + + * sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela): Fix + typos: VALUE -> FINALADDR. + + * sysdeps/unix/alpha/sysdep.h (INLINE_SYSCALL, INLINE_SYSCALL1) + (inline_syscall_clobbers, inline_syscall0, inline_syscall1) + (inline_syscall2, inline_syscall3, inline_syscall4, inline_syscall5) + (inline_syscall6): Move these macros ... + * sysdeps/unix/sysv/linux/alpha/sysdep.h: ... to here. + + * configure.in (libc_link_dests, libc_link_sources): Remove these + variables and the AC_LINK_FILES call. + + * sysdeps/powerpc/soft-fp/Versions (libc: GLIBC_2.3.2): Fix last + change to put new symbols here instead of in GLIBC_2.2. + * sysdeps/powerpc/Subdirs: Move this file ... + * sysdeps/powerpc/soft-fp/Subdirs: ... here. + +2002-10-07 Roland McGrath + + * sysdeps/generic/bits/time.h: Replaced with contents of the + sysdeps/unix/sysv/linux/i386/bits/time.h file. All the following + files were identical except for the absence of CLOCK_THREAD_CPUTIME_ID + and CLOCK_PROCESS_CPUTIME_ID in .../linux/bits/time.h; adding these + macros is ok even for architectures that don't now implement them. + * sysdeps/mach/hurd/bits/time.h: File removed. + * sysdeps/unix/sysv/linux/bits/time.h: File removed. + * sysdeps/unix/sysv/linux/i386/bits/time.h: File removed. + * sysdeps/unix/sysv/linux/ia64/bits/time.h: File removed. + * sysdeps/unix/sysv/linux/sparc/bits/time.h: File removed. + * sysdeps/unix/sysv/linux/x86_64/bits/time.h: File removed. + +2002-10-18 Jeff Bailey + + * configure.in: Replace obsolete AC_OUTPUT syntax with + AC_CONFIG_FILES, AC_CONFIG_COMMANDS, and new-type AC_OUTPUT trio. + + * aclocal.m4 (GLIBC_PROVIDES): Add AC_PROVIDEs for + _AS_PATH_SEPARATOR_PREPARE and _AS_TEST_PREPARE. + + * configure.in: Replace AC_FD_CC with AS_MESSAGE_LOG_FD. + * sysdeps/alpha/elf/configure.in: Likewise. + * sysdeps/i386/elf/configure.in: Likewise. + * sysdeps/mach/hurd/configure.in: Likewise. + * sysdeps/x86_64/elf/configure.in: Likewise. + + * configure.in: Use AC_CONFIG_SRCDIR and new AC_INIT syntax. + + * sysdeps/alpha/elf/configure.in: Remove unneeded sinclude statement. + * sysdeps/generic/configure.in: Likewise. + * sysdeps/i386/elf/configure.in: Likewise. + * sysdeps/ia64/elf/configure.in: Likewise. + * sysdeps/mach/configure.in: Likewise. + * sysdeps/mach/hurd/configure.in: Likewise. + * sysdeps/unix/configure.in: Likewise. + * sysdeps/unix/common/configure.in: Likewise. + * sysdeps/unix/sysv/aix/configure.in: Likewise. + * sysdeps/unix/sysv/linux/configure.in: Likewise. + * sysdeps/unix/sysv/linux/mips/configure.in: Likewise. + * sysdeps/x86_64/elf/configure.in: Likewise. + + * aclocal.m4: Use just the bits from AS_INIT that are needed for the + GLIBC_PROVIDES. Use plain comment instead of HEADER-COMMENT so + that it's obvious when extra autoconf machinery is being dragged in. + +2002-10-18 Roland McGrath + + * configure.in: Remove bogus echo included in + 2002-10-08 Aldy Hernandez change. + * configure: Regenerated. + +2002-10-18 Jakub Jelinek + + * sysdeps/unix/sysv/linux/pathconf.h (statfs_link_max): Add inline. + (statfs_filesize_max): New function. + * sysdeps/unix/sysv/linux/linux_fsinfo.h (JFFS_SUPER_MAGIC, + JFFS2_SUPER_MAGIC, JFS_SUPER_MAGIC, NTFS_SUPER_MAGIC, + ROMFS_SUPER_MAGIC, UDF_SUPER_MAGIC): Define. + * sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Use + statfs_filesize_max. + * sysdeps/unix/sysv/linux/pathconf.c (__pathconf): Likewise. + * sysdeps/unix/sysv/linux/alpha/fpathconf.c: Removed. + * sysdeps/unix/sysv/linux/alpha/pathconf.c: Removed. + +2002-10-17 Roland McGrath + + * configure.in (MIG): Just AC_SUBST it here. + * configure: Regenerated. + * sysdeps/mach/configure.in (MIG): Do the AC_CHECK_TOOL here. + Adding final - argument to all AC_CHECK_HEADER uses for .defs files. + * sysdeps/mach/configure: Regenerated. + + * aclocal.m4 (GLIBC_PROVIDES): Add AC_PROVIDE([_AS_TR_SH_PREPARE]) + and AC_PROVIDE([_AS_CR_PREPARE]). + + * aclocal.m4 (GLIBC_PROVIDES): Add AC_PROVIDE([_AS_ECHO_N_PREPARE]). + Remove AC_LANG(C) call, instead just define([_AC_LANG], [C]). + + * elf/dl-support.c: Move _dl_tls_* variables to ... + * sysdeps/generic/libc-tls.c: ... here. + + * elf/dl-close.c (remove_slotinfo): Take new argument. If false, + allow IDX to be one past the current last slotinfo entry. + (_dl_close): Pass IMAP->l_init_called for that parameter. + +2002-10-07 Andreas Schwab + + * aclocal.m4: Fix for autoconf 2.53. + * configure.in: Likewise. Require autoconf 2.53. + +2002-10-08 Richard Henderson + + * soft-fp/op-4.h: Handle carry correctly in + __FP_FRAC_ADD_3, __FP_FRAC_ADD_4, __FP_FRAC_SUB_3, + __FP_FRAC_SUB_4, __FP_FRAC_DEC_3, __FP_FRAC_DEC_4. + * soft-fp/op-common.h: New macros _FP_DIV_MEAT_N_loop. + +2002-10-08 Aldy Hernandez + + * configure.in: Compute completely-soft. + * config.make.in: Make completely-soft available to sub-makes. + * sysdeps/powerpc/soft-fp/Makefile: Add gcc-single-routines and + gcc-double-routines. Add sim-full.c. Add fenv_const and + fe_nomask to libm-support. + * sysdeps/powerpc/soft-fp/sim-full.c: New file. + * sysdeps/powerpc/soft-fp/fraiseexcpt.c: New file. + * sysdeps/powerpc/soft-fp/fegetexcept.c: New file. + * sysdeps/powerpc/soft-fp/fclrexcpt.c: New file. + * sysdeps/powerpc/soft-fp/ftestexcept.c: New file. + * sysdeps/powerpc/soft-fp/fgetexcptflg.c: New file. + * sysdeps/powerpc/soft-fp/fsetexcptflg.c: New file. + * sysdeps/powerpc/soft-fp/fedisblxcpt.c: New file. + * sysdeps/powerpc/soft-fp/feenablxcpt.c: New file. + * sysdeps/powerpc/soft-fp/fegetenv.c: New file. + * sysdeps/powerpc/soft-fp/fesetenv.c: New file. + * sysdeps/powerpc/soft-fp/fegetround.c: New file. + * sysdeps/powerpc/soft-fp/fesetround.c: New file. + * sysdeps/powerpc/soft-fp/feupdateenv.c: New file. + * sysdeps/powerpc/soft-fp/feholdexcpt.c: New file. + * sysdeps/powerpc/soft-fp/fenv_const.c: New file. + * sysdeps/powerpc/soft-fp/libm-test-ulps: New file. + * sysdeps/powerpc/soft-fp/soft-supp.h: New file. + * sysdeps/powerpc/soft-fp/Versions: Add libgcc soft-float + symbols. Add __sim_disabled_exceptions, __sim_exceptions, + __sim_round_mode. + * sysdeps/powerpc/soft-float/Dist: Add sim-full.c, fenv_const.c. + * sysdeps/powerpc/soft-float/sfp-machine.h: Define + FP_HANDLE_EXCEPTIONS. + Define FP_ROUNDMODE. + Redefine FP_* macros to correspond to the FE_* bit positions. + Define FP_DIV_MEAT_S to _FP_DIV_MEAT_1_loop. + Define externs for __sim_exceptions, __sim_disabled_exceptions, + __sim_round_mode, __simulate_exceptions. + * sysdeps/powerpc/fpu/bits/fenv.h: Move file from here... + * sysdeps/powerpc/bits/fenv.h: ...to here. + +2002-10-06 Jakub Jelinek + + * sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela): + Store R_PPC_UADDR32 and R_PPC_UADDR16 one byte at a time. + Use __builtin_expect for R_PPC_ADDR24 overflow check. Fix + R_PPC_ADDR16, R_PPC_UADDR16 and R_PPC_ADDR14* overflow check, use + __builtin_expect. + +2002-10-15 Jakub Jelinek + + * include/resolv.h (__libc_res_nquery, __libc_res_nsearch, + __libc_res_nsend): New prototypes. + * resolv/res_query.c (QUERYSIZE): Define. + (__libc_res_nquery): Renamed from res_nquery. Added answerp + argument. Allocate only QUERYSIZE bytes first, if res_nmkquery + fails use MAXPACKET buffer. Call __libc_res_nsend instead of + res_nsend, pass answerp. + (res_nquery): Changed into wrapper around __libc_res_nquery. + (__libc_res_nsearch): Renamed from res_nsearch. Added answerp + argument. Call __libc_res_nquerydomain and __libc_res_nquery + instead of the non-__libc_ variants, pass them answerp. + (res_nsearch): Changed into wrapper around __libc_res_nsearch. + (__libc_res_nquerydomain): Renamed from res_nquerydomain. + Added answerp argument. Call __libc_res_nquery instead of + res_nquery, pass answerp. + (res_nquerydomain): Changed into wrapper around + __libc_res_nquerydomain. + * resolv/res_send.c: Include sys/ioctl.h. + (MAXPACKET): Define. + (send_vc): Change arguments. Reallocate answer buffer if it is + too small. + (send_dg): Likewise. + (__libc_res_nsend): Renamed from res_nsend. Added ansp argument. + Reallocate answer buffer if it is too small and hooks are in use. + Adjust calls to send_vc and send_dg. + (res_nsend): Changed into wrapper around __libc_res_nsend. + * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Allocate + just 1K answer buffer on the stack, use __libc_res_nsearch instead + of res_nsearch. + (_nss_dns_gethostbyaddr_r): Similarly with __libc_res_nquery. + * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise. + (_nss_dns_getnetbyname_r): Similarly with __libc_res_nsearch. + * resolv/gethnamaddr.c (gethostbyname2): Likewise. + (gethostbyaddr): Similarly with __libc_res_nquery. + * resolv/Versions (libresolv): Export __libc_res_nquery and + __libc_res_nsearch at GLIBC_PRIVATE. + +2002-10-17 Roland McGrath + + * configure.in: Grok --without-__thread and disable HAVE___THREAD. + * configure: Regenerated. + + * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Do CHECK_STATIC_TLS + before performing the reloc, not after. + * sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise. + +2002-10-17 Ulrich Drepper + + * locale/programs/locale.c (write_locales): Use 'm' flag in fopen call. + * locale/programs/linereader.c (lr_open): Likewise. + * locale/programs/charmap-dir.c (charmap_open): Likewise. + * locale/programs/locarchive.c (add_locale_to_archive): Likewise. + +2002-10-17 Isamu Hasegawa + + * posix/bug-regex11.c: Add a test case for the bug reported by + Paolo Bonzini . + * posix/regexec.c (sift_states_bkref): Use correct destination of + the back reference. + +2002-10-17 Roland McGrath + + * elf/dl-load.c (_dl_map_object_from_fd): Don't check DF_STATIC_TLS. + * elf/dl-reloc.c (_dl_relocate_object: CHECK_STATIC_TLS): New macro + to signal error if an IE-model TLS reloc resolved to a dlopen'd module. + * sysdeps/i386/dl-machine.h (elf_machine_rel, elf_machine_rela): + Call it after performing TPOFF relocs. + * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise. + * sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise. + * elf/dl-conflict.c (CHECK_STATIC_TLS): New macro (no-op). + + * elf/dl-close.c (remove_slotinfo): Change asserts so as not to crash + when closing a partially-initialized object. + + * elf/dl-load.c (_dl_map_object_from_fd) [! USE_TLS]: Call lose + instead of _dl_fatal_printf when we see PT_TLS. + + * Makeconfig (CPPFLAGS): Fix last change to use $(libof-$( + + * cppflags-iterator.mk (CPPFLAGS-$(cpp-src)): Variable removed. + instead of += to append, to be sure $(lib) gets expanded at defn time. + (libof-$(cpp-src)): New variable, define this instead. + * extra-lib.mk (cpp-srcs-left): Reduce duplication in include setup. + (lib): Don't use override. + (CPPFLAGS-$(lib)): New variable, put -D's here. + * Makeconfig (CPPFLAGS): Use basename fn for CPPFLAGS-basename. + Also add $(CPPFLAGS-LIB) before the file-specific flags, for each + LIB found by $(libof-*) for basename, target, or source. + * Makerules (CPPFLAGS-nonlib): New variable. + * nscd/Makefile (lib): Set to nonlib when using cppflags-iterator.mk. + * locale/Makefile (lib): Likewise. + * sunrpc/Makefile (lib): Likewise. + + * sysdeps/unix/sysv/linux/fpathconf.c (LINUX_LINK_MAX): Move macro ... + * sysdeps/unix/sysv/linux/linux_fsinfo.h (LINUX_LINK_MAX): ... here. + * sysdeps/unix/sysv/linux/pathconf.h: New file. + (statfs_link_max): New function, guts from fpathconf.c. + * sysdeps/unix/sysv/linux/fpathconf.c: Rewritten using that. + * sysdeps/unix/sysv/linux/pathconf.c (__pathconf): Likewise. + * sysdeps/unix/sysv/linux/alpha/pathconf.c (__pathconf): Rewritten + to use the linux/pathconf.c code by #include rather than duplication. + * sysdeps/unix/sysv/linux/alpha/fpathconf.c (__pathconf): Likewise. + +2002-10-16 Jakub Jelinek + + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): + Use __libc_errno only for libc itself. + +2002-10-16 Andreas Jaeger + + * sysdeps/x86_64/_mcount.S: Fix off-by-1 error in argument access. + +2002-10-16 Ulrich Drepper + + * sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER): + Use __libc_errno only for libc itself. + +2002-10-15 Roland McGrath + Jakub Jelinek + + * sysdeps/unix/sysv/linux/Makefile + ($(objpfx)syscall-%.h $(objpfx)syscall-%.d): Take code from + sparc/Makefile to produce a bi-arch file as needed. + That's now parameterized by the variable $(64bit-predefine). + Use LC_ALL=C for `comm' commands in that rule. + No longer conditional on [$(no_syscall_list_h)]. + * sysdeps/unix/sysv/linux/sparc/Makefile: Remove replacement rules. + (64bit-predefine): New variable. + * sysdeps/unix/sysv/linux/x86_64/Makefile: Likewise. + * sysdeps/unix/sysv/linux/s390/Makefile: New file. + * sysdeps/unix/sysv/linux/powerpc/Makefile + (64bit-predefine): New variable. + +2002-10-15 Roland McGrath + + * sysdeps/unix/sysv/linux/Makefile + ($(objpfx)syscall-%.h $(objpfx)syscall-%.d) + + * login/utmp-private.h: Declare __libc_utmp_lock. + * sysdeps/unix/getlogin_r.c (getlogin_r): Take __libc_utmp_lock once + and call __libc_utmp_jump_table functions directly, instead of using + __setutent et al. + + * sysdeps/unix/sysv/linux/configure.in: Use case instead of if. + * sysdeps/unix/sysv/linux/configure: Regenerated. + + * sysdeps/gnu/bits/utmp.h: Include . + (struct lastlog) [__WORDSIZE == 64 && __WORDSIZE_COMPAT32]: + Use int32_t for ll_time. + (struct utmp) [__WORDSIZE == 64 && __WORDSIZE_COMPAT32]: + Use int32_t instead of long int for ut_session. + Use an anonymous struct with 32-bit fields for ut_tv. + * sysdeps/gnu/bits/utmpx.h: Include . + (struct utmpx) [__WORDSIZE == 64 && __WORDSIZE_COMPAT32]: Do the same + here as in utmp.h for `struct utmp'. + * sysdeps/unix/sysv/linux/powerpc/bits/utmp.h: File removed. + * sysdeps/unix/sysv/linux/powerpc/bits/utmpx.h: File removed. + * sysdeps/unix/sysv/linux/sparc/bits/utmp.h: File removed. + * sysdeps/unix/sysv/linux/sparc/bits/utmpx.h: File removed. + * sysdeps/unix/sysv/linux/x86_64/bits/utmp.h: File removed. + * sysdeps/unix/sysv/linux/x86_64/bits/utmpx.h: File removed. + + * sysdeps/unix/sysv/linux/bits/resource.h: Replaced with the contents + of the sysdeps/unix/sysv/linux/i386/bits/resource.h file. + All the following files were identical or equivalent to it. + * sysdeps/unix/sysv/linux/i386/bits/resource.h: File removed. + * sysdeps/unix/sysv/linux/arm/bits/resource.h: File removed. + * sysdeps/unix/sysv/linux/cris/bits/resource.h: File removed. + * sysdeps/unix/sysv/linux/hppa/bits/resource.h: File removed. + * sysdeps/unix/sysv/linux/ia64/bits/resource.h: File removed. + * sysdeps/unix/sysv/linux/m68k/bits/resource.h: File removed. + * sysdeps/unix/sysv/linux/powerpc/bits/resource.h: File removed. + * sysdeps/unix/sysv/linux/s390/bits/resource.h: File removed. + * sysdeps/unix/sysv/linux/sh/bits/resource.h: File removed. + * sysdeps/unix/sysv/linux/x86_64/bits/resource.h: File removed. + + * sysdeps/unix/sysv/linux/bits/socket.h (struct msghdr): Use size_t + instead of int for msg_iovlen, instead of socklen_t for msg_controllen. + Other than the previously incorrect sign of msg_iovlen, this is a + no-op on 32-bit platforms. On 64-bit platforms it makes this header + match their layouts as well, so the following are now identical to it. + * sysdeps/unix/sysv/linux/s390/bits/socket.h: File removed. + * sysdeps/unix/sysv/linux/sparc/bits/socket.h: File removed. + * sysdeps/unix/sysv/linux/x86_64/bits/socket.h: File removed. + * sysdeps/unix/sysv/linux/ia64/bits/socket.h: File removed. + * sysdeps/unix/sysv/linux/alpha/bits/socket.h: File removed. + +2002-10-15 Ulrich Drepper + + * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_VFORK_SYSCALL): + Define for 2.4+ kernels. + + * sysdeps/unix/sysv/linux/i386/vfork.S: Optimize for kernels which + are known to have the vfork syscall. Don't confuse the CPUs + branch prediction unit by jumping to the return address. + + * sysdeps/unix/sysv/linux/alpha/fpathconf.c (__fpathconf): Add + support for reiserfs and xfs. + + * sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Add case for + XFS link count. + * sysdeps/unix/sysv/linux/linux_fsinfo.h: Define XFS_SUPER_MAGIC + and XFS_LINK_MAX. + Patch by Eric Sandeen [PR libc/4706]. + +2002-10-16 Jakub Jelinek + + * include/libc-symbols.h (attribute_tls_model_ie): Define. + * include/errno.h (errno): Define to __libc_errno in libc.so. + Add attribute_tls_model_ie. + * include/netdb.h (h_errno): Define to __libc_h_errno in libc.so. + Add attribute_tls_model_ie. + * include/resolv.h (_res): Define to __libc_res in libc.so. Add + attribute_tls_model_ie. + * inet/herrno.c (__libc_h_errno): Add hidden alias to h_errno. + (h_errno): Define. + * resolv/res_libc.c (__libc_res): Add hidden alias to _res. + (_res): Define. + * sysdeps/generic/bits/libc-tsd.h (__libc_tsd_define): Add + attribute_tls_model_ie. + * sysdeps/generic/errno-loc.c (errno): Only undefine if not using + __thread. + * sysdeps/generic/errno.c (__libc_errno): Add hidden alias to errno. + * sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER): Use + __libc_errno in USE___THREAD case. + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): + Likewise. + * configure.in (HAVE_TLS_MODEL_ATTRIBUTE): Check for + __attribute__((tls_model (""))). + * configure: Rebuilt. + * config.h.in (HAVE_TLS_MODEL_ATTRIBUTE): Add. + +2002-10-15 Ulrich Drepper + + * timezone/asia: Update from tzdata2002d. + * timezone/australasia: Likewise. + * timezone/iso3166.tab: Likewise. + * timezone/southamerica: Likewise. + * timezone/zone-tab: Likewise. + +2002-10-15 Roland McGrath + + * sysdeps/generic/dl-tls.c (_dl_deallocate_tls) [TLS_TCB_AT_TP]: + Adjust TCB pointer before calling free, so we get the whole block. + +2002-10-14 Roland McGrath + + * sysdeps/unix/sysv/linux/x86_64/sigaction.c + [HAVE_HIDDEN && !HAVE_BROKEN_VISIBILITY_ATTRIBUTE]: Declare restore_rt + extern using attribute_hidden instead of static, avoids warning. + +2002-10-09 Jakub Jelinek + + * sysdeps/unix/sysv/linux/configure.in: Use */lib64 for s390x too. + * sysdeps/unix/sysv/linux/configure: Rebuilt. + +2002-10-14 Ulrich Drepper + + * po/sv.po: Update from translation team. + +2002-10-12 H.J. Lu + + * sunrpc/thrsvc.c (PROCQUIT): New. + (struct rpc_arg): New. + (dispatch): Call exit (0) if request->rq_proc == PROCQUIT. + (test_one_call): Take struct rpc_arg * instead of CLIENT *c. + (thread_wrapper): Modified for struct rpc_arg * and call PROCQUIT. + (main): Modified for struct rpc_arg *. + +2002-10-14 Ulrich Drepper + + * dirent/scandir.c: Rearrange code a bit to reduce binary size. + +2002-10-14 Jakub Jelinek + + * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Include tls.h. + (SYSCALL_ERROR_HANDLER): Use RTLD_PRIVATE_ERRNO sequence + in ld.so even if __thread is supported. + +2002-10-13 Jakub Jelinek + + * sysdeps/unix/sysv/linux/arm/profil-counter.h (profil_counter): + Add hack to prevent the compiler from clobbering the signal context. + * sysdeps/unix/sysv/linux/sh/profil-counter.h (profil_counter): + Likewise. + * sysdeps/unix/sysv/linux/x86_64/profil-counter.h (profil_counter): + Likewise. + +2002-10-14 Andreas Jaeger + + * sysdeps/mips/fpu/libm-test-ulps: Regenerated by + Guido Guenther . + +2002-10-14 Ulrich Drepper + + * po/sk.po: Update from translation team. + +2002-09-26 Roland McGrath + + * elf/dl-load.c (_dl_dst_count, _dl_dst_substitute): Handle $LIB + dynamic string tag. + * elf/Makefile ($(objpfx)trusted-dirs.st): Make the output define + DL_DST_LIB based on $(slibdir). + +2002-10-13 Roland McGrath + + * elf/rtld-Rules ($(objpfx)rtld-libc.a): Use $(verbose) in ar command. + + * sysdeps/mach/hurd/getresuid.c: New file. + * sysdeps/mach/hurd/getresgid.c: New file. + * sysdeps/mach/hurd/setresuid.c: New file. + * sysdeps/mach/hurd/setresgid.c: New file. + + * posix/unistd.h [__USE_GNU] (getresuid, getresgid, setresuid, + setresgid): Declare them. + * NEWS: Mention it. + * include/unistd.h + (__getresuid, __getresgid, __setresuid, __setresgid): Declare them, + add libc_hidden_proto. + * posix/Versions (libc: GLIBC_2.3.2): New set. Add + getresuid, getresgid, setresuid, setresgid here. + * Versions.def (libc): Define GLIBC_2.3.2 set. + * sysdeps/generic/getresuid.c (__getresuid): Fix argument types. + Add libc_hidden_def. + * sysdeps/generic/getresgid.c (__getresgid): Likewise. + * sysdeps/generic/setresgid.c: New file. + * sysdeps/generic/setresuid.c: New file. + * sysdeps/unix/sysv/linux/Makefile [$(subdir) = misc] + (sysdep_routines): Don't add getresuid and getresgid here. + * sysdeps/unix/sysv/linux/arm/Makefile [$(subdir) = misc] + (sysdep_routines): Don't add setresuid and setresgid here. + * sysdeps/unix/sysv/linux/cris/Makefile: Likewise. + * sysdeps/unix/sysv/linux/sh/Makefile: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/Makefile: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Likewise. + * sysdeps/unix/sysv/linux/i386/Makefile: Likewise. + * sysdeps/unix/sysv/linux/m68k/Makefile: Likewise. + * posix/Makefile (routines): Add them all here instead. + * sysdeps/unix/sysv/linux/i386/getresuid.c (getresuid): Renamed to + __getresuid. Add libc_hidden_def for that, and weak alias to old name. + * sysdeps/unix/sysv/linux/i386/getresgid.c (getresgid): Renamed to + __getresgid. Add libc_hidden_def for that, and weak alias to old name. + * sysdeps/unix/sysv/linux/i386/setresuid.c: Add libc_hidden_def. + [! __NR_setresuid]: Include generic file. + * sysdeps/unix/sysv/linux/i386/setresgid.c (setresgid): Renamed to + __setresgid. Add libc_hidden_def for that, and weak alias to old name. + [! __NR_setresuid]: Include generic file. + * sysdeps/unix/sysv/linux/syscalls.list (setresuid, setresgid): + Caller is - now, not EXTRA. + * sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list + (setresuid, setresgid, getresuid, getresgid): Likewise. + * sysdeps/unix/sysv/linux/syscalls.list (getresuid, getresgid): + Add these calls here. + * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove them here. + * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. + * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. + + * sysdeps/unix/sysv/linux/Makefile [$(subdir) = misc] + (sysdep_routines): Add setfsuid and setfsgid here. + * sysdeps/unix/sysv/linux/arm/Makefile: Not here. + * sysdeps/unix/sysv/linux/sparc/sparc32/Makefile: Likewise. + * sysdeps/unix/sysv/linux/cris/Makefile: Likewise. + * sysdeps/unix/sysv/linux/sh/Makefile: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/Makefile: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Likewise. + * sysdeps/unix/sysv/linux/i386/Makefile: Likewise. + * sysdeps/unix/sysv/linux/m68k/Makefile: Likewise. + + * hurd/errno.c: Renamed to ... + * hurd/errno-loc.c: ... this. + * hurd/Makefile (routines): errno -> errno-loc + +2002-10-13 Ulrich Drepper + + * po/de.po: Update from translation team. + + * MakeTAGS: Add -E flag to xgettext runs. + +2002-10-12 Ulrich Drepper + + * po/fr.po: Update from translation team. + + * sysdeps/posix/system.c: Remove support for old and buggy SCO systems. + Optimize a bit for use in glibc. + +2002-10-12 Roland McGrath + + * stdio-common/tst-rndseek.c (TIMEOUT): Increase to 10 seconds. + Some machines are slow. Guido Guenther has one. + +2002-10-12 Ulrich Drepper + + * po/sv.po: Update from translation team. + +2002-10-11 Isamu Hasegawa + + * posix/regcomp.c (re_compile_fastmap_iter): Remove the handling + OP_CONTEXT_NODE. + (regfree): Likewise. + (create_initial_state): Likewise. + (analyze): Remove the substitutions which became useless. + (calc_first): Likewise. + (calc_epsdest): Use edests of OP_BACK_REF in case that it has + epsilon destination. + (duplicate_node_closure): New function. + (duplicate_node): Remove the handling OP_CONTEXT_NODE. + (calc_inveclosure): Likewise. + (calc_eclosure): Likewise. + (calc_eclosure_iter): Invoke duplicate_node_closure instead of + direct invocation of duplicate_node. + (parse): Don't use comma operator in the return to avoid compiler + warning. + (parse_reg_exp): Likewise. + (parse_branch): Likewise. + (parse_expression): Likewise. + (parse_sub_exp): Likewise. + (parse_dup_op): Likewise. + * posix/regex_internal.c (re_dfa_add_node): Remove the substitutions + which became useless. + (create_ci_newstate): Remove the handling OP_CONTEXT_NODE. + (create_cd_newstate): Likewise. + * posix/regex_internal.h (re_token_type_t): Remove the obsolete type. + (re_token_t): Likewise. + (re_dfa_t): Likewise. + (re_node_set_remove): New macro. + * posix/regexec.c (check_matching): Remove the handling + OP_CONTEXT_NODE. + (check_halt_node_context): Likewise. + (proceed_next_node): Likewise. + (pop_fail_stack): Fix the memory leak. + (set_regs): Likewise. + (free_fail_stack_return): New function. + (sift_states_backward): Fix the memory leak. Remove the handling + OP_CONTEXT_NODE. + (update_cur_sifted_state): Append some if clause to avoid redundant + call. + (sub_epsilon_src_nodes): Use IS_EPSILON_NODE since it might be a + back reference. + (check_dst_limits): Remove the handling OP_CONTEXT_NODE. + (check_subexp_limits): Likewise. + (search_subexp): Likewise. + (sift_states_bkref): Likewise. + (transit_state_mb): Likewise. + (transit_state_bkref_loop): Likewise. + (transit_state_bkref_loop): Likewise. + (group_nodes_into_DFAstates): Likewise. + (check_node_accept): Likewise. + (sift_ctx_init): Add initializing. + +2002-10-12 Ulrich Drepper + + * sysdeps/unix/sysv/linux/i386/sysdep.h (INLINE_SYSCALL): Use + __builtin_expect. + +2002-10-11 Ulrich Drepper + + * elf/dl-load.c (_dl_map_object_from_fd): Remove unnecessarily + duplicated variable c. + + * sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Use INTERNAL_SYSCALL + if possible. + + * sysdeps/unix/sysv/linux/i386/sysdep.h + (INTERNAL_SYSCALL_ERROR_P): New define. + (INTERNAL_SYSCALL_ERRNO): Likewise. + + * sysdeps/unix/sysv/linux/i386/profil-counter.h (profil_counter): + Add hack to prevent the compiler from clobbering the signal context. + +2002-10-11 Roland McGrath + + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): + Fix typos. + + * sysdeps/generic/dl-lookupcfg.h: Include . + * sysdeps/sh/dl-lookupcfg.h: File removed. + * sysdeps/i386/dl-lookupcfg.h: File removed. + + * sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_ERROR_HANDLER): Add + missing labels and ; from last change. + + * stdio-common/tst-sscanf.c (val_double): Append .0 to large whole + number literals, so they are doubles instead of ints. + +2002-10-09 Roland McGrath + + * sysdeps/generic/bits/libc-tsd.h [USE___THREAD]: Conditional + changed from [USE_TLS && HAVE___THREAD]. + + * sysdeps/i386/dl-machine.h (elf_machine_type_class, elf_machine_rel): + Disable TLS relocs if [RTLD_BOOTSTRAP && !USE___THREAD]. + * sysdeps/x86_64/dl-machine.h + (elf_machine_type_class, elf_machine_rela): Likewise. + * sysdeps/sh/dl-machine.h (elf_machine_type_class, elf_machine_rela): + Likewise. + + * include/link.h (struct link_map): Remove member l_tls_tp_initialized. + * elf/rtld.c (_dl_start_final, dl_main): Don't use it. + (_dl_start): Conditionalize PT_TLS check on [USE___THREAD]. + + * sysdeps/i386/dl-tls.h (__TLS_GET_ADDR): Use ___tls_get_addr_internal + instead of ___tls_get_addr. + (___tls_get_addr_internal): Add attribute_hidden to decl. + + * sysdeps/generic/ldsodefs.h (struct rtld_global): New variable + _dl_error_catch_tsd. + * elf/rtld.c (startup_error_tsd): New function. + (dl_main): Point _dl_error_catch_tsd at that. + * elf/dl-error.c: Don't use libc-tsd.h for DL_ERROR, + use new function pointer instead. + * elf/dl-tsd.c: New file. + * elf/Makefile (routines): Add it. + +2002-10-07 Roland McGrath + + * elf/dl-misc.c (_dl_debug_vdprintf): Use INTERNAL_SYSCALL macro for + writev if it's available. Otherwise if [RTLD_PRIVATE_ERRNO] then + take _dl_load_lock around calling __writev. + + * sysdeps/unix/sysv/linux/i386/sysdep.h (INTERNAL_SYSCALL): New macro. + (INLINE_SYSCALL): Use that. + + * sysdeps/generic/dl-sysdep.h: New file. + * sysdeps/mach/hurd/dl-sysdep.h: New file. + * sysdeps/generic/ldsodefs.h: Include . + * include/errno.h [IS_IN_rtld]: Include to define ... + [RTLD_PRIVATE_ERRNO]: Use a hidden global variable for errno and + access it directly. + * elf/dl-minimal.c (__errno_location): Removed. + * sysdeps/unix/i386/sysdep.S (__syscall_errno) [RTLD_PRIVATE_ERRNO]: + Use GOTOFF access for errno. + * sysdeps/unix/sysv/linux/i386/sysdep.h + [RTLD_PRIVATE_ERRNO] (SYSCALL_ERROR_HANDLER): Likewise. + + * sysdeps/unix/x86_64/sysdep.S (__syscall_errno) [RTLD_PRIVATE_ERRNO]: + Use PC-relative access for errno. + * sysdeps/unix/sysv/linux/x86_64/sysdep.h + [RTLD_PRIVATE_ERRNO] (SYSCALL_ERROR_HANDLER): Likewise. + + * include/tls.h: New file. + (USE___THREAD): New macro. + Define to 1 under [USE_TLS && HAVE___THREAD] and only when compiling + libc or libpthread. + * sysdeps/unix/sysv/linux/i386/sysdep.h [USE___THREAD]: Conditional + changed from [USE_TLS && HAVE___THREAD]. + * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. + * sysdeps/unix/i386/sysdep.S: Likewise. + * sysdeps/unix/x86_64/sysdep.S: Likewise. + * include/errno.h: Likewise. + * include/netdb.h: Likewise. + * include/resolv.h: Likewise. + + * sysdeps/generic/errno.c: New file. + * csu/Makefile (aux): New variable, list errno. + * sysdeps/unix/sysv/linux/i386/sysdep.S (errno, _errno): Remove defns. + * sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/x86_64/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/arm/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/cris/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/hppa/sysdep.c: Likewise. + * sysdeps/unix/sysv/linux/ia64/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/powerpc/sysdep.c: Likewise. + * sysdeps/unix/sysv/linux/sparc/sysdep.S: Likewise. + * sysdeps/unix/sysv/linux/sh/sysdep.S: Likewise. + * sysdeps/unix/alpha/sysdep.S: Likewise. + * sysdeps/generic/start.c: Likewise. + * sysdeps/unix/start.c: Likewise. + * sysdeps/unix/arm/start.c: Likewise. + * sysdeps/unix/bsd/ultrix4/mips/start.S: Likewise. + * sysdeps/unix/sparc/start.c: Likewise. + * sysdeps/unix/sysv/irix4/start.c: Likewise. + * sysdeps/unix/sysv/linux/mips/sysdep.S: File removed. + + * manual/search.texi (Tree Search Function, Hash Search Function): + Mention search.h clearly. + +2002-10-05 Roland McGrath + + * elf/dl-fxstat64.c: File removed. + * elf/dl-xstat64.c: File removed. + * elf/Makefile (rtld-routines): Remove them. + * sysdeps/unix/sysv/linux/xstat64.c: Remove RTLD_STAT64 conditionals. + Instead, use strong_alias instead of versioned_symbol in the + !SHLIB_COMPAT case. + * sysdeps/unix/sysv/linux/fxstat64.c: Likewise. + * sysdeps/unix/sysv/linux/lxstat64.c: Likewise. + + * include/shlib-compat.h + (SHLIB_COMPAT): Require that IS_IN_##lib be defined nonzero. + [! NOT_IN_libc] (IS_IN_libc): Define it. + * cppflags-iterator.mk (CPPFLAGS-$(cpp-src)): Use -Dx=1 not just -Dx. + * elf/Makefile (CPPFLAGS-.os): Likewise. + + * sunrpc/rpc_main.c (main): Don't declare with noreturn attribute. + Return the status instead of calling exit. + + * Makeconfig (CFLAGS): Prepend -std=gnu99. + * Makerules (+make-deps): Use $(CFLAGS) only for .c sources. + Remove superfluous rm command, whose @ plus make bugs hid + all these commands from the make output. + + * include/stubs-prologue.h: New file. Give #error under #ifdef _LIBC. + * Makefile ($(inst_includedir)/gnu/stubs.h): Depend on it. + Use that file's contents instead of literal echo's for the prologue. + * include/features.h: Include unconditionally. + * include/gnu/stubs.h: New file. + +2002-09-30 Roland McGrath + + * elf/rtld-Rules: New file. + * elf/Makefile ($(objpfx)librtld.map, $(objpfx)librtld.mk, + $(objpfx)rtld-libc.a): New targets. + (generated): Add them. + (reloc-link): Remove -o $@ from the variable. + ($(objpfx)dl-allobjs.os): Add -o $@ after $(reloc-link). + (distribute): Add rtld-Rules. + (CPPFLAGS-.os): Define this instead of CFLAGS-.os. + * Makerules ($(+sysdir_pfx)sysd-rules): Emit rules for rtld-% targets. + (common-mostlyclean, common-clean): Clean up rtld-* files. + * sysdeps/unix/make-syscalls.sh: Add rtld-*.os target name to rules. + +2003-05-20 Jakub Jelinek + + * elf/dynamic-link.h (elf_get_dynamic_info): Add temp argument. + If temp != NULL, copy dynamic entries which need relocation to temp + array before relocating. + (DL_RO_DYN_TEMP_CNT): Define. + * elf/dl-load.c (_dl_map_object_from_fd): Adjust caller. + * elf/rtld.c (_dl_start): Likewise. + (dl_main): Likewise. Add dyn_temp static variable. + +2002-10-11 Roland McGrath + + * sysdeps/generic/dl-tls.c (__tls_get_addr): After freeing block in + now-unused dtv slot, reset the slot to TLS_DTV_UNALLOCATED. + + * elf/tls-macros.h [__x86_64__] (TLS_GD): Fix the sequence with the + proper set of no-op insn prefixes. + + * elf/tst-tls8.c (do_test): Use %zd format for l_tls_modid members. + +2002-10-11 Ulrich Drepper + + * sysdeps/unix/sysv/linux/execve.c: Don't try calling + __pthread_kill_other_threads_np. + + * sysdeps/generic/pselect.c: Avoid unnecessary sigprocmask calls. + +2002-10-08 Roland McGrath + + * locale/newlocale.c (__newlocale): If setting all categories to "C", + just return &_nl_C_locobj instead of copying it. + * locale/freelocale.c (__freelocale): Check for &_nl_C_locobj. + * locale/duplocale.c (__duplocale): Likewise. + +2002-10-07 Roland McGrath + + * config.h.in (HAVE_I386_SET_GDT): New #undef. + * sysdeps/mach/configure.in: Define it with new check for i386_set_gdt. + * sysdeps/mach/configure: Regenerated. + +2002-10-06 Franz Sirl + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INLINE_SYSCALL): + Add all necessary register outputs for syscall-clobbered registers. + +2002-10-02 David Mosberger + + * sysdeps/ia64/bzero.S: Rewritten by Sverre Jarp to tune for + Itanium 2 (and Itanium). + Fix unwind directives and make it fit in 80 columns. + * sysdeps/ia64/memset.S: Likewise. + * sysdeps/ia64/memcpy.S: Likewise. + Move jump table to .rodata section. + +2002-10-03 Roland McGrath + + * sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Add + clobbers to asm. + +2002-10-10 Andreas Jaeger + + * sysdeps/x86_64/_mcount.S: Restore correct registers. + +2002-10-10 Ulrich Drepper + + * posix/Versions (libc) [GLIBC_PRIVATE]: Add __pselect. + +2002-10-09 Ulrich Drepper + + * sysdeps/generic/ldsodefs.h: Remove attribute_hidden from + _dl_allocate_tls_init. Add rtld_hidden_proto. + * sysdeps/generic/dl-tls.c (_dl_allocate_tls_init): Add + rtld_hidden_def. + * elf/Versions (ld) [GLIBC_PRIVATE]: Add _dl_allocate_tls_init. + + * version.h (VERSION): Bump to 2.3.1. + + * Make-dist: Add back one of the tar invocations removed before. + + * stdlib/Makefile (distribute): Add allocalim.h. + + * sysdeps/generic/bits/libc-tsd.h [!(USE_TLS && HAVE___THREAD)] + (__libc_tsd_address): Use correct variable name. + Patch by Stefan Jones . + + * sysdeps/unix/sysv/linux/ia64/getcontext.S: Add missing ;;. + Reported by edwardsg@sgi.com [PR libc/4678]. + + * Versions.def (libc): Add GLIBC_2.3.1. + (libpthread): Add GLIBC_2.3.1. + + * include/signal.h: Add libc_hidden_proto for __sigwait, __sigwaitinfo, + and __sigtimedwait. + * signal/Versions: Add __sigtimedwait, __sigwait, and __sigwaitinfo. + * sysdeps/unix/sysv/linux/sigtimedwait.c (__sigtimedwait): Add + libc_hidden_def. + * sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Likewise. + * sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise. + + * include/sys/msg.h: Declare __libc_msgrcv and __libc_msgsnd. + * sysdeps/unix/sysv/linux/msgrcv.c (__msgrcv): Rename to __libc_msgrcv + and make old name an alias. + * sysdeps/unix/sysv/linux/msgsnd.c (__msgsnd): Rename to __libc_msgsnd + and make old name an alias. + * sysvipc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_msgrcv and + __libc_msgsnd. + + * include/sys/uio.h: Declare __libc_readv and __libc_writev. + * misc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_readv and + __libc_writev. + * sysdeps/generic/readv.c (__readv): Rename to __libc_readv and make + old name an alias. + * sysdeps/posix/readv.c: Likewise + * sysdeps/unix/sysv/aix/readv.c: Likewise. + * sysdeps/unix/sysv/linux/readv.c: Likewise. + * sysdeps/generic/writev.c (__writev): Rename to __libc_writev and make + old name an alias. + * sysdeps/posix/writev.c: Likewise + * sysdeps/unix/sysv/aix/writev.c: Likewise. + * sysdeps/unix/sysv/linux/writev.c: Likewise. + + * include/sys/wait.h: Declare __waitid. + * posix/Versions (libc) [GLIBC_PRIVATE]: Add __waitid. + * sysdeps/generic/waitid.c (waitid): Rename to __waitid and make old + name an alias. + * sysdeps/posix/waitid.c: Likewise. + * sysdeps/unix/sysv/aix/waitid.c: Likewise. + + * sysdeps/unix/sysv/linux/syscalls.list: Add creat syscall. + +2002-10-07 Jakub Jelinek + + * include/alloca.h (__libc_use_alloca, __libc_alloca_cutoff): New + prototypes. + (__MAX_ALLOCA_CUTOFF): Define. + Include allocalim.h. + * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r, + _nss_dns_gethostbyaddr_r): Use alloca or malloc to allocate + host_buffer depending on __libc_use_alloca. + * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r, + _nss_dns_getnetbyaddr_r): Use alloca or malloc to allocate + net_buffer depending on __libc_use_alloca. + * resolv/res_query.c (res_nquery): Use alloca or malloc to allocate + buf depending on __libc_use_alloca. + * resolv/gethnamaddr.c (gethostbyname2, gethostbyaddr): Likewise. + * stdio-common/vfprintf.c (vfprintf): Use __libc_use_alloca + instead of hardcoded constants. + Pass proper size argument to alloca and compute end for wide char + version. + * stdio-common/printf_fp.c (__printf_fp): Use __libc_use_alloca + instead of hardcoded constants. + * string/strcoll.c (strcoll): Likewise. + * string/strxfrm.c (strxfrm): Likewise. + * sysdeps/posix/readv.c (__readv): Likewise. + * sysdeps/posix/writev.c (__writev): Likewise. + * sysdeps/generic/allocalim.h: New file. + +2002-10-08 Roland McGrath + + * configure.in (aux_missing warning): Change "too old" to + "incompatible versions", since for autoconf it's "too new" right now. + * configure: Regenerated. + + * configure.in (AUTOCONF): New check to set it. Set to "no" if the + one found doesn't work on our configure.in. + * configure: Regenerated. + * config.make.in (AUTOCONF): New substituted variable. + * Makefile (autoconf-it-cvs): New canned sequence, broken out of ... + (autoconf-it): ... here, use that instead of defining conditionally. + Use $(AUTOCONF) instead of literal autoconf. + [$(AUTOCONF) != no] (configure, %/configure): Protect these rules + with this condition. + * Make-dist (autoconf-it, configure, %/configure): Copy those changes. + +2002-10-08 Ulrich Drepper + + * Make-dist (dist): Cleanup a bit. We are not interested in the + 14 char filename limit anymore. Remove intermediate files and + symlinks. + +2002-10-05 Ulrich Drepper + + * po/sk.po: Update from translation team. + * po/tr.po: Likewise. + * po/gl.po: Likewise. + +2002-10-05 Kaz Kojima + + * elf/tls-macros.h: Fix SH version of macros so as to match ABI syntax. + +2002-10-03 Ulrich Drepper + + * version.h (RELEASE): Change to stable. + +2002-10-03 Jakub Jelinek + + * sysdeps/unix/sysv/linux/_exit.c (__syscall_exit, + __syscall_exit_group): New prototypes. + +2002-10-03 Ulrich Drepper + + * glibc 2.3 released. + + +See ChangeLog.13 for earlier changes.