[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#709818: Error compiling lilo



Package: cpp-4.8
Version: 4.8.0-7
Tags: patch
X-Debbugs-CC: ad_debian@joonet.de

The lilo (1:23.2-4) build system does some moderately evil things with
the preprocessor.  src/Makefile does:

gcc -E -C -traditional -DLILO_ASM -o common.s common.h

Then as86 is run on first.s, which includes common.s.

The evil thing is that common.h includes asm code hidden from
C program inside C comments, while the C comment delimiters
(which as86 does not understand) are in turn hidden from as86.


Anyway, with current gcc and cpp, this fails somewhat
spectacularly due to the automatic inclusion of
/usr/include/stdc-predef.h (and /usr/include/bits/predefs.h).

With -C, the /* */ comments in those files appear in common.s,
without the special escaping that prevents as86 from choking
on them, and things go downhill from there.


Looking for the least intrusive workaround, my first thought was
just to strip out the comments from stdc-predef.h, but messing
with copyright notices is, well, messy.

However, I figured out that prefixing each /* with a # makes
a "null directive", which is stiripped out by cpp, even in
-C mode.  The output includes some blank and linemarker lines,
but those are relatively harmess for non-C languages, and
can already be suppressed with -P.


Reply to: