Subject: "locore.s" won't compile into "locore.o"
To: BSD-SMP List <tech-smp@netbsd.org>
From: Greywolf <greywolf@starwolf.com>
List: tech-smp
Date: 01/16/2002 17:10:15
Greetings!

Top of the fourth.  Score:  OS: 4, Greywolf: 0.

I find that if I go try to build even a UP kernel under the MP tree,
building locore.o fails from locore.s.  Christos, the answer to
your question regarding "what kind of errors" is this:  Every typedef
and struct and function declaration that shows up as a result of
#include <machine/cpu.h>, even after I have applied the patch you
sent me.

Here's what I've done, in order [line continuations are mine].  This
is quite long; do a search on 'locore.o' to jump down to the meat,
but I find the output from 'make depend' interesting.

rivendell# cd /sys; cvs update -d -P .
rivendell# cd arch/i386; cvs update -rsommerfeld_i386mp_1
rivendell# patch < ~greywolf/patches/i386-mp-current
	[courtesy of christos@zoulas.com]
rivendell# [copy GENERIC.MP to RIVENDELL.MP and edit appropriately]
rivendell# config RIVENDELL.MP
rivendell# cd ../compile/RIVENDELL.MP
rivendell# make depend
depending the kern library objects
depending the compat library objects
mkdep -x assembler-with-cpp -traditional-cpp -D_LOCORE -Di386 -I.  \
	-I../../../../arch -I../../../.. -nostdinc -DLKM -DMAXUSERS=32 \
	-D_KERNEL -D_KERNEL_OPT ../../../../arch/i386/i386/locore.s \
	../../../../arch/i386/i386/db_dbgreg.s \
	../../../../arch/i386/i386/in_cksum.s \
	../../../../arch/i386/i386/microtime.s \
	../../../../crypto/des/arch/i386/des_enc.S \
	../../../../crypto/blowfish/arch/i386/bf_enc.S \
	../../../../arch/i386/i386/bioscall.s \
	../../../../arch/i386/i386/apmcall.s \
	../../../../arch/i386/i386/svr4_sigcode.s \
	../../../../arch/i386/i386/ibcs2_sigcode.s \
	../../../../arch/i386/i386/linux_sigcode.s \
	../../../../arch/i386/i386/freebsd_sigcode.s

In file included from ../../../../sys/types.h:47,
                 from ../../../../sys/time.h:41,
                 from ../../../../sys/sched.h:94,
                 from machine/cpu.h:56,
                 from ../../../../arch/i386/i386/locore.s:97:
machine/types.h:69: warning: `__HAVE_GENERIC_SOFT_INTERRUPTS' redefined
assym.h:85: warning: this is the location of the previous definition

mkdep -a -ffreestanding -O3 -pipe -Werror -Wall -Wno-main \
-Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes \
-Wno-uninitialized -Di386 -I.  -I../../../../arch -I../../../.. \
-nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT ioconf.c param.c \
../../../../dev/ic/smc93cx6.c ../../../../dev/ic/aic7xxx.c \
../../../../dev/ic/aic7xxx_seeprom.c ../../../../dev/ic/aha.c \
[...and so on, without further incident]

rivendell# make locore.o [simply for argument's sake (LONG!)]
cc  -x assembler-with-cpp -traditional-cpp -D_LOCORE  -Di386 -I.  -I../../../../arch -I../../../.. -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -c /sys/arch/i386/compile/RIVENDELL.MP/../../../../arch/i386/i386/locore.s
In file included from ../../../../sys/types.h:47,
                 from ../../../../sys/time.h:41,
                 from ../../../../sys/sched.h:94,
                 from machine/cpu.h:56,
                 from /sys/arch/i386/compile/RIVENDELL.MP/../../../../arch/i386/i386/locore.s:97:
machine/types.h:69: warning: `__HAVE_GENERIC_SOFT_INTERRUPTS' redefined
assym.h:85: warning: this is the location of the previous definition
/var/tmp/ccpb51s6.s: Assembler messages:
/var/tmp/ccpb51s6.s:1433: Error: no such instruction: `typedef unsigned int sigset13_t'
/var/tmp/ccpb51s6.s:1448: Error: no such instruction: `struct sigaction13{'
/var/tmp/ccpb51s6.s:1449: Error: no such instruction: `void (*sa_handler)'
/var/tmp/ccpb51s6.s:1450: Error: invalid character '_' in mnemonic
/var/tmp/ccpb51s6.s:1451: Error: invalid character '_' in mnemonic
/var/tmp/ccpb51s6.s:1452: Error: suffix or operands invalid for `int'
/var/tmp/ccpb51s6.s:1453: Error: Rest of line ignored. First ignored character is `}'.
/var/tmp/ccpb51s6.s:1456: Error: no such instruction: `typedef struct{'
/var/tmp/ccpb51s6.s:1457: Error: invalid character '_' in mnemonic
/var/tmp/ccpb51s6.s:1458: Error: Rest of line ignored. First ignored character is `}'.
/var/tmp/ccpb51s6.s:1502: Error: no such instruction: `struct sigaction{'
/var/tmp/ccpb51s6.s:1503: Error: no such instruction: `void (*sa_handler)'
/var/tmp/ccpb51s6.s:1504: Error: invalid character '_' in mnemonic
/var/tmp/ccpb51s6.s:1505: Error: invalid character '_' in mnemonic
...
[.... and so on, for every C construct that shows up as a result of including
 machine/cpu.h.]
...
/var/tmp/ccpb51s6.s:5396: Error: suffix or operands invalid for `int'
/var/tmp/ccpb51s6.s:5397: Error: Rest of line ignored. First ignored character is `}'.
/var/tmp/ccpb51s6.s:5399: Error: suffix or operands invalid for `int'
/var/tmp/ccpb51s6.s:5400: Error: no such instruction: `struct nativedisk_info{'
/var/tmp/ccpb51s6.s:5401: Error: no such instruction: `char ni_devname[16]'
/var/tmp/ccpb51s6.s:5402: Error: suffix or operands invalid for `int'
/var/tmp/ccpb51s6.s:5403: Error: junk `[16]' after expression
/var/tmp/ccpb51s6.s:5403: Error: suffix or operands invalid for `int'
/var/tmp/ccpb51s6.s:5404: Error: Rest of line ignored. First ignored character is `}'.
/var/tmp/ccpb51s6.s:5405: Error: Rest of line ignored. First ignored character is `}'.
*** Error code 1

Stop.
make: stopped in /sys/arch/i386/compile/RIVENDELL.MP
rivendell#

				--*greywolf;
--
Microshaft:  Where do you want to crash today?