Bug 41472
Summary: | gcc preprocessor fails | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Paul Johnson <pauljohn> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | David Lawrence <dkl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.1 | CC: | jones.peter |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
URL: | http://lark.cc.ukans.edu/~pauljohn/Swarm/Swarm-2.x_RPMSforRH7/swarm-2.1.69.tar.gz | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2001-05-25 01:58:56 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Paul Johnson
2001-05-21 01:27:41 UTC
When I first tried compiling one of the test versions of swarm at ftp://ftp.swarm.org/pub/swarm/src/testing/, I got similar diagnostics. I subscribed to the swarm support discussion list (swarm-support at santafe.edu), reported being unable to compile the latest tar file, under RedHat 7.1, and was told that 2.96 was not a supported version of gcc, and that I should get hold of gcc 2.95.3. I have observed the "invalid preprocessor" message with the swarm version at ftp://ftp.swarm.org/pub/swarm/src/testing/swarm-2001-05-21.tar.gz . (This directory contains development versions of swarm.) In other words: 1. Download and unpack with "tar -zxvf swarm-2001-05-21.tar.gz" to create source directory 2001-05-21 . 2. Create a workng directory and cd to it: "mkdir work; cd work" 3. Configure and make: "../2001-05-21/configure; make" Soon, I got the invalid preprocessing directive. Following the suggestion to try gcc-2.95.3, I obtained gcc from ftp://ftp.gnu.org/gnu/gcc, and installed to a special directory. Making a work directory as above and cd-ing to it, I did: a) "../gcc2.95.3/configure --prefix=/gcc2953 --languages=objc" b) "make bootstrap-lean" (plus other flags suggested in the install/BUILD file in gcc-2.95.3.tar.gz) c) (As root) "make install", Rebuilding swarm, I replaced Step 3 above with: "CC=/gcc2953/bin/gcc ../configure; make" This time, compilation got further along, but complained about the lack of a JDK (beyond the scope of this bug report) Comparing the two runs, differing only in gcc version, I observed that file src/activity/activity.xm was different. If one cd's to src/activity in the work directory, removes activity.xm and types "make", one gets the diagnostic again. Further analysis showed the two versions of gcc, invoked here with "gcc -E", don't behave the same way. The invalid preprocessor diagnostics occur only with gcc-2.96 (supplied by RedHat). Have the specifications of pre-processing changed between 2.95 and 2.96? I could not find any documentation at RedHat. Peter Jones PS Should changes to this bug report be echoed to the swarm discussion list? This is a bug in swarm, not gcc. They are relying on preprocessor to add empty lines where they want, but the new preprocessor in gcc-2.96-RH and up does not emit unneeded space without a reason. Particularly, where old preprocessor output: externvar id <Symbol> Concurrent, Sequential, Randomized; ...21 empty lines... typedef unsigned long timeval_t; new preprocessor now outputs: externvar id <Symbol> Concurrent, Sequential, Randomized; # 493 "./activity.h" typedef unsigned long timeval_t; (the line directive moves the source position 21 lines down). make-h2x script which works on preprocessed source is not flexible enough though. The patch below seems to fix this, in addition to removing #import keywords first, because the new preprocessor correctly expands #import directives while the old did not and thus even if the first bug in make-h2x is fixed, it generates far bigger .xm file. --- swarm-2.1.69.20010514/src/defobj/make-h2x.jj Wed Jun 6 14:34:07 2001 +++ swarm-2.1.69.20010514/src/defobj/make-h2x Wed Jun 6 14:39:48 2001 @@ -37,15 +37,17 @@ echo \ # note that we identify Symbol, Warning, Error and Event # *only* in the context of `extern', and we use a second # sed script to remove the `extern' after identification -sh -c "$OBJC $OBJCFLAGS -Ddisable_externvar -E $srcdir/$m.h" | \ +grep -v '^#import' $srcdir/$m.h | \ +sh -c "$OBJC $OBJCFLAGS -Ddisable_externvar -x objective-c -E -" | \ sed -n \ -e 's@//.*$@@' \ -e 's/ //g' \ -e 's/[ ][ ]*//g' -e 's/L//g' \ - -e '/externvarid<Symbol>/,/^$/p' \ - -e '/externvarid<Warning>/,/^$/p' \ - -e '/externvarid<Error>/,/^$/p' \ - -e '/externvarid<Event>/,/^$/p' | sed -e 's/externvar/externvardef /g' >$m.xm+ + -e '/externvarid<Symbol>/,/^\($\|#[0-9]\)/p' \ + -e '/externvarid<Warning>/,/^\($\|#[0-9]\)/p' \ + -e '/externvarid<Error>/,/^\($\|#[0-9]\)/p' \ + -e '/externvarid<Event>/,/^\($\|#[0-9]\)/p' | \ +sed -e '/^#[0-9]/d;s/externvar/externvardef /g' >$m.xm+ # define symbol identifiers in generated file |