Subject: egcs and NetBSD's assembler
To: None <current-users@NetBSD.ORG>
From: Andreas Gustafsson <gson@araneus.fi>
List: current-users
Date: 12/15/1997 17:07:44
I just tried to bootstrap the egcs-1.0 compiler
(http://www.cygnus.com/egcs/) on NetBSD/i386 1.2 as well as 1.3_ALPHA.

Both attempts failed due to problems with the NetBSD assembler
(details below).  I tried to install a newer "gas" (2.8.1), but it
turned out not to be quite compatible with the NetBSD "as": it barfed
on the "-k" option.

How exactly does NetBSD's "as" differ from a stock "gas", and would it
be possible for NetBSD to upgrade to a more recent version?

Here's the egcs-generated assembler code that triggers the problem.
Apparently the assembler is confused by the ".align 2" directive
occurring between two labels whose difference is computed (the error
disappears if you remove the ".align 2").

___FRAME_BEGIN__:
        .long LLCIE1

LSCIE1:
        .long 0

                .byte   0x1
                .byte   0x0
                .byte   0x1
                .byte   0x7c
                .byte   0x8
                .byte   0xc
                .byte   0x5
                .byte   0x4
                .byte   0x88
                .byte   0x1
        .align 2
LECIE1:
        .set    LLCIE1,LECIE1-LSCIE1

The error message was:

   /var/tmp/cc028591.s:153: Error: Unknown expression: symbols LECIE1 and LSCIE1 are in different frags.

-- 
Andreas Gustafsson, gson@araneus.fi