The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: steffen on May 08, 2010, 10:03:59 PM

Title: Compile errors in Linux 64-bit
Post by: steffen on May 08, 2010, 10:03:59 PM
Ok I got the latest git from http://github.com/jamespetts/simutrans-experimental.git and tried to compile it with DEBUG=1. There's a lot of compiler warnings (unrecognised option -NDEBUG and ignoring return value in particular I noticed to pop up dozens of times), one that may be especially relevant in this context is "comparison between signed and unsigned integer expressions". I'm guessing you dont want the whole output tho, right?
In the end it fails tho with this this:
===> CXX simgraph16.cc
g++: unrecognized option '-NDEBUG'
simgraph16.cc: Assembler messages:
simgraph16.cc:2233: Error: suffix or operands invalid for `jmp'
make: *** [simgraph16.o] Error 1

steffen@steffen ~/simutrans-git/simutrans-experimental $ gcc -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.4.2/work/gcc-4.4.2/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.2 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.2 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.2/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.2/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.4.2/python --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.4.2 p1.0'
Thread model: posix
gcc version 4.4.2 (Gentoo 4.4.2 p1.0)

The uncommented lines in config.default are:
BACKEND = sdl
COLOUR_DEPTH = 16
OSTYPE = linux
FLAGS =  -DSTEPS16 -NDEBUG -DSLIST_FREIGHT
DEBUG=1

I simply typed "make" in the simutrans-experimental directory. Other than creating config.default I made no changes after the git checkout, the exact version is fd325639e88e8ad642d53924123f2668d2d4b5e0

What's going wrong?
Title: Compile errors in Linux 64-bit
Post by: steffen on May 08, 2010, 11:15:18 PM
I just installed gcc-4.4.3-r2 and I tried make clean && make but same problem. I'm installing gcc-4.3.4 now as well just to see if thats the problem.

Oh and just for the record I completely agree that 64bit should be lower priority, but its nice and I think also important in the medium-long term to keep going at it with low priority :)
Title: Compile errors in Linux 64-bit
Post by: jamespetts on May 08, 2010, 11:47:04 PM
Steffen,

thank you for your report. It's quite hard for me to try to piece together the issues here as I don't have either a Linux system or a 64-bit system on which to test. What's worse, the source file in which you have the error (simgraph16.cc) is not a file that has any differences between Standard and Experimental. The first thing to do, therefore, is to try getting the latest Simutrans-Standard code and see whether there are any differences in result there.
Title: Compile errors in Linux 64-bit
Post by: steffen on May 09, 2010, 12:34:19 AM
Ok I got the latest svn from svn://tron.homeunix.org/simutrans/simutrans/trunk and am getting the same error, but oddly in a different line:
===> CXX simgraph16.cc
g++: unrecognized option '-NDEBUG'
simgraph16.cc: In function 'void rezoom_img(image_id)':
simgraph16.cc:1290: warning: comparison between signed and unsigned integer expressions
simgraph16.cc: Assembler messages:
simgraph16.cc:2370: Error: suffix or operands invalid for `jmp'
make: *** [simgraph16.o] Error 1

This is again with gcc-4.4.3-r2
Title: Re: Compile errors in Linux 64-bit
Post by: jamespetts on May 09, 2010, 12:36:46 AM
I have split and moved this topic because the issue is not specific to Simutrans-Experimental.
Title: Re: Compile errors in Linux 64-bit
Post by: steffen on May 09, 2010, 12:38:55 AM
For all future bug reports I'll be sure to check both std and exp :)
Back on topic, a quick diff between the latest exp git version and the latest std svn version reveals 7 pages of differences.
Title: Re: Compile errors in Linux 64-bit
Post by: steffen on May 09, 2010, 01:58:46 AM
I forgot to mention, the error persists with gcc-4.3.4 (I only tried experimental but I think its safe to assume the same for std)
Title: Re: Compile errors in Linux 64-bit
Post by: ansgar on May 09, 2010, 02:36:23 AM
You have to use -DNDEBUG (not -NDEBUG) and add -DUSE_C (the assembler code is only for x86).
Title: Re: Compile errors in Linux 64-bit
Post by: steffen on May 09, 2010, 05:21:55 AM
For USE_C, could you add a note of this to config.template?
As for the debug part, that looks like a typo in config.template, can you change it in there?

But with these two changes it now compiles, thanks :)
Title: Re: Compile errors in Linux 64-bit
Post by: prissi on May 09, 2010, 06:42:35 PM
Just see config.template:

# The following conditional compilation flags exist
...
# USE_C: no assembler for copying (when not using x86 and GCC>=3.x)
# BIG_ENDIAN: MUST by set for PPC/Motorola byte order! (old mac, amiga)
#
# In order to use the flags, add a line like this:
# FLAGS = -DUSE_C -DBIG_ENDIAN


I found this fairly clear ...
Title: Re: Compile errors in Linux 64-bit
Post by: steffen on May 09, 2010, 08:57:26 PM
Yes you're right, I just searched it for 64 specifically. My bad.

But the "-NDEBUG" still looks like a typo to me?
Title: Re: Compile errors in Linux 64-bit
Post by: prissi on May 10, 2010, 02:58:22 PM
I find only -DNDEBUG in the Makefile. Is experimental using an older version?
Title: Re: Compile errors in Linux 64-bit
Post by: steffen on May 10, 2010, 03:30:57 PM
The typo is in config.template on the last line
Title: Re: Compile errors in Linux 64-bit
Post by: sdog on May 11, 2010, 03:02:52 AM
damnit, completely overlooked this topic, and stumbled over the assembler code yesterday!