Pārlūkot izejas kodu

Patch from Stefan Allius <allius@atecom.com>:
-----------------------------------
In extra/Configs/Config.sh
I added the INCLUDE_PTHREADS statement and change the default values for
BUILD_UCLIBC_LDSO and HAVE_SHARED.
-----------------------------------
In extra/scripts/initfini.pl
My last patch removes two labels, which migth be used by the .size statements.
(Sorry, but I'm a perl beginner) I fixed it.
-----------------------------------
In libc/sysdeps/linux/common/initfini.c
I fixed two warnings "nested extern declaration of `i_am_not_a_leaf..
-----------------------------------
In libc/sysdeps/linux/sh/__init_brl.c brk.c sbrk.c
I fixed some compiler warnings which comes from a wrong
inclusion order.
-----------------------------------

Eric Andersen 22 gadi atpakaļ
vecāks
revīzija
a64f4d5b57

+ 6 - 2
extra/Configs/Config.sh

@@ -144,6 +144,10 @@ INCLUDE_FULL_RPC = false
 # Protocol: IP version 6, enable this.  This is off by default.
 INCLUDE_IPV6 = false
 
+# If you want to include threads support, enable this.  The C library will
+# be compiled thread-safe, and the libpthread library will be built.
+INCLUDE_THREADS = true
+
 # If you want to support only Unix 98 PTYs enable this.  Some older
 # applications may need this disabled.  For most current programs, 
 # you can generally leave this true.
@@ -162,10 +166,10 @@ DOPIC = false
 
 # Enable support for shared libraries?  If this is false, you can
 # ignore all the rest of the options in this file...
-HAVE_SHARED = false
+HAVE_SHARED = true
 
 # uClibc has a native shared library loader for some architectures.
-BUILD_UCLIBC_LDSO=false
+BUILD_UCLIBC_LDSO= true
 
 # If you are using shared libraries, but do not want/have a native
 # uClibc shared library loader, please specify the name of your

+ 2 - 5
extra/scripts/initfini.pl

@@ -11,7 +11,6 @@ my($endp)	    = 0;
 my($end)	    = 0;
 my($omitcrti)	    = 0;
 my($omitcrtn)	    = 0;
-my($discard)	    = 0;
 my($line);
 
 # Get commandline parameters
@@ -85,7 +84,6 @@ while(<INITFINI>) {
 	next;
     }
     if (/i_am_not_a_leaf/) {
-	$discard = 1;
 	next;
     }
     if (/^_init:/ || /^_fini:/) {
@@ -145,13 +143,12 @@ while(<INITFINI>) {
 	    s/ALIGN//;
 	}
     }
-    if (!$omitcrti && !$discard) {
+    if (!$omitcrti) {
 	print CRTI;
     }
-    if (!$omitcrtn && !$discard) {
+    if (!$omitcrtn) {
 	print CRTN;
     }
-    $discard = 0;
 }
 close(INITFINI);
 close(CRTI);

+ 2 - 2
libc/sysdeps/linux/common/initfini.c

@@ -84,6 +84,7 @@ call_gmon_start(void)
 SECTION (".init")
 HIDDEN(_init)
 
+extern void i_am_not_a_leaf (void);
 extern void _init (void);
 void _init (void)
 {
@@ -101,7 +102,6 @@ void _init (void)
     /* Let GCC know that _init is not a leaf function by having a dummy
      * function call here.  We arrange for this call to be omitted from
      * either crt file.  */
-    extern void i_am_not_a_leaf (void);
     i_am_not_a_leaf ();
   }
   asm ("\n/*@_init_PROLOG_UNPAUSES*/");
@@ -121,6 +121,7 @@ asm ("\n/*@_fini_PROLOG_BEGINS*/");
 SECTION (".fini")
 HIDDEN(_fini)
 
+extern void i_am_not_a_leaf2 (void);
 extern void _fini (void);
 void _fini (void)
 {
@@ -134,7 +135,6 @@ void _fini (void)
     /* Let GCC know that _fini is not a leaf function by having a dummy
        function call here.  We arrange for this call to be omitted from
        either crt file.  */
-    extern void i_am_not_a_leaf2 (void);
     i_am_not_a_leaf2 ();
   }
 

+ 2 - 2
libc/sysdeps/linux/sh/__init_brk.c

@@ -1,8 +1,8 @@
 /* From libc-5.3.12 */
 
+#include <errno.h>
 #include <unistd.h>
 #include <sys/syscall.h>
-#include <errno.h>
 
 void * ___brk_addr = 0;
 
@@ -10,7 +10,7 @@ void * ___brk_addr = 0;
 _syscall1(void *, _brk, void *, ptr);
 
 int
-__init_brk ()
+__init_brk (void)
 {
     if (___brk_addr == 0)
     {

+ 2 - 2
libc/sysdeps/linux/sh/brk.c

@@ -1,12 +1,12 @@
 /* From libc-5.3.12 */
 
+#include <errno.h>
 #include <unistd.h>
 #include <sys/syscall.h>
-#include <errno.h>
 
 extern void * ___brk_addr;
 
-extern int __init_brk ();
+extern int __init_brk (void);
 extern void *_brk(void *ptr);
 
 int brk(void * end_data_seg)

+ 2 - 2
libc/sysdeps/linux/sh/sbrk.c

@@ -1,8 +1,8 @@
 /* From libc-5.3.12 */
 
+#include <errno.h>
 #include <unistd.h>
 #include <sys/syscall.h>
-#include <errno.h>
 
 extern void * ___brk_addr;
 
@@ -14,7 +14,7 @@ sbrk(intptr_t increment)
 {
     if (__init_brk () == 0)
     {
-		void * tmp = ___brk_addr+increment;
+		char * tmp = (char*)___brk_addr+increment;
 		___brk_addr = _brk(tmp);
 		if (___brk_addr == tmp)
 			return tmp-increment;