GCC 4 support?

Archives Forums/Linux Discussion/GCC 4 support?

Craig Watson(Posted 2007) [#1]
I did a bit of experimentation with getting BlitzMax to build 32 bit binaries on a 64 bit Ubuntu 7.04 install.

In order to get everything to compile and link without too much complaining, I modified bmk to use GCC/G++ 4 compilers, and added the lib32 folder to the library search paths. I rebuilt all modules, with the only issue being Jasper mod. I did also have to link some stuff in the lib32 folder so that it'd get picked up. I had installed a bunch of ia32 libraries as advised on Ubuntuforums.

Using this setup, I actually got it to successfully build and run Digesteroids once (the rest of the time it segfaulted.)

It seems as if the -m32 parameter works much better under GCC 4 on Ubuntu, and Ubuntu seems set up for having 32 bit apps built under 4 rather than 3.3. I cannot vouch for other distros in this regard.

Is there any real reason why Blitz is still forcing GCC 3 on Linux? It seems to me that GCC 4 has become pretty much standard across all distros now, and we're using it on MacOS anyway.


Paul "Taiphoz"(Posted 2007) [#2]
Yeah I am having trouble with UB7 and not having gcc 3.3, I was thinking of forcing a 3.3 install and over write the newer files but that could lead to problems with other installed apps.


BRL ??


Brucey(Posted 2007) [#3]
You don't need gcc 3.3 installed.

gcc 4 will work fine. It's just that BlitzMax tries to run specifically the gcc3.3 executable . All you need to do is create a symlink that maps the gcc4 binary to the name that BlitzMax tries to run.

The gcc running on my machine is 4.1.1.
I have a symlink in /usr/bin made with the following command :

ln -s /usr/bin/gcc /usr/bin/gcc-3.3

Ideally of course, the command to compile with gcc would not specify a specific version. (I'm sure you can edit bmk to point it to gcc rather than gcc-3.3)


Craig Watson(Posted 2007) [#4]
I'm surprised that it's working fine for you Brucey. Forcing GCC 4 seems to be good at producing code that mainly segfaults on my machine (Ubuntu 7.04.)

It is fairly easy to edit out 3.3 from bmk in any case.

I'll have to mess with it some more I guess. If it's stable enough for most people I don't see why the Linux version should be out of sync with the Mac one, especially with GCC 4 rapidly becoming the standard build environment on Linux distros.


Paul "Taiphoz"(Posted 2007) [#5]
Craig if you get it working in UB7 let me know please.


Craig Watson(Posted 2007) [#6]
Yavin, 3.3 is fine under Ubuntu 7 in any case. Installing it won't overwrite anything else, and it should be able to co-exist fine with 4.

If you're using AMD64 Ubuntu 3.3 won't build 32-bit binaries though, so it's a waste of time for that.


anawiki(Posted 2007) [#7]
@Brucey: (I'm sure you can edit bmk to point it to gcc rather than gcc-3.3)

If I edit BMK to use gcc instead of gcc-3.3 will it work on every linux? Indiegamer fellows tested Runes of Avalon and it fails to run without gcc3.3, but they have gcc4. I don't know how to make it "cross-compatibile" (and I am providing them "exe")

cheers
Roman


Brucey(Posted 2007) [#8]
A built app should work with either gcc, given that a gcc isn't required to run compiled code.

I've built stuff on Ubuntu and run it on SuSe. As long as the machine has the libraries on it, there shouldn't be a problem.

Perhaps they were missing a library or two? (like GL etc ?)


anawiki(Posted 2007) [#9]
Brucey, here's the post:
http://forums.indiegamer.com/showpost.php?p=132339&postcount=3

Maybe I misunderstood him.

cheers
Roman


Craig Watson(Posted 2007) [#10]
libstdc++ is the Standard library from GCC.

libstdc++ ".so.5" AFAIK should be referring to the 3.3 version. ".6" belongs to version 3.4+.


Craig Watson(Posted 2007) [#11]
Brucey, I just tried compiling with GCC 4 under Ubuntu 7.04, both on my regular dev machine and my clean installed machine, and both reliably segfaulted or sig 11-ed pretty much any code I could build.

Most apps successfully run for about 5-10 seconds before bombing.

Not really sure as yet what could be the issue.