Subject: interesting problem with sed and asm2gas for m68k
To: None <tech-toolchain@NetBSD.org, port-m68k@netbsd.org>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-toolchain
Date: 06/15/2006 17:25:44
I noticed this trying to cross-build an Amiga kernel from a Solaris
10/amd64 host.

sh /home/garrett/netbsd/src/sys/arch/m68k/fpsp/asm2gas /home/garrett/netbsd/src
/sys/arch/m68k/fpsp/fpsp.h >fpsp.defs
sed:   # format canonicalization is an unrecognized command.
sed:   # operator conversion is an unrecognized command.
sed:   # operand conversion is an unrecognized command.
sed:   # Floating point literal conversion is an unrecognized command.


The problem is that the comments are inlined, and have a leading
whitespace, which Solaris sed does not like.  It wants instead the "#"
to be the first character on the line.

Removing the leading blank creates a new problem:

sh /home/garrett/netbsd/src/sys/arch/m68k/fpsp/asm2gas
/home/garrett/netbsd/src/sys/arch/m68k/fpsp/scosh.sa >scosh.s
sed: Too many commands, last:   /^      btst\.[bl]      /{s/\..//;p;d;}
sed: Too many commands, last:   /^      btst\.[bl]      /{s/\..//;p;d;}

At this point I gave up.

I think that maybe our sed (nbsed?) should be in the list of tools we
install with ./build.sh tools, that way we can use whatever version we
want to.

Oh, and yes, I have /usr/xpg4/bin in my path first.  So that's not the
problem.

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191