Which linux to compile a mod?


(Micha) #1

Hello, a friend of me wants to help setting up a virtual box to compile a mod.
I wonder which version would be best to use?
I read something that gcc should be version 4.


(Nitrox_) #2

I’m using Debian 4.0 for all my ET stuff, works great.
The problem is about libc, because some game servers hosts use old linux versions, and if the mod is compiled with a recent libc, it won’t load… (i experienced this once with gameservers.com, that’s why i downgraded to Debian 4).


(ETJump-Zero) #3

I use Ubuntu 8. Nitrox explained why. Basicly any old linux with a rather old GCC (3.x) is fine.

Setting up old linux versions on VM can be a bit more difficult than a newer versions.


(Micha) #4

Thank you for you reply. We tried with Ubuntu 8 now.


(Dragonji) #5

That ancient GCC :smiley:

Isn’t it better to compile newest GCC for an old distro and compile the mod with all of the good stuff new GCC come with?


(Micha) #6

Most providers seem to run a old gcc so it is needed to use a old one too.


(Dragonji) #7

GCC version on server machines completely does not matter. GCC does not run binaries AFAIK?


(Nitrox_) #8

You’re right Dragonji, gcc version doesn’t matter at all.
It’s all about libc version. Using a newer gcc/libc would probably improve a few things, but if it can’t be ran on most game servers, what’s the point ? :frowning:


(ETJump-Zero) #9

The problem is that if you compile with a new GCC, it’ll link dynamicly to newer version of GLIBC which makes the binaries impossible to run on provider machines (as they have old glibcs (gameservers.com had glibc 2.3 a year or two ago, which is from 2003 if I remember correctly)). If you compile with a very old compiler like gcc 3.x you’ll link the symbols to a very old version of glibc => everyone can use it.

This is problematic if for example you want to use c++11/14 features in your mod. Only latest compilers support these and most of the features require updated version of libstdc++.

EDIT: I suppose you can link statically aswell but that requires the mod to be GPL’d or LGPL’d.


(gaoesa) #10

You can’t link libc statically. It is the library that ties your program to the operating system. You can link libstdc++ statically, but you still can’t use new version of the GCC, because the generated code will still depend on a newer version of libc. If you use Clang, you can use a newer version of the compiler and it would work. However, even with Clang, you can’t use C++11 features. If you really want to experiment far on this, you need to build your own version of the C++ library and the ABI library that is specifically suitable for static linking. But I don’t promise that it would work either. The bottom problem is, as far as I understand it, that the ELF format is not good for portability.


(ETJump-Zero) #11

Could be, I was mainly thinking about libstdc++ here indeed. Pretty sure you can link it statically (atleast I’ve managed to do that on a simple program (also http://stackoverflow.com/questions/13636513/linking-libstdc-statically-any-gotchas)). Not a huge compiler genius anyway so I could be wrong.


(Micha) #12

Hi, I run on another problem. The mod runs well on linux and windows 7 64 bit servers but I don’t get it working on a windows 2008 x64 dedi box.
It always loads in etmain and not “infected” mod (it works if I use the Release compile without Lua). The mod uses lua 5.2.1 with the Win64_dll8_lib from http://sourceforge.net/projects/luabinaries/files/5.2.1/Windows%20Libraries/Dynamic/

The Readme says: Win32_dll8: DLL and import library built with vc8, creates dependency with MSVCR80.DLL
vc8 is vc 2005 (if I’m correct) but I compile with Microsoft Visual C++ 2010 Express.

Solved:
Admin installed “Microsoft Visual C++ 2010 Redistributable Package (x86)” and “x64” version. Problem came because it’s an old windows server and uses 32bit on 64bit machine.