[uClibc-cvs] svn commit: branches/uClibc-nptl: include libc/inet/rpc libc/sysdeps/linux etc...
sjhill at uclibc.org
sjhill at uclibc.org
Sun Jun 12 02:15:13 UTC 2005
Author: sjhill
Date: 2005-06-11 20:15:11 -0600 (Sat, 11 Jun 2005)
New Revision: 10536
Log:
Changed files for glibc compatibility so that more NPTL files would build.
Modified:
branches/uClibc-nptl/include/features.h
branches/uClibc-nptl/include/netdb.h
branches/uClibc-nptl/libc/inet/rpc/rpc_thread.c
branches/uClibc-nptl/libc/sysdeps/linux/mips/sys/asm.h
branches/uClibc-nptl/libc/sysdeps/linux/mips/sys/regdef.h
branches/uClibc-nptl/libpthread/nptl/compat/libc-internal.h
branches/uClibc-nptl/libpthread/nptl/compat/libc-symbols.h
branches/uClibc-nptl/libpthread/nptl/pt-system.c
branches/uClibc-nptl/libpthread/nptl/sem_open.c
branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/tls.h
Changeset:
Modified: branches/uClibc-nptl/include/features.h
===================================================================
--- branches/uClibc-nptl/include/features.h 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/include/features.h 2005-06-12 02:15:11 UTC (rev 10536)
@@ -280,6 +280,14 @@
# define __GLIBC_MINOR__ 2
#endif
+/*
+ * NPTL requires this to be defined. Unfortunately, due to complexities
+ * in include dependencies, this cannot be defined on a per file basis.
+ */
+#ifdef __PTHREADS_NATIVE__
+# define __USE_XOPEN2K 1
+#endif
+
/* Convenience macros to test the versions of glibc and gcc.
Use them like this:
#if __GNUC_PREREQ (2,8)
Modified: branches/uClibc-nptl/include/netdb.h
===================================================================
--- branches/uClibc-nptl/include/netdb.h 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/include/netdb.h 2005-06-12 02:15:11 UTC (rev 10536)
@@ -53,8 +53,13 @@
__BEGIN_DECLS
+#include <tls.h>
+#ifdef USE___THREAD
+extern __thread int h_errno attribute_tls_model_ie;
+#else
/* Error status for non-reentrant lookup functions. */
extern int h_errno;
+#endif
/* Function to get address of global `h_errno' variable. */
extern int *__h_errno_location (void) __THROW __attribute__ ((__const__));
Modified: branches/uClibc-nptl/libc/inet/rpc/rpc_thread.c
===================================================================
--- branches/uClibc-nptl/libc/inet/rpc/rpc_thread.c 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/libc/inet/rpc/rpc_thread.c 2005-06-12 02:15:11 UTC (rev 10536)
@@ -9,8 +9,13 @@
/* Variable used in non-threaded applications or for the first thread. */
static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem;
+#ifdef __PTHREADS_NATIVE__
+static struct rpc_thread_variables *__libc_tsd_RPC_VARS =
+ &__libc_tsd_RPC_VARS_mem;
+#else
static struct rpc_thread_variables *__libc_tsd_RPC_VARS_data =
&__libc_tsd_RPC_VARS_mem;
+#endif
/*
* Task-variable destructor
@@ -77,7 +82,11 @@
if (tvp != NULL)
__libc_tsd_set (RPC_VARS, tvp);
else
+#ifdef __PTHREADS_NATIVE__
+ tvp = __libc_tsd_RPC_VARS;
+#else
tvp = __libc_tsd_RPC_VARS_data;
+#endif
}
}
return tvp;
Modified: branches/uClibc-nptl/libc/sysdeps/linux/mips/sys/asm.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/mips/sys/asm.h 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/libc/sysdeps/linux/mips/sys/asm.h 2005-06-12 02:15:11 UTC (rev 10536)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf at gnu.org>.
@@ -37,11 +38,11 @@
* 64 bit address space isn't used yet, so we may use the R3000 32 bit
* defines for now.
*/
-#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+#if _MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIN32
# define PTR .word
# define PTRSIZE 4
# define PTRLOG 2
-#elif (_MIPS_SIM == _MIPS_SIM_ABI64)
+#elif _MIPS_SIM == _ABI64
# define PTR .dword
# define PTRSIZE 8
# define PTRLOG 3
@@ -50,7 +51,7 @@
/*
* PIC specific declarations
*/
-#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+#if _MIPS_SIM == _ABIO32
# ifdef __PIC__
# define CPRESTORE(register) \
.cprestore register
@@ -97,7 +98,7 @@
# define SETUP_GPX64_L(cp_reg, ra_save, l)
# define RESTORE_GP64
# define USE_ALT_CP(a)
-#else /* (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32) */
+#else /* _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32 */
/*
* For callee-saved gp calling convention:
*/
@@ -131,15 +132,15 @@
/* Use alternate register for context pointer. */
# define USE_ALT_CP(reg) \
.cplocal reg
-#endif /* _MIPS_SIM != _MIPS_SIM_ABI32 */
+#endif /* _MIPS_SIM != _ABIO32 */
/*
* Stack Frame Definitions
*/
-#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+#if _MIPS_SIM == _ABIO32
# define NARGSAVE 4 /* Space for 4 argument registers must be allocated. */
#endif
-#if (_MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32)
+#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32
# define NARGSAVE 0 /* No caller responsibilities. */
#endif
@@ -287,7 +288,7 @@
/*
* Stack alignment
*/
-#if (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32
# define ALSZ 15
# define ALMASK ~15
#else
@@ -298,7 +299,7 @@
/*
* Size of a register
*/
-#if (_MIPS_SIM == _MIPS_SIM_ABI64) || (_MIPS_SIM == _MIPS_SIM_NABI32)
+#if _MIPS_SIM == _ABI64 || _MIPS_SIM == _ABIN32
# define SZREG 8
#else
# define SZREG 4
@@ -389,7 +390,7 @@
/*
* How to add/sub/load/store/shift pointers.
*/
-#if (_MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 32)
+#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 32)
# define PTR_ADD add
# define PTR_ADDI addi
# define PTR_ADDU addu
@@ -411,7 +412,7 @@
# define PTR_SCALESHIFT 2
#endif
-#if _MIPS_SIM == _MIPS_SIM_NABI32
+#if _MIPS_SIM == _ABIN32
# define PTR_ADD add
# define PTR_ADDI addi
# define PTR_ADDU add /* no u */
@@ -433,8 +434,8 @@
# define PTR_SCALESHIFT 2
#endif
-#if (_MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 64 /* o64??? */) \
- || _MIPS_SIM == _MIPS_SIM_ABI64
+#if (_MIPS_SIM == _ABIO32 && _MIPS_SZPTR == 64 /* o64??? */) \
+ || _MIPS_SIM == _ABI64
# define PTR_ADD dadd
# define PTR_ADDI daddi
# define PTR_ADDU daddu
@@ -470,4 +471,20 @@
# define MTC0 dmtc0
#endif
+/* The MIPS archtectures do not have a uniform memory model. Particular
+ platforms may provide additional guarantees - for instance, the R4000
+ LL and SC instructions implicitly perform a SYNC, and the 4K promises
+ strong ordering.
+
+ However, in the absence of those guarantees, we must assume weak ordering
+ and SYNC explicitly where necessary.
+
+ Some obsolete MIPS processors may not support the SYNC instruction. This
+ applies to "true" MIPS I processors; most of the processors which compile
+ using MIPS I implement parts of MIPS II. */
+
+#ifndef MIPS_SYNC
+# define MIPS_SYNC sync
+#endif
+
#endif /* sys/asm.h */
Modified: branches/uClibc-nptl/libc/sysdeps/linux/mips/sys/regdef.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/mips/sys/regdef.h 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/libc/sysdeps/linux/mips/sys/regdef.h 2005-06-12 02:15:11 UTC (rev 10536)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf at gnu.org>.
@@ -20,6 +20,8 @@
#ifndef _SYS_REGDEF_H
#define _SYS_REGDEF_H
+#include <sgidefs.h>
+
/*
* Symbolic register names for 32 bit ABI
*/
@@ -31,7 +33,7 @@
#define a1 $5
#define a2 $6
#define a3 $7
-#if _MIPS_SIM != _MIPS_SIM_ABI32
+#if _MIPS_SIM != _ABIO32
#define a4 $8
#define a5 $9
#define a6 $10
@@ -44,7 +46,7 @@
#define ta1 a5
#define ta2 a6
#define ta3 a7
-#else /* if _MIPS_SIM == _MIPS_SIM_ABI32 */
+#else /* if _MIPS_SIM == _ABIO32 */
#define t0 $8 /* caller saved */
#define t1 $9
#define t2 $10
@@ -57,7 +59,7 @@
#define ta1 t5
#define ta2 t6
#define ta3 t7
-#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+#endif /* _MIPS_SIM == _ABIO32 */
#define s0 $16 /* callee saved */
#define s1 $17
#define s2 $18
Modified: branches/uClibc-nptl/libpthread/nptl/compat/libc-internal.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/compat/libc-internal.h 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/libpthread/nptl/compat/libc-internal.h 2005-06-12 02:15:11 UTC (rev 10536)
@@ -5,6 +5,9 @@
# define _LIBC_INTERNAL 1
#include <hp-timing.h>
+#ifdef __UCLIBC__
+#include <libc-symbols.h>
+#endif
/* Initialize the `__libc_enable_secure' flag. */
extern void __libc_init_secure (void);
Modified: branches/uClibc-nptl/libpthread/nptl/compat/libc-symbols.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/compat/libc-symbols.h 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/libpthread/nptl/compat/libc-symbols.h 2005-06-12 02:15:11 UTC (rev 10536)
@@ -1,12 +1,31 @@
#ifndef _LIBC_SYMBOLS_H
#define _LIBC_SYMBOLS_H 1
-/*
- * NPTL - These definitions were taken from 'include/libc-symbols.h'
- * in glibc. We are going to use the empty macros for now
- * until we run into other compile errors that force us to
- * do otherwise.
- */
+/* Handling on non-exported internal names. We have to do this only
+ for shared code. */
+#ifdef SHARED
+# define INTUSE(name) name##_internal
+# define INTDEF(name) strong_alias (name, name##_internal)
+# define INTVARDEF(name) \
+ _INTVARDEF (name, name##_internal)
+# if defined HAVE_VISIBILITY_ATTRIBUTE
+# define _INTVARDEF(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name), \
+ visibility ("hidden")));
+# else
+# define _INTVARDEF(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+# endif
+# define INTDEF2(name, newname) strong_alias (name, newname##_internal)
+# define INTVARDEF2(name, newname) _INTVARDEF (name, newname##_internal)
+#else
+# define INTUSE(name) name
+# define INTDEF(name)
+# define INTVARDEF(name)
+# define INTDEF2(name, newname)
+# define INTVARDEF2(name, newname)
+#endif
+
#if 0
# ifndef __ASSEMBLER__
# if !defined HAVE_VISIBILITY_ATTRIBUTE \
Modified: branches/uClibc-nptl/libpthread/nptl/pt-system.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/pt-system.c 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/libpthread/nptl/pt-system.c 2005-06-12 02:15:11 UTC (rev 10536)
@@ -22,6 +22,11 @@
#include <sysdep.h>
#include "pthreadP.h"
+/* Compatibility define. */
+#ifdef __UCLIBC__
+#include <sysdep-cancel.h>
+#define __libc_system system
+#endif
int
system (const char *line)
Modified: branches/uClibc-nptl/libpthread/nptl/sem_open.c
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sem_open.c 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/libpthread/nptl/sem_open.c 2005-06-12 02:15:11 UTC (rev 10536)
@@ -18,6 +18,9 @@
02111-1307 USA. */
#include <errno.h>
+#ifdef __PTHREADS_NATIVE__
+#define __USE_GNU
+#endif
#include <fcntl.h>
#include <mntent.h>
#include <paths.h>
@@ -36,6 +39,17 @@
#include "semaphoreP.h"
+/* Compatibility defines. */
+#if __UCLIBC__
+#define __endmntent endmntent
+#define __fxstat64(vers, fd, buf) fstat64(fd, buf)
+#define __getmntent_r getmntent_r
+#define __setmntent setmntent
+#define __statfs statfs
+#define __libc_close close
+#define __libc_open open
+#define __libc_write write
+#endif
/* Information about the mount point. */
struct mountpoint_info mountpoint attribute_hidden;
Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/tls.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/tls.h 2005-06-12 01:57:45 UTC (rev 10535)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/mips/tls.h 2005-06-12 02:15:11 UTC (rev 10536)
@@ -59,7 +59,7 @@
/* We require TLS support in the tools. */
/*
* NPTL - These defines would normally be handled by the top-level
- * configure script in glibc. We define them ourselves.
+ * configure script in glibc.
*/
#ifdef __PTHREADS_NATIVE__
#define HAVE_TLS_SUPPORT 1
@@ -84,7 +84,7 @@
/* Get the thread descriptor definition. */
#ifdef __UCLIBC__
-# include <descr.h>
+# include <../../descr.h>
#else
# include <nptl/descr.h>
#endif
More information about the uClibc-cvs
mailing list