[comp.sys.m88k] porting ksh on DG/UX

kenney@hsi86.hsi.com (Brian Kenney) (01/16/91)

I am trying to port ksh (version 11/16/88d) to a DG 6220.
We are using GNU GCC version 1.37.23 (88k, Aug 15 1990) compiled
by GNU C version 1.37.

Here's the problem:  The assembler, as, gags on msg.s, which was created
by gcc from msg.c.

Here is the pertinent part of msg.c:
/* built in names */
const struct name_value node_names[] =
{
	"PATH",		NULL,	0,
	"PS1",		NULL,	0,
	"PS2",		"> ",	N_FREE,
        .
        . (lots of the same deleted, but you get the idea)
        .

};

Here is the offending code in msg.s:

@LC0:
	string	 "PATH\000"
	align	 4
@LC1:
	string	 "PS1\000"
	align	 4
@LC2:
	string	 "PS2\000"
	align	 4
.
.
. (lots of the same deleted)
.

_node_names:
	word	 @LC0
	word	 0
	half	 0
	set	.,.+2  <<<<<<<<<<< This is where the error occurs (line 590)
	word	 @LC1
	word	 0
	half	 0
	set	.,.+2  <<<<<<<<<<<
	word	 @LC2
	word	 @LC3
	half	 4096
	set	.,.+2  <<<<<<<<<<< 
.
.
.

Here is the error message:
	as: "msg.s": line 590: operand '.' type mismatch for 'set'

(The error repeats for every set, until the assembler quits due
to too many errors.)

Any ideas?

Thanks,

-Bri
-- 
---
----  Brian Kenney                                       kenney@hsi.com 
----- 3M Health Information Systems                      Wallingford, CT
------

tom@ssd.csd.harris.com (Tom Horsley) (01/16/91)

I don't know what the GCC problem could be, but once you get around it, you
will have another problem:

Ksh automatically defines an environment variable named '_' with the path
name to the last command. Unfortunately (at least on DG/UX 4.31) if you have
an environment variable named '_', the 'make' program aborts during its
initialization (presumably when reading in the environment).

I discovered this one while porting a different shell that does the same
thing, but it can be easily reproduced even in /bin/sh by doing something
like:

_=/bin/make
export _
make
--
======================================================================
domain: tahorsley@csd.harris.com       USMail: Tom Horsley
  uucp: ...!uunet!hcx1!tahorsley               511 Kingbird Circle
                                               Delray Beach, FL  33444
+==== Censorship is the only form of Obscenity ======================+
|     (Wait, I forgot government tobacco subsidies...)               |
+====================================================================+

scott@convergent.com (Scott Lurndal) (01/17/91)

In article <2916@hsi86.hsi.com>, kenney@hsi86.hsi.com (Brian Kenney) writes:
|> I am trying to port ksh (version 11/16/88d) to a DG 6220.
|> We are using GNU GCC version 1.37.23 (88k, Aug 15 1990) compiled
|> by GNU C version 1.37.

   [ lines deleted ]

|> _node_names:
|> 	word	 @LC0
|> 	word	 0
|> 	half	 0
|> 	set	.,.+2  <<<<<<<<<<< This is where the error occurs (line 590)

   This should have been generated as "align 4".  The code generator is broken
in your gcc.   If you have the source, it shouldn't be too difficult to repair,
otherwise put a sed script between the compiler and the assembler to change the
"set .,.+2" to "align 4" (or better yet, in this case, "half 0")
|> 	word	 @LC1
|> 	word	 0
|> 	half	 0
|> 	set	.,.+2  <<<<<<<<<<<
|> 	word	 @LC2
|> 	word	 @LC3
|> 	half	 4096
|> 	set	.,.+2  <<<<<<<<<<< 
|> .

|> Thanks,
|> 
|> -Bri
|> -- 
|> ---
|> ----  Brian Kenney                                       kenney@hsi.com 
|> ----- 3M Health Information Systems                      Wallingford, CT
|> ------
you're welcome,

  scott.

newton@gumby.cs.caltech.edu (Mike Newton) (01/17/91)

You could try using the Gnu make.  I believe i've put the patches here,
and i'll make sure they are on csvax.cs.caltech.edu :: pub/M88K soon.

- mike