ARM build problem

fabrizio gennari fabrizio.ge@tiscali.it
Fri Feb 12 18:25:00 GMT 2010


I am trying to build glibc 2.3.6 (yes, it's old, but it is the last one 
with linuxthreads supporting ARM, as linuxthreads 2.5 does not and, as 
far as I heard, nptl does not either), and I am running into a tricky 
build problem.

The problem is that building crti.S fails. gcc is 4.4.3 
and binutils is 2.20 (running on Ubuntu 9.10 and configured with 
target=arm-linux).

arm-linux-gcc 
/home/fge/downloads/builds/glibc/csu/crti.S -c  -I../include -I. -
I/home/fge/downloads/builds/glibc/csu -I.. -I../libio  -
I/home/fge/downloads/builds/glibc -I../sysdeps/arm/elf -I..
/linuxthreads/sysdeps/unix/sysv/linux/arm -I..
/linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread 
-I../sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv -I..
/linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/arm -I..
/sysdeps/unix/sysv/linux/arm -I../sysdeps/unix/sysv/linux -I..
/sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I..
/sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/arm -I..
/sysdeps/unix -I../sysdeps/posix -I../sysdeps/arm/fpu -I../sysdeps/arm -
I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I..
/sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -
I../sysdeps/generic -nostdinc -isystem 
/usr/local/cross/arm9gcc/lib/gcc/arm-linux/4.4.3/include -isystem 
/usr/local/cross/arm9gcc/lib/gcc/arm-linux/4.4.3/include-fixed -isystem 
/home/fge/downloads/builds/linux-2.6.32/usr/include/ -D_LIBC_REENTRANT -
include ../include/libc-symbols.h       -DHAVE_INITFINI -DASSEMBLER  -
I/home/fge/downloads/builds/glibc/csu/. -g -Wa,--noexecstack  -g0  -o 
/home/fge/downloads/builds/glibc/csu/crti.o

/home/fge/downloads/builds/glibc/csu/crti.S: Assembler messages:

/home/fge/downloads/builds/glibc/csu/crti.S:292: Error: undefined local 
label `.L58'
/home/fge/downloads/builds/glibc/csu/crti.S:293: Error: 
undefined local label `.L58'
make[2]: *** 
[/home/fge/downloads/builds/glibc/csu/crti.o] Error 1
make[2]: Leaving 
directory `/home/fge/downloads/glibc-2.3.6/csu'
make[1]: *** 
[csu/subdir_lib] Error 2
make[1]: Leaving directory 
`/home/fge/downloads/glibc-2.3.6'
make: *** [all] Error 2

As far as I 
understood, initfini.c is first turned into initfini.s, then some awk 
magic takes parts of it and copies them to crti.S. So I tried to see 
what parts were missing in crti.S.

$ diff -u 
/home/fge/downloads/builds/glibc/csu/initfini.s 
/home/fge/downloads/builds/glibc/csu/crti.S
--- 
/home/fge/downloads/builds/glibc/csu/initfini.s	2010-02-12 19:13:
12.000000000 +0100
+++ /home/fge/downloads/builds/glibc/csu/crti.S	2010-
02-12 19:13:12.000000000 +0100
@@ -280,24 +280,6 @@
 #include "defs.h"

 	
 /*@HEADER_ENDS*/
-	
-/*@TESTS_BEGIN*/
-	.align	2
-	.global	dummy
-	.
type	dummy, %function
-dummy:
-	@ args = 0, pretend = 0, frame = 0
-	@ 
frame_needed = 0, uses_anonymous_args = 0
-	cmp	r0, #0
-	str	lr, [sp, #-
4]!
-	ldreq	pc, [sp], #4
-	mov	lr, pc
-	mov	pc, r0
-	ldr	pc, [sp], #4
-
#APP
-	
-/*@TESTS_END*/
-	
 /*@_init_PROLOG_BEGINS*/
 	.section .init
 	
.section	.init,"ax",%progbits
@@ -326,25 +308,6 @@
 @ 99 "..
/sysdeps/generic/initfini.c" 1
 	
 /*@_init_PROLOG_ENDS*/
-@ 0 "" 2
-@ 
100 "../sysdeps/generic/initfini.c" 1
-	
-/*@_init_EPILOG_BEGINS*/
-@ 0 
"" 2
-@ 101 "../sysdeps/generic/initfini.c" 1
-	.section .init
-@ 0 "" 
2
-	ldr	pc, [sp], #4
-.L59:
-	.align	2
-.L58:
-	.word	
_GLOBAL_OFFSET_TABLE_-(.LPIC0+8)
-	.word	__gmon_start__(GOT)
-#APP
-	
END_INIT
-	
-/*@_init_EPILOG_ENDS*/
-	
 /*@_fini_PROLOG_BEGINS*/
 	.
section .fini
 	.section	.fini,"ax",%progbits
@@ -365,22 +328,6 @@
 @ 
118 "../sysdeps/generic/initfini.c" 1
 	
 /*@_fini_PROLOG_ENDS*/
-@ 0 
"" 2
-	bl	i_am_not_a_leaf(PLT)
-#APP
-@ 129 "..
/sysdeps/generic/initfini.c" 1
-	
-/*@_fini_EPILOG_BEGINS*/
-@ 0 "" 2
-
@ 130 "../sysdeps/generic/initfini.c" 1
-	.section .fini
-@ 0 "" 2
-	
ldr	pc, [sp], #4
-#APP
-	END_FINI
-	
-/*@_fini_EPILOG_ENDS*/
-	
 
/*@TRAILER_BEGINS*/
 	.weak	__gmon_start__
 	.weak	__gmon_start__

The 
result, shown above, says that crti.S is initfini.s without sections 
TESTS, _init_EPILOG and _fini_EPILOG. The problem is: _init_PROLOG, 
present in both, tries to access .L58. But .L58 is defined in 
_init_EPILOG, which is one of the parts missing in crti.S.

What is the 
problem here? And, in general, how can I build glibc for ARM?

Regards,

Fabrizio


Presentaci un amico! Invita i tuoi amici a scoprire i servizi Tiscali: per ogni amico che attiverà un servizio Tiscali, potrai avere 30 euro di sconto e lo stesso sconto di 30 euro verrà poi offerto al tuo amico. 

Scopri come! http://abbonati.tiscali.it/presentaci_un_amico/?WT.mc_id=01fw



More information about the Libc-help mailing list