This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Praeproccessor broken? crti.S compilation fails



With the current GCC from CVS I can't anymore build glibc.  The file
crti.o is miscompiled (on i686-linux).

/opt/gcc-2.96.test/bin/gcc /builds/glibc/20000725-gcc-2.96.test/csu/crti.S -c  -I/builds/glibc/20000725-gcc-2.96.test/csu -DASSEMBLER  -I/builds/glibc/20000725-gcc-2.96.test/csu/. -DGAS_SYNTAX  -g0  -o /builds/glibc/20000725-gcc-2.96.test/csu/crti.o -save-temps

I've simplified the input a wee bit to show the problem.

gcc current produces:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1 "/builds/glibc/20000725-gcc-2.96.test/csu/crti.S"
        .file "initfini.c"
        .version "01.01"
gcc2_compiled.:
#APP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The rest of the file is missing!

but older gcc's complain about the missing include file:
In file included from /builds/glibc/20000725-gcc-2.96.test/csu/crti.S:6:
/builds/glibc/20000725-gcc-2.96.test/csu/defs.h:4:25: libc-symbols.h: No such file or directory

Removing the last two lines from defs.h shows what should happen:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1 "/builds/glibc/20000725-gcc-2.96.test/csu/crti.S"
	.file	"initfini.c"
	.version	"01.01"
gcc2_compiled.:
#APP
	
# 1 "/builds/glibc/20000725-gcc-2.96.test/csu/defs.h" 1



# 6 "/builds/glibc/20000725-gcc-2.96.test/csu/crti.S" 2

	
 
 
#NO_APP
	.align 4
	.type	 call_gmon_start,@function
call_gmon_start:
	pushl	%ebp
	movl	%esp, %ebp
	pushl	%ebx
	pushl	%eax
	call	.L23
.L23:
	popl	%ebx
	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L23], %ebx
	movl	__gmon_start__@GOT(%ebx), %eax
	testl	%eax, %eax
	je	.L22
	call	*%eax
.L22:
	movl	-4(%ebp), %ebx
	leave
	ret
#APP
	.section .init
#NO_APP
	.align 4
.globl _init
	.type	 _init,@function
_init:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$8, %esp
	call	call_gmon_start
#APP
	 .align 4
	 
	
 
 
	.section .fini
#NO_APP
	.align 4
.globl _fini
	.type	 _fini,@function
_fini:
	pushl	%ebp
	movl	%esp, %ebp
	pushl	%ebx
	pushl	%edx
	call	.L26
.L26:
	popl	%ebx
	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L26], %ebx
#APP
	 .align 4
	 
	
 
 
	.weak	__gmon_start__
	.ident	"GCC: (GNU) 2.96 20000919 (experimental)"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Here're the files:
	.file	"initfini.c"
	.version	"01.01"
gcc2_compiled.:
#APP
	
#include "defs.h"
	
/*@HEADER_ENDS*/
/*@_init_PROLOG_BEGINS*/
#NO_APP
	.align 4
	.type	 call_gmon_start,@function
call_gmon_start:
	pushl	%ebp
	movl	%esp, %ebp
	pushl	%ebx
	pushl	%eax
	call	.L23
.L23:
	popl	%ebx
	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L23], %ebx
	movl	__gmon_start__@GOT(%ebx), %eax
	testl	%eax, %eax
	je	.L22
	call	*%eax
.L22:
	movl	-4(%ebp), %ebx
	leave
	ret
#APP
	.section .init
#NO_APP
	.align 4
.globl _init
	.type	 _init,@function
_init:
	pushl	%ebp
	movl	%esp, %ebp
	subl	$8, %esp
	call	call_gmon_start
#APP
	ALIGN
	END_INIT
	
/*@_init_PROLOG_ENDS*/
/*@_fini_PROLOG_BEGINS*/
	.section .fini
#NO_APP
	.align 4
.globl _fini
	.type	 _fini,@function
_fini:
	pushl	%ebp
	movl	%esp, %ebp
	pushl	%ebx
	pushl	%edx
	call	.L26
.L26:
	popl	%ebx
	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L26], %ebx
#APP
	ALIGN
	END_FINI
	
/*@_fini_PROLOG_ENDS*/
/*@TRAILER_BEGINS*/
	.weak	__gmon_start__
	.ident	"GCC: (GNU) 2.96 20000919 (experimental)"
#define END_INIT
#define END_FINI
#define ALIGN .align 4



-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]