[comp.sys.ncr] Cross compilations from 4x0/6x0 Rel. 03.00 to other Tower platforms

ra@is.uu.no (Robert Andersson) (05/07/90)

Suppose I do this on a 400 running OS release 03.00.01:
cc -O -c mod1.c
cc -O -c mod2.c
cc -O -c mod3.c
ld -r -o myprog.o mod?.o

I then distribute the resulting myprog.o to a number of different
customers, telling them they can make the final executable by:
ld -o myprog /lib/crt0.o myprog.o -lc

The above is of course highly simplified, but you probably get the picture.

The customers run any OS release on any of the 200, 300, 4x0, 500, 6x0, 700 
and 8xx machines.

I have not used any of the NCR UNIX extensions, all of the code uses only
the standard AT&T SVID features. The following #include files are used:
ctype, termio, setjmp, string, memory, stdio, fcntl, errno, signal, time,
file, sys/utsname.

Will this scheme work?  I guess what I am asking is really:
1. Will all the other ld releases recognize the a.out magic number of 
   the .o file produced on the 400 under 3.00?
2. Are the register and stack calling conventions the same on all platforms,
   ie. will the code generated by cc on my platform work when linked with
   code generated by cc on the other platforms?
3. Are the rules for padding, alignment and structure/union handling the same?
4. Are there any pitfalls due to incompatible structure or symbol definitions
   in the #include files?

I know this is a big question, but the answers should be of interest to
all people developing and distributing Tower software.  With the latest
proliferation in models and OS releases even more so.

Regards, Robert.
-- 
Robert Andersson, International Systems A/S, Oslo, Norway.
Internet:         ra@is.uu.no
UUCP:             ...!{uunet,mcsun,ifi}!is.uu.no!ra