[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#215913: marked as done (gcc: arm: preprocessor spuriously adds line breaks when processing assembler code)



Your message dated Thu, 23 Oct 2003 21:19:30 +0200
with message-id <20031023191930.10478.qmail@h14f7d.mid.smarden.org>
and subject line Bug#215913: gcc: arm: preprocessor spuriously adds line breaks when processing assembler code
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 15 Oct 2003 12:40:19 +0000
>From pape-bounce-submit=bugs.debian.org@smarden.org Wed Oct 15 07:40:10 2003
Return-path: <pape-bounce-submit=bugs.debian.org@smarden.org>
Received: from dsl-217-199-70-55.berlikomm.net (nomad.mobile.innominate.org) [217.199.70.55] 
	by master.debian.org with smtp (Exim 3.35 1 (Debian))
	id 1A9kwk-0006OP-00; Wed, 15 Oct 2003 07:40:10 -0500
Received: (qmail 9369 invoked by uid 507); 15 Oct 2003 12:38:23 -0000
Message-ID: <[🔎] 20031015123823.9368.qmail@h14f7d.mid.smarden.org>
Date: Wed, 15 Oct 2003 14:38:23 +0200
From: Gerrit Pape <pape@smarden.org>
To: submit@bugs.debian.org
Subject: gcc: arm: preprocessor spuriously adds line breaks when processing assembler code
Reply-To: pape-dbnbgs@smarden.org
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="u3/rZRmxL6MmkK24"
Content-Disposition: inline
User-Agent: Mutt/1.5.4i
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0
	tests=HAS_PACKAGE
	version=2.53-bugs.debian.org_2003_10_13
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_10_13 (1.174.2.15-2003-03-30-exp)


--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: gcc
Severity: important

Hi,

(sid)pape@debussy:~/dietlibc-0.23/arm$ gcc -v
Reading specs from /usr/lib/gcc-lib/arm-linux/3.3.2/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc arm-linux
Thread model: posix
gcc version 3.3.2 20031005 (Debian prerelease)

The dietlibc_0.23-1 fails to build on arm because of bad preprocessing
of assembler code.  Here's the relevant part of the build log
http://buildd.debian.org/fetch.php?&pkg=dietlibc&ver=0.23-1&arch=arm&stamp=1063449359&file=log&as=raw

gcc -I. -Iinclude -pipe -nostdinc -Os -fomit-frame-pointer -fstrict-aliasing -mhard-float -Wall -W -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wredundant-decls -Wno-unused -c arm/clone.S -o bin-arm/clone.o
arm/clone.S: Assembler messages:
arm/clone.S:20: Error: bad instruction `syscall'
arm/clone.S:25: Error: bad instruction `syscall'
make[1]: *** [bin-arm/clone.o] Error 1
make[1]: Leaving directory `/build/buildd/dietlibc-0.23'
make: *** [build-stamp] Error 2

I attach the clone.S source file, and also the output 'gcc -E clone.S'.

The preprocessor adds linebreaks at the word 'syscall', even though it's
just a comment, see line 18 and line 24 in clone.S.

If there's something wrong with the arm/clone.S source file, please tell
me; in my opinion the preprocessor is at fault here.

Thanks, Gerrit.

--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="clone.S"


#include <errno.h>
#include "syscalls.h"

	.text
	.weak 	clone
	.global __clone
	
@
@ Some slightly tricky stuff here... edit with care :-)
@

clone:
__clone:
	movs	r12, r0			@ check function pointer
	cmpne	r1, #0			@ if function check for stack pointer
	moveq	r0, #-EINVAL		@ if one is not available set errno value
	beq	__unified_syscall	@ handle as if error was returned by the syscall

	stmdb	r1!, { r3, r12 } 	@ store function param (r3) and function ptr (r12)
					@ into what will become the childs stack.

	mov	r0, r2			@ move flags argument to r0
	swi	__NR_clone		@ call the syscall
	movs	r0, r0			@ set condition codes
	blt	__unified_syscall	@ (return code < 0): handle as an error
	movne	pc, lr			@ (return code > 0): return to parent

	mov	fp, #0			@ clear the frame pointer
	adr	lr, 1f			@ setup return address
	ldmia	sp!, { r0, pc } 	@ load function param and jump to thread function

1:	b	_exit			@ branch to _exit (PIC safe)


--u3/rZRmxL6MmkK24
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="clone.S.preprocessed"

# 1 "clone.S"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "clone.S"

# 1 "/usr/include/errno.h" 1 3 4
# 29 "/usr/include/errno.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 318 "/usr/include/features.h" 3 4
# 1 "/usr/include/gnu/stubs.h" 1 3 4
# 319 "/usr/include/features.h" 2 3 4
# 30 "/usr/include/errno.h" 2 3 4


__BEGIN_DECLS



# 1 "/usr/include/bits/errno.h" 1 3 4
# 25 "/usr/include/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4



# 1 "/usr/include/asm/errno.h" 1 3 4
# 5 "/usr/include/linux/errno.h" 2 3 4
# 26 "/usr/include/bits/errno.h" 2 3 4
# 37 "/usr/include/errno.h" 2 3 4
# 47 "/usr/include/errno.h" 3 4
extern int errno;
# 59 "/usr/include/errno.h" 3 4
__END_DECLS
# 3 "clone.S" 2
# 1 "syscalls.h" 1
# 474 "syscalls.h"
.macro __syscall_weak name wsym sym typ
.text
.type \wsym,function
.weak \wsym
\wsym:
.type \sym,function
.global \sym
\sym:
.ifgt \typ
        mov ip, sp
        stmfd sp!,{r4, r5, r6}
        ldmia ip, {r4, r5, r6}
.endif
        swi \name
.ifgt \typ
        b __unified_syscall4
.else
        b __unified_syscall
.endif
.endm


.macro __syscall name sym typ
.text
.type \sym,function
.global \sym
\sym:
.ifgt \typ
        mov ip, sp
        stmfd sp!,{r4, r5, r6}
        ldmia ip, {r4, r5, r6}
.endif
        swi \name
.ifgt \typ
        b __unified_syscall4
.else
        b __unified_syscall
.endif
.endm
# 4 "clone.S" 2

        .text
        .weak clone
        .global __clone

@
@ Some slightly tricky stuff here... edit with care :-)
@

clone:
__clone:
        movs r12, r0 @ check function pointer
        cmpne r1, #0 @ if function check for stack pointer
        moveq r0, #-22 @ if one is not available set errno value
        beq __unified_syscall @ handle as if error was returned by the

        syscall
# 20 "clone.S"
        stmdb r1!, { r3, r12 } @ store function param (r3) and function ptr (r12)
                                        @ into what will become the childs stack.

        mov r0, r2 @ move flags argument to r0
        swi (0x900000 +120) @ call the
        syscall
# 25 "clone.S"
        movs r0, r0 @ set condition codes
        blt __unified_syscall @ (return code < 0): handle as an error
        movne pc, lr @ (return code > 0): return to parent

        mov fp, #0 @ clear the frame pointer
        adr lr, 1f @ setup return address
        ldmia sp!, { r0, pc } @ load function param and jump to thread function

1: b _exit @ branch to _exit (PIC safe)

--u3/rZRmxL6MmkK24--

---------------------------------------
Received: (at 215913-done) by bugs.debian.org; 23 Oct 2003 19:19:09 +0000
>From pape-bounce-215913-done=bugs.debian.org@smarden.org Thu Oct 23 14:19:03 2003
Return-path: <pape-bounce-215913-done=bugs.debian.org@smarden.org>
Received: from dsl-217-9-56-237.berlikomm.net (woph.mbl.smarden.org) [217.9.56.237] 
	by master.debian.org with smtp (Exim 3.35 1 (Debian))
	id 1ACkz6-0003Z5-00; Thu, 23 Oct 2003 14:19:00 -0500
Received: (qmail 10480 invoked by uid 501); 23 Oct 2003 19:19:30 -0000
Message-ID: <20031023191930.10478.qmail@h14f7d.mid.smarden.org>
Date: Thu, 23 Oct 2003 21:19:30 +0200
From: Gerrit Pape <pape-dbnbgs@smarden.org>
To: 215913-done@bugs.debian.org
Subject: Re: Bug#215913: gcc: arm: preprocessor spuriously adds line breaks when processing assembler code
References: <[🔎] 20031015123823.9368.qmail@h14f7d.mid.smarden.org> <[🔎] 87zng2od9p.fsf@student.uni-tuebingen.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[🔎] 87zng2od9p.fsf@student.uni-tuebingen.de>
User-Agent: Mutt/1.4.1i
Delivered-To: 215913-done@bugs.debian.org
X-Spam-Status: No, hits=-5.7 required=4.0
	tests=EMAIL_ATTRIBUTION,QUOTED_EMAIL_TEXT
	version=2.53-bugs.debian.org_2003_10_21
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_10_21 (1.174.2.15-2003-03-30-exp)

On Wed, Oct 15, 2003 at 03:12:50PM +0200, Falk Hueffner wrote:
> Gerrit Pape <pape@smarden.org> writes:
> > The preprocessor adds linebreaks at the word 'syscall', even though
> > it's just a comment, see line 18 and line 24 in clone.S.
> 
> This looks very similar to bug 210482, which should have been fixed.

Yes.  After asking for a rebuild on the debian-arm list didn't work out,
I uploaded a new package.  It auto-built fine now with gcc-3.3_1:3.3.2-1.

Thanks, Gerrit.



Reply to: