patches/uClibc/0.9.32/120-ctor-dtor-nptl-Fix-init-and-fini-function-compilation.patch
author "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
Thu Aug 18 16:05:48 2011 +0200 (2011-08-18)
changeset 2612 a52574521bea
permissions -rw-r--r--
debug/gdb: update GDB revisions

Update GDB with the latest available revisions.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
     1 commit f9e311d11c374e68736c741ede1845bdc8091627
     2 Author: Khem Raj <raj.khem@gmail.com>
     3 Date:   Mon Jun 13 16:30:55 2011 -0700
     4 
     5     ctor/dtor nptl: Fix init and fini function compilation
     6     
     7     We need to define the rules for .S files so it
     8     gets the include paths some architectures like mips
     9     include headers
    10     
    11     Some architectures e.g. SH have their own version
    12     of pt-initfini.c so look for that first before resorting
    13     to generic version of pt-initfini.c
    14     
    15     Signed-off-by: Khem Raj <raj.khem@gmail.com>
    16     Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
    17 
    18 diff --git a/libc/sysdeps/linux/mips/crtn.S b/libc/sysdeps/linux/mips/crtn.S
    19 index cedd593..f3756a2 100644
    20 --- a/libc/sysdeps/linux/mips/crtn.S
    21 +++ b/libc/sysdeps/linux/mips/crtn.S
    22 @@ -10,7 +10,6 @@
    23  #NO_APP
    24  	.align	2
    25  	.globl	_init
    26 -	.ent	_init
    27  	.type	_init, @function
    28  #NO_APP
    29  	lw	$31,28($sp)
    30 @@ -22,14 +21,12 @@
    31  	.set	macro
    32  	.set	reorder
    33  
    34 -	.end	_init
    35  #APP
    36  	
    37  	.section .fini
    38  #NO_APP
    39  	.align	2
    40  	.globl	_fini
    41 -	.ent	_fini
    42  	.type	_fini, @function
    43  #NO_APP
    44  	lw	$31,28($sp)
    45 @@ -41,7 +38,6 @@
    46  	.set	macro
    47  	.set	reorder
    48  
    49 -	.end	_fini
    50  #APP
    51  	
    52  	.ident	"GCC: (GNU) 3.3.2"
    53 @@ -54,10 +50,8 @@
    54  	
    55  	.section .init
    56  #NO_APP
    57 -	.align	2
    58  	.align	3
    59  	.globl	_init
    60 -	.ent	_init
    61  	.type	_init, @function
    62  #NO_APP
    63  	ld	$31,8($sp)
    64 @@ -68,16 +62,12 @@
    65  	addiu	$sp,$sp,16
    66  	.set	macro
    67  	.set	reorder
    68 -
    69 -	.end	_init
    70  #APP
    71  	
    72  	.section .fini
    73  #NO_APP
    74 -	.align	2
    75  	.align	3
    76  	.globl	_fini
    77 -	.ent	_fini
    78  	.type	_fini, @function
    79  #NO_APP
    80  	ld	$31,8($sp)
    81 @@ -89,7 +79,6 @@
    82  	.set	macro
    83  	.set	reorder
    84  
    85 -	.end	_fini
    86  #APP
    87  	
    88  	.ident	"GCC: (GNU) 3.4.3"
    89 @@ -105,7 +94,6 @@
    90  #NO_APP
    91  	.align	2
    92  	.globl	_init
    93 -	.ent	_init
    94  	.type	_init, @function
    95  #NO_APP
    96  	ld	$31,24($sp)
    97 @@ -118,14 +106,12 @@
    98  	.set	macro
    99  	.set	reorder
   100  
   101 -	.end	_init
   102  #APP
   103  	
   104  	.section .fini
   105  #NO_APP
   106  	.align	2
   107  	.globl	_fini
   108 -	.ent	_fini
   109  	.type	_fini, @function
   110  #NO_APP
   111  	ld	$31,24($sp)
   112 @@ -138,7 +124,6 @@
   113  	.set	macro
   114  	.set	reorder
   115  
   116 -	.end	_fini
   117  #APP
   118  	
   119  	.ident	"GCC: (GNU) 3.3.2"
   120 diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
   121 index 92d72a6..849bd59 100644
   122 --- a/libpthread/nptl/Makefile.in
   123 +++ b/libpthread/nptl/Makefile.in
   124 @@ -64,8 +64,8 @@ endif
   125  librt-so-y += $(librt_OBJS:.o=.oS) $(librt-pt-shared-only-routines-y:.o=.oS)
   126  
   127  ifeq ($(UCLIBC_CTOR_DTOR),y)
   128 -START_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/crti.o
   129 -END_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/crtn.o
   130 +START_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/pt-crti.o
   131 +END_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/pt-crtn.o
   132  LDFLAGS-libpthread.so += -nostartfiles
   133  $(top_builddir)lib/libpthread.so: | $(START_FILE-libpthread.so) $(END_FILE-libpthread.so)
   134  endif
   135 diff --git a/libpthread/nptl/sysdeps/pthread/Makefile.in b/libpthread/nptl/sysdeps/pthread/Makefile.in
   136 index d93b3a5..398eaea 100644
   137 --- a/libpthread/nptl/sysdeps/pthread/Makefile.in
   138 +++ b/libpthread/nptl/sysdeps/pthread/Makefile.in
   139 @@ -73,23 +73,37 @@ CFLAGS-pt-initfini.c = -S -g0 $(PICFLAG) -fno-inline-functions	\
   140  			-finhibit-size-directive			\
   141  			-fno-asynchronous-unwind-tables -fno-unwind-tables \
   142  			$(patsubst -f%,-fno-%,$(call check_gcc,-fexceptions,))
   143 -ASFLAGS-crti.S = -g0
   144 -ASFLAGS-crtn.S = -g0
   145  
   146 -$(libpthread_pthread_OUT)/pt-initfini.s: $(libpthread_pthread_DIR)/pt-initfini.c
   147 +#ASFLAGS += $(PICFLAG) -I$(top_srcdir)include -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
   148 +ifneq ($(wildcard $(libpthread_DIR)/sysdeps/linux/$(TARGET_ARCH)/pt-initfini.c),)
   149 +PTHREAD_INITFINI := $(libpthread_DIR)/sysdeps/linux/$(TARGET_ARCH)/pt-initfini.c
   150 +else
   151 +PTHREAD_INITFINI := $(libpthread_pthread_DIR)/pt-initfini.c
   152 +endif
   153 +
   154 +ASFLAGS-pt-crti.S =  $(PICFLAG)
   155 +ASFLAGS-pt-crtn.S =  $(PICFLAG)
   156 +
   157 +$(libpthread_pthread_OUT)/pt-crti.o: $(libpthread_pthread_OUT)/pt-crti.S
   158 +	$(compile.S)
   159 +
   160 +$(libpthread_pthread_OUT)/pt-crtn.o: $(libpthread_pthread_OUT)/pt-crtn.S
   161 +	$(compile.S)
   162 +
   163 +$(libpthread_pthread_OUT)/pt-initfini.s: $(PTHREAD_INITFINI)
   164  	$(compile.c)
   165 -$(libpthread_pthread_OUT)/defs.h: $(libpthread_pthread_DIR)/pt-initfini.c
   166 +$(libpthread_pthread_OUT)/defs.h: $(PTHREAD_INITFINI)
   167  	$(do_sed) -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
   168  		$(AWK) -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp
   169  	$(Q)mv $@.tmp $@
   170  
   171 -$(libpthread_pthread_OUT)/crti.S: $(libpthread_pthread_OUT)/pt-initfini.s $(libpthread_pthread_OUT)/defs.h
   172 +$(libpthread_pthread_OUT)/pt-crti.S: $(libpthread_pthread_OUT)/pt-initfini.s $(libpthread_pthread_OUT)/defs.h
   173  	$(do_sed) -n -e '/[ 	]*\.file/d' \
   174  		-e '1,/@HEADER_ENDS/p' \
   175  		-e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
   176  		-e '/@TRAILER_BEGINS/,$$p' $< > $@.tmp
   177  	$(Q)mv $@.tmp $@
   178 -$(libpthread_pthread_OUT)/crtn.S: $(libpthread_pthread_OUT)/pt-initfini.s $(libpthread_pthread_OUT)/defs.h
   179 +$(libpthread_pthread_OUT)/pt-crtn.S: $(libpthread_pthread_OUT)/pt-initfini.s $(libpthread_pthread_OUT)/defs.h
   180  	$(do_sed) -n -e '/[ 	]*\.file/d' \
   181  		-e '1,/@HEADER_ENDS/p' \
   182  		-e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \