Ticket #492 (closed defect: fixed)

Opened 5 months ago

Last modified 1 month ago

Syntax error in javapre.i

Reported by: devidfil@… Owned by: sunshine
Priority: blocker Milestone:
Component: build system Version: V1.2
Keywords: Cc:

Description (last modified by sunshine) (diff)

Trying to build some versions of CS in Ubuntu and Debian, CS fails to build with this error:

cc1plus: error: unrecognized command line option "-Wno-long-double"

g++ -c -o ./out/linuxx86/optimize/plugins/video/render3d/shader/shadercompiler/xmlshader/cpi/expparser.o -I. -I./include -I./include -Wall -g -O2 -pipe -Wall -g -O2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -I/usr/local/include -Wno-long-double -g -O2 -g -O2 -fno-exceptions -fvisibility-inlines-hidden -O3 -fomit-frame-pointer -ffast-math -g2 -fPIC  plugins/video/render3d/shader/shadercompiler/xmlshader/cpi/expparser.cpp

...skipped xmlshader.so for lack of <plugins!video!render3d!shader!shadercompiler!xmlshader!>shader.o...

mkdir -p "./out/linuxx86/optimize/plugins/video/render3d/null"


g++ -c -o ./out/linuxx86/optimize/plugins/video/render3d/null/null_render3d.o -I. -I./include -I./include -Wall -g -O2 -pipe -Wall -g -O2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -I/usr/local/include -Wno-long-double -g -O2 -g -O2 -fno-exceptions -fvisibility-inlines-hidden -O3 -fomit-frame-pointer -ffast-math -g2 -fPIC  plugins/video/render3d/null/null_render3d.cpp


g++ -c -o ./out/linuxx86/optimize/plugins/video/render3d/null/null_txt.o -I. -I./include -I./include -Wall -g -O2 -pipe -Wall -g -O2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -I/usr/local/include -Wno-long-double -g -O2 -g -O2 -fno-exceptions -fvisibility-inlines-hidden -O3 -fomit-frame-pointer -ffast-math -g2 -fPIC  plugins/video/render3d/null/null_txt.cpp


g++ -c -o ./out/linuxx86/optimize/plugins/video/render3d/null/null_pix.o -I. -I./include -I./include -Wall -g -O2 -pipe -Wall -g -O2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -I/usr/local/include -Wno-long-double -g -O2 -g -O2 -fno-exceptions -fvisibility-inlines-hidden -O3 -fomit-frame-pointer -ffast-math -g2 -fPIC  plugins/video/render3d/null/null_pix.cpp

...skipped null3d.so for lack of libcrystalspace-1.2.a...

mkdir -p "./out/linuxx86/optimize/plugins/video/cursor"


g++ -c -o ./out/linuxx86/optimize/plugins/video/cursor/cursor.o -I. -I./include -I./include -Wall -g -O2 -pipe -Wall -g -O2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -I/usr/local/include -Wno-long-double -g -O2 -g -O2 -fno-exceptions -fvisibility-inlines-hidden -O3 -fomit-frame-pointer -ffast-math -g2 -fPIC  plugins/video/cursor/cursor.cpp

...skipped cscursor.so for lack of libcrystalspace-1.2.a...
make[1]: *** [all] Error 1
make[1]: Leaving directory `/build/buildd/crystalspace-1.2-20080206/CS'
make: *** [build-arch-stamp] Error 2
dpkg-buildpackage: failure: debian/rules build gave error exit status 2

Please fix this, is really important. The full build log can be found here:

http://launchpadlibrarian.net/15563570/buildlog_ubuntu-intrepid-i386.crystalspace_1.2-20080206-1ubuntu0.3_FAILEDTOBUILD.txt.gz

Attachments

swigpostproc_swig_1.3.35_r31355.txt.bz2 (321.1 kB) - added by erluk 1 month ago.
crystalspace_1.2-20080206-1ubuntu0.3_FAILEDTOBUILD.txt.gz (118.6 kB) - added by sunshine 1 month ago.
CS 1.2 build log from original reporter.
crystalspace_1.2.1-0ubuntu0.1_FAILEDTOBUILD.txt.gz (127.8 kB) - added by sunshine 1 month ago.
CS 1.2.1 build log from original reporter.

Change History

  Changed 5 months ago by vknecht

  • status changed from new to closed
  • resolution set to invalid

Please use latest 1.2.1 stable release, this error is fixed already.

  Changed 5 months ago by anonymous

  • status changed from closed to reopened
  • resolution deleted

Already tried with 1.2.1 and it fails to build.

    g++ -Wl,--as-needed -o cscursor.so ./out/linuxx86/optimize/plugins/video/cursor/cursor.o  -Wl,-Bsymbolic-functions -lm -ldl -lnsl -L/usr/local/lib -Wl,-z,defs -Wl,--warn-unresolved-symbols -shared ./out/linuxx86/optimize/libs/libcrystalspace-1.2.a -lpthread -lz -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -lm -ldl -lnsl -L/usr/local/lib -Wl,-z,defs -Wl,--warn-unresolved-symbols \
      -Wl,-soname,cscursor.so
  

  objcopy --add-section .crystalspace=plugins/video/cursor/cscursor.csplugin cscursor.so

make[1]: *** [all] Error 1

  Changed 5 months ago by anonymous

What is the patch that fixes this?

  Changed 5 months ago by vknecht

  • milestone deleted

The output you show us for 1.2.1 doesn't show any actual error,
and certainly not the same as in the first post.
Please find and report the actual error message.
You could for example ask make to stop on first error, if you can't see it.
Also note that Jam is the preferred way to build CS.

follow-up: ↓ 6   Changed 5 months ago by anonymous

The output doesn't show any error because I used --disable-separate-debug-info flag. How is possible to use Jam to build?

in reply to: ↑ 5   Changed 5 months ago by sunshine

Replying to anonymous:

What is the patch that fixes this?

The -Wno-long-double issue was resolved in trunk over several revisions as detailed by #463. The changes were applied to the 1.2 branch in r29267.

Replying to vknecht:

Also note that Jam is the preferred way to build CS.

The Makefile just invokes Jam automatically anyhow, so there really is no functional difference. The only noticeable differences are that Makefile enables verbose output and tells Jam to stop after the first error by default (unless make -k is used).

Replying to anonymous:

The output doesn't show any error because I used --disable-separate-debug-info flag. How is possible to use Jam to build?

If you don't have Jam installed separately, you can just invoke ./jam in the CS directory.

Perhaps the error appeared earlier in the output. Given that Makefile is actually invoking Jam, you need to look for the error earlier since Jam dumps error messages first, followed by the command that resulted in the error after.

  Changed 5 months ago by sunshine

  • description modified (diff)

follow-up: ↓ 10   Changed 5 months ago by anonymous

Some error in the latest snapshot:

        mkdir -p "./out/linuxx86/optimize/plugins/video/cursor"


    g++ -c -o ./out/linuxx86/optimize/plugins/video/cursor/cursor.o -I. -I./include -I./include -Wall -g -O2 -pipe -Wall -g -O2 -Wall -Wno-unknown-pragmas -fvisibility=hidden -I/usr/local/include -g -O2 -g -O2 -fno-exceptions -fvisibility-inlines-hidden -O3 -fomit-frame-pointer -ffast-math -g2 -fPIC  plugins/video/cursor/cursor.cpp

In file included from plugins/video/cursor/cursor.h:23,
                 from plugins/video/cursor/cursor.cpp:38:
./include/ivideo/graph2d.h:146: warning: 'iOffscreenCanvasCallback' is deprecated (declared at ./include/ivideo/graph2d.h:145)

    g++ -Wl,--as-needed -o cscursor.so ./out/linuxx86/optimize/plugins/video/cursor/cursor.o  -Wl,-Bsymbolic-functions -lm -ldl -lnsl -L/usr/local/lib -Wl,-z,defs -Wl,--warn-unresolved-symbols -g2 -shared -Wl,--gc-sections ./out/linuxx86/optimize/libs/libcrystalspace-1.9.so -lz -lpthread -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -lm -ldl -lnsl -L/usr/local/lib -Wl,-z,defs -Wl,--warn-unresolved-symbols -g2 \
      -Wl,-soname,cscursor.so
  

  objcopy --add-section .crystalspace=plugins/video/cursor/cscursor.csplugin cscursor.so


  objcopy --only-keep-debug cscursor.so ./cscursor.dbg
  objcopy --strip-unneeded cscursor.so
  objcopy --add-gnu-debuglink=./cscursor.dbg cscursor.so
  test -n "chmod" && chmod a-x ./cscursor.dbg

make[1]: *** [all] Error 1
make[1]: Leaving directory `/tmp/buildd/crystalspace-1.3-20080624/CS'
make: *** [build-arch-stamp] Error 2
dpkg-buildpackage: failure: debian/rules build gave error exit status 2

in reply to: ↑ 9 ; follow-up: ↓ 13   Changed 5 months ago by anonymous

