about summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ioperm.c4
-rw-r--r--sysdeps/unix/sysv/linux/init-first.c54
-rw-r--r--sysdeps/unix/sysv/linux/sys/io.h4
5 files changed, 30 insertions, 38 deletions
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 7d83718e5c..02b44a8fc5 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -1,3 +1,7 @@
+ifeq ($(subdir), csu)
+CFLAGS-init-first.c = -fkeep-inline-functions
+endif
+
 ifeq ($(subdir), misc)
 sysdep_routines += sysctl clone
 
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index 9d596719da..3908b5703c 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -2,5 +2,5 @@ ifeq ($(subdir), misc)
 sysdep_headers += alpha/ptrace.h alpha/regdef.h
 
 sysdep_routines += ieee_get_fp_control ieee_set_fp_control \
-		   sethae ioperm osf_sigprocmask fstatfs statfs
+		   sethae ioperm osf_sigprocmask fstatfs statfs llseek
 endif
diff --git a/sysdeps/unix/sysv/linux/alpha/ioperm.c b/sysdeps/unix/sysv/linux/alpha/ioperm.c
index d24eabe473..a91608ff24 100644
--- a/sysdeps/unix/sysv/linux/alpha/ioperm.c
+++ b/sysdeps/unix/sysv/linux/alpha/ioperm.c
@@ -52,7 +52,7 @@ I/O address space that's 512MB large!).  */
 #define vuip		volatile unsigned int *
 
 #define JENSEN_IO_BASE		(0xfffffc0300000000UL)
-#define JENSEN_MEM		(0xfffffc0200000000UL)	/* sparse!! */
+#define JENSEN_SPARSE_MEM	(0xfffffc0200000000UL)
 
 /*
  * With respect to the I/O architecture, APECS and LCA are identical,
@@ -94,7 +94,7 @@ static struct platform {
   {"EB64+",	IOSYS_APECS,	APECS_DENSE_MEM,	APECS_SPARSE_MEM},
   {"EB66",	IOSYS_APECS,	APECS_DENSE_MEM,	APECS_SPARSE_MEM},
   {"EB66P",	IOSYS_APECS,	APECS_DENSE_MEM,	APECS_SPARSE_MEM},
-  {"Jensen",	IOSYS_JENSEN,	JENSEN_MEM,		JENSEN_MEM},
+  {"Jensen",	IOSYS_JENSEN,	0,			JENSEN_SPARSE_MEM},
   {"Mikasa",	IOSYS_APECS,	APECS_DENSE_MEM,	APECS_SPARSE_MEM},
   {"Mustang",	IOSYS_APECS,	APECS_DENSE_MEM,	APECS_SPARSE_MEM},
   {"Noname",	IOSYS_APECS,	APECS_DENSE_MEM,	APECS_SPARSE_MEM},
diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c
index 267c01afc8..feff028a28 100644
--- a/sysdeps/unix/sysv/linux/init-first.c
+++ b/sysdeps/unix/sysv/linux/init-first.c
@@ -29,10 +29,12 @@ extern void __libc_global_ctors (void);
 /* The function is called from assembly stubs the compiler can't see.  */
 static void init (void *) __attribute__ ((unused));
 
-extern int __libc_is_static;
-#ifdef PIC
-weak_extern (__libc_is_static)
-#endif
+extern int _dl_starting_up;
+weak_extern (_dl_starting_up)
+
+/* Set nonzero if we have to be prepared for more then one libc being
+   used in the process.  Safe assumption if initializer never runs.  */
+int __libc_multiple_libcs = 1;
 
 static void
 init (void *data)
@@ -43,39 +45,21 @@ init (void *data)
   char **argv = (char **)data + 1;
   char **envp = &argv[argc + 1];
 
-  /* XXX Another gcc bug.  We marked the function as `unused' but it
-     is still optimized away.  */
-  volatile void *foo __attribute__ ((unused)) = &init;
 
-#ifdef PIC
-  if (&__libc_is_static != NULL)
-#endif
+  __libc_multiple_libcs = &_dl_starting_up && ! _dl_starting_up;
+
+  /* We must not call `personality' twice.  */
+  if (!__libc_multiple_libcs)
     {
-#ifdef PIC
-      /* We must not call `personality' twice.  */
-      if (__libc_is_static == 0)
-#endif
-	{
-	  /* The `personality' system call takes one argument that
-	     chooses the "personality", i.e. the set of system calls
-	     and such.  We must make this call first thing to disable
-	     emulation of some other system that might have been
-	     enabled by default based on the executable format.  */
-	  __personality (PER_LINUX);
-
-	  /* Set the FPU control word to the proper default value.  */
-	  __setfpucw (__fpu_control);
-	}
-
-      /* We set LIBC_IS_STATIC to a value > 0 for the static library
-	 and < 0 for the shared library.  This information might be
-	 useful for the running program but it is mainly necessary for
-	 the above `if' statement.  */
-#ifdef PIC
-      __libc_is_static = -1;
-#else
-      __libc_is_static = 1;
-#endif
+      /* The `personality' system call takes one argument that chooses
+	 the "personality", i.e. the set of system calls and such.  We
+	 must make this call first thing to disable emulation of some
+	 other system that might have been enabled by default based on
+	 the executable format.  */
+      __personality (PER_LINUX);
+
+      /* Set the FPU control word to the proper default value.  */
+      __setfpucw (__fpu_control);
     }
 
   __environ = envp;
diff --git a/sysdeps/unix/sysv/linux/sys/io.h b/sysdeps/unix/sysv/linux/sys/io.h
index 6f0b9aba14..6b4de65c9c 100644
--- a/sysdeps/unix/sysv/linux/sys/io.h
+++ b/sysdeps/unix/sysv/linux/sys/io.h
@@ -21,6 +21,8 @@ Cambridge, MA 02139, USA.  */
 #define	_SYS_IO_H	1
 #include <features.h>
 
+__BEGIN_DECLS
+
 /* Get constants from kernel header files. */
 #include <asm/io.h>
 
@@ -39,4 +41,6 @@ extern int ioperm __P ((unsigned long int __from, unsigned long int __num,
    privileges. */
 extern int iopl __P ((int __level));
 
+__END_DECLS
+
 #endif /* _SYS_IO_H */