Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!amdahl!pyramid!uccba!hal!ncoast!kent From: kent@ncoast.UUCP (Kent Williams) Newsgroups: comp.os.minix Subject: Cross Compilation (Aztec C) Message-ID: <3680@ncoast.UUCP> Date: Wed, 29-Jul-87 08:22:27 EDT Article-I.D.: ncoast.3680 Posted: Wed Jul 29 08:22:27 1987 Date-Received: Sat, 1-Aug-87 09:27:57 EDT Distribution: comp Organization: Cleveland Public Access UN*X, Cleveland, OH Lines: 73 Keywords: Cross Compiling Status Report on Cross Compilation: Well I gave up on the Datalight Compiler for the moment, and moved on to the Aztec C Compiler. I now have 1.2 working on an AT with a kernel compiled and linked with the Aztec Compiler and the Microsoft Linker. The conversion was eased by the fact that Aztec's Dos Linker support is implemented by 'faithfully duplicating' ;-) the C86 runtime orginization, down to segment and group names. Problems: 1. Truncated names, and inconsistent capitalization: The C86, Minix and PC/IX compilers all truncate at 8 characters. Several of the publics in the assembly source files are truncated, which is a problem if the compiler and linker you're using support long names (which is the case for Aztec and MS-Link). In addition, the C86 generates all upper-case symbol names, whereas I like to use /NOIGNORECASE on my links -- makes it so the maps don't appear to be shouting at me! Solution: Link, Edit, Link, Edit. A particular boner was in at_wini.c where init_params() is called from main() as 'init_param(),' which I suppose slid right by MINIX, PC-IX, et al. 2. Munged labels in klib88.asm: Down in the TTY output routines, there are some screwed up labels, and vid6: is missing entirely. Solution: Look it up in the book and DWIM, instead of what's written there. I also took out the LOCK NOP business -- it isn't needed unless you're running on a VAX. 3. Missing portw_in and portw_out in klib88.asm: Solution: Put them there. 4. Missing wini functions in mpx88.asm: Solution: Put them there. 5. Broken Winchester Driver: All calls for access to the wini were returning EOF. Solution: A curious usage in at_wini.c brought out a latent bug in the compiler: It seems that the Aztec Compiler pukes when confronted with 'register structs.' and doesn't do the proper thing. Solution: swap(first, second) register struct wini *first, *second; { #ifdef ORIGINAL register struct wini tmp; tmp = *first; *first = *second; *second = tmp; #else /* ORIGINAL */ struct wini tmp; memcpy(&tmp,first,sizeof(struct wini)); memcpy(first,second,sizeof(struct wini)); memcpy(second,&tmp,sizeof(struct wini)); #endif /* ORIGINAL */ } The kernel size dropped > 6K when compiled with the Aztec Compiler, which, despite its shortcomings, still generates some of the most compact code around. -- Kent Williams {{harvard,mit-eddie}!necntc,well!hoptoad,sun!cwruecmp!hal}!ncoast!kent ARPA: necntc!ncoas!kent@harvard.harvard.e