Replying to anonymous:

Some error in the latest snapshot:

Same, not some, sorry.

  Changed 5 months ago by sunshine

Here is the actual error from the build log:

        mkdir -p "./out/linuxx86/optimize/plugins/cscript/csjava/src/org/crystalspace3d"


        mkdir -p "./out/linuxx86/optimize/plugins/cscript/csjava"


    swig -java -c++ -java -package org.crystalspace3d -I./include -I./include -outdir ./out/linuxx86/optimize/plugins/cscript/csjava/src/org/crystalspace3d -o ./out/linuxx86/optimize/plugins/cscript/csjava/csjava.cpp ./include/bindings/cspace.i
    sed 's/\([ 	]*#[ 	]*include[ 	][ 	]*[<"]Python.h[>"]\)/\
    #ifndef __STDC_CONSTANT_MACROS\
    #define __STDC_CONSTANT_MACROS\
    #endif\
    #ifndef __STDC_LIMIT_MACROS\
    #define __STDC_LIMIT_MACROS\
    #endif\
    #ifndef DEBUG_PYTHON\
    #undef _DEBUG\
    #endif\
    \1/g
    /$Header:/d
    s/new[ 	][ 	]*(\([^)][^)]*\))[ 	]*\[/new \1 [/g
    s/[ 	]*#[ 	]*define[ 	][ 	]*SWIG_init[ 	]*init_\(.*\)/#define SWIG_init SWIG_init_\1/g
    s/\([	 ]*#[	 ]*include[	 ][	 ]*[<"]perl.h[>"]\)/\
    #ifndef _DIRENT_H_\
    #define _DIRENT_H_\
    #endif\
    \1/g' < ./out/linuxx86/optimize/plugins/cscript/csjava/csjava.cpp > ./out/linuxx86/optimize/plugins/cscript/csjava/csjava.cpp.sed
    rm -f ./out/linuxx86/optimize/plugins/cscript/csjava/csjava.cpp
    mv -f ./out/linuxx86/optimize/plugins/cscript/csjava/csjava.cpp.sed ./out/linuxx86/optimize/plugins/cscript/csjava/csjava.cpp
  
./include/bindings/java/javapre.i:55: Error: Syntax error in input(1).
/bin/sh: cannot open ./out/linuxx86/optimize/plugins/cscript/csjava/csjava.cpp: No such file
mv: cannot stat `./out/linuxx86/optimize/plugins/cscript/csjava/csjava.cpp.sed': No such file or directory
...skipped <plugins!cscript!csjava!>csjava.o for lack of <plugins!cscript!csjava>csjava.cpp...

This is telling us that there is a syntax error in CS/include/bindings/java/javapre.i at line 55.

That was the only error from the CS portion of that build log (though there were quite a lot of warnings.)

Note that it would be easier to track down these errors if make was told to stop immediately upon the first error (in other words, drop the -k flag from the make invocation).

  Changed 5 months ago by sunshine

  • summary changed from ...skipped cscursor.so for lack of libcrystalspace-1.2.a... to Syntax error in javapre.i

in reply to: ↑ 10   Changed 5 months ago by sunshine

Replying to anonymous:

Replying to anonymous:

Some error in the latest snapshot:

Same, not some, sorry.

By snapshot do you mean the trunk (1.3)? If so, you should instruct make to abort at the point where the error occurs so that we can find out exactly what the problem is (and open a separate ticket if it is a different problem). As it stands now, make is continuing after the error, and you are learning that there was a problem only at the end of the make run, but the actual error message is buried somewhere (possibly much) earlier in the build log (not at the end of the make output).

follow-up: ↓ 15   Changed 5 months ago by anonymous

If I build with --without-java it builds fine. However I don't understand what I should do to provide you more infos about this bug, can you please explain me what I should do?

in reply to: ↑ 14   Changed 5 months ago by sunshine

Replying to anonymous:

If I build with --without-java it builds fine. However I don't understand what I should do to provide you more infos about this bug, can you please explain me what I should do?

You probably do not need to provide any additional information. Someone needs to examine the syntax error in javapre.i in the 1.2 branch and fix it.

You did, however, mention something about a snapshot, but it was not clear if you were talking about a 1.2.x snapshot or a trunk (1.3) snapshot. If you were talking about the trunk, then we would need to see that error separately and it should be submitted as a distinct bug report, not part of this ticket.

follow-up: ↓ 17   Changed 5 months ago by anonymous

The bug is in 1.2.1 final version (http://www.crystalspace3d.org/downloads/release/crystalspace-src-1.2.1.tar.bz2) and also in cs-current-snapshot.tar.bz2 tarball (downloaded from http://crystalspace3d.org/cvs-snapshots/bzip2/ , i think is the trunk because it seems to be 1.9 version).

in reply to: ↑ 16   Changed 5 months ago by sunshine

Replying to anonymous:

The bug is in 1.2.1 final version and also in cs-current-snapshot.tar.bz2 tarball, i think is the trunk because it seems to be 1.9 version).

If the problem is in 1.9, then it also probably is in the new 1.4 branch.

What version of Swig do you have installed?

  Changed 5 months ago by anonymous

swig 1.3.35 as you can see in the build log posted before.

follow-ups: ↓ 20 ↓ 27   Changed 5 months ago by vknecht

It would be interesting to check if the errors also occurs with swig 1.3.31 (known to work here) and/or 1.3.33.

in reply to: ↑ 19   Changed 2 months ago by revms

Replying to vknecht:

It would be interesting to check if the errors also occurs with swig 1.3.31 (known to work here) and/or 1.3.33.

I hit this problem too: 1.3.33 doesn't work. 1.3.31 does, not sure about 32.

  Changed 2 months ago by sunshine

It might be helpful if someone could test with the latest trunk since some fixes were applied in #543. I do not expect that these fixes will resolve this particular issue, but it would be useful to know anyhow.

Further, it would be helpful if someone could tell Swig 1.3.33 to dump the output of its pre-processing step so that we can see the actual error line since the line it reported (55) almost certainly is not the physical line in the input javapre.i file. We will need to look at Swig's pre-processed output to see which line it considers line 55.

To capture the pre-processor output, take the Swig command-line invocation and add the -E option and drop the -o arg option. Then redirect the output to a file, such as swigpostproc.txt. For instance:

swig -java -c++ -java -package org.crystalspace3d -E -I./include -I./include -outdir ./out/linuxx86/optimize/plugins/cscript/csjava/src/org/crystalspace3d ./include/bindings/cspace.i > swigpostproc.txt

Run this command line manually and then attach swigpostproc.txt to this ticket. We also will need to see the actual error message from a normal Swig build run since the line 55 in the 1.2 branch will have moved in the trunk.

follow-ups: ↓ 23 ↓ 25   Changed 1 month ago by erluk

With latest trunk (r31355) and Swig 1.3.35, the error is in line 67.

CS/include/bindings/java/javapre.i:67: Error: Syntax error in input(1).

Changed 1 month ago by erluk

in reply to: ↑ 22   Changed 1 month ago by sunshine

Replying to erluk:

With latest trunk (r31355) and Swig 1.3.35, the error is in line 67.

Hmm, that line number still does not seem to point at a meaningful source line (containing a syntax error).

  Changed 1 month ago by res

The syntax could be right but the parser broken.

Changed 1 month ago by sunshine

CS 1.2 build log from original reporter.

Changed 1 month ago by sunshine

CS 1.2.1 build log from original reporter.

in reply to: ↑ 22   Changed 1 month ago by sunshine

Replying to erluk:

With latest trunk (r31355) and Swig 1.3.35, the error is in line 67.

I confirm the problem with Swig 1.3.33. Reported line 67 with trunk.

  Changed 1 month ago by sunshine

The line 67 syntax error is resolved by r31357, however the original reported problem is still present.

in reply to: ↑ 19   Changed 1 month ago by sunshine

Replying to vknecht:

It would be interesting to check if the errors also occurs with swig 1.3.31 (known to work here) and/or 1.3.33.

I just checked, and the syntax error actually is reported even with Swig 1.3.31. The difference, however, with later versions is that Swig 1.3.31 continues processing despite the error. Given that this is flagged as an error (rather than a warning), this should result in an abort, and it is a bug that Swig 1.3.31 does not abort. The behavior of later Swig versions, which do abort, therefore seems correct.

  Changed 1 month ago by sunshine

All of the Swig syntax errors reported in this ticket are resolved by r31360, however, javapre.i still is not free of syntax errors, so further investigation is required.

  Changed 1 month ago by sunshine

  • owner changed from admin to sunshine
  • status changed from reopened to accepted

  Changed 1 month ago by sunshine

  • status changed from accepted to closed
  • resolution set to fixed

Remaining Swig syntax error resolved by r31363.

  Changed 1 month ago by sunshine

Additional linking problem resolved by r31365.

  Changed 1 month ago by sunshine

Also r31371 resolves minor issue with r31365.

Add/Change #492 (Syntax error in javapre.i)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.