Linux 1.2.9 compilation problem with gcc-2.7.0

Kayvan Sylvan (kayvan@sylvan.com)
Sat, 24 Jun 95 03:58 PDT


I compiled gcc-2.7.0 for linux-aout (haven't converted to ELF yet) and
went to recompile Linux-1.2.9.

Here's what happened when I tried to ``make modules'':

gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -m486 -DMODULE -DCONFIG_MODVERSIONS -g -c 53c7,8xx.c
53c7,8xx.c:2275: warning: preprocessing directive not recognized within macro arg
53c7,8xx.c:2275: warning: preprocessing directive not recognized within macro arg
53c7,8xx.c:2275: warning: preprocessing directive not recognized within macro arg
53c7,8xx.c:2275: warning: preprocessing directive not recognized within macro arg
53c7,8xx.c: In function `NCR53c8x0_soft_reset':
53c7,8xx.c:2272: undefined or invalid # directive
53c7,8xx.c:2274: undefined or invalid # directive
53c7,8xx.c:2275: parse error before `#'
53c7,8xx.c:2275: parse error before `#'
53c7,8xx.c:2275: warning: left-hand operand of comma expression has no effect
53c7,8xx.c:2275: parse error before `)'
make[2]: *** [53c7,8xx.o] Error 1
make[2]: Leaving directory `/usr/src/linux/drivers/scsi'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/src/linux/drivers'
make: *** [modules] Error 2

It appears that gcc-2.7.0 no longer allows preprocessor directives to
be recognized inside macro invocations.

The following trivial patch fixes the kernel source:

*** /usr/src/linux/drivers/scsi/53c7,8xx.c.orig Sat Jun 24 03:44:33 1995
--- /usr/src/linux/drivers/scsi/53c7,8xx.c Sat Jun 24 03:44:53 1995
***************
*** 2269,2277 ****
NCR53c7x0_write8(STIME0_REG_800,
((14 << STIME0_800_SEL_SHIFT) & STIME0_800_SEL_MASK)
/* Disable HTH interrupt */
! #if 0
| ((15 << STIME0_800_HTH_SHIFT) & STIME0_800_HTH_MASK)
! #endif
);


--- 2269,2277 ----
NCR53c7x0_write8(STIME0_REG_800,
((14 << STIME0_800_SEL_SHIFT) & STIME0_800_SEL_MASK)
/* Disable HTH interrupt */
! /*
| ((15 << STIME0_800_HTH_SHIFT) & STIME0_800_HTH_MASK)
! */
);


---Kayvan

"The trust and respect of a child is an honor to be earned, not demanded."
Kayvan Sylvan | Sylvan Associates | Proud Dad of:
kayvan@Sylvan.COM | http://www.isp.net/~kayvan | Katherine Yelena (8/8/89)
(408) 978-1407 PGP OK | Ask me about Avatar. | Robin Gregory (2/28/92)