PDA

View Full Version : Compile problems under RHEL


RequiemTCE
06-03-2009, 05:08 AM
System:
2.6.24.5-grsec #1 SMP Thu Dec 18 18:11:30 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

gcc version 4.3.2 20081007 (Red Hat 4.3.2-7) (GCC)

I run into this when attempting to build most of the directories in the source checked out via SVN (Rev 619):

common/TCPConnection.cpp -o ../common/TCPConnection.o
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
../common/TCPConnection.cpp: In member function bool TCPConnection::GetSockName(char*, uint16*):
../common/TCPConnection.cpp:148: error: cannot convert size_t* to socklen_t* for argument 3 to int getsockname(int, sockaddr*, socklen_t*)
make: *** [../common/TCPConnection.o] Error 1
make: Leaving directory `/home/eqemu/incoming/EQEmuServer/zone'

I made some light modifications to the makefiles in each directory to specify an alternate compiler/linker and to remove "-march=i686" from COPTS to prevent: "../common/timer.cpp:1: error: CPU you selected does not support x86-64 instruction set"

Any ideas?

RequiemTCE
06-03-2009, 05:21 AM
I selected GCC 4.3.2 per: http://www.eqemulator.net/forums/showpost.php?p=170989&postcount=7

RequiemTCE
06-03-2009, 06:04 AM
Ok, I've got it compiled now. Here's what I did to make it compile under RHEL/x86_64.

Install GCC 4.3.2:
yum install gcc43 gcc43-c++
----------------

Modify the following files:

EMuShareMem/makefile
world/makefile
zone/makefile
eqlaunch/makefile
mailserver/makefile
chatserver/makefile
In each of these, replace all instances of "gcc" with "gcc43", and remove "-march=i686" from the COPTS section(if present).

----------------

Modify utils/Makefile:
Replace all occurances of "g++" with "g++43".

----------------

Modify common/TCPConnection.h as follows:
#else
size_t addrlen;
#endif
becomes
#else
socklen_t addrlen;
#endif

----------------

Modify common/crc32.cpp as follows:
//#if !defined(i386)
//#define i386 // If you are on a non-Intel based platform (Sparc/HP/NEC/etc), you will want$
//#endif
becomes
//#if !defined(i386)
//#define i386 // If you are on a non-Intel based platform (Sparc/HP/NEC/etc), you will want$
//#endif
#undef i386

gaeorn
06-03-2009, 07:49 AM
Based on the errors you ran into compiling, I'm guessing you are running a 64bit system. There are other changes needed to get 64bit working properly (and it's still a work in progress). Let me know if I am correct and I'll post some patches for you.

RequiemTCE
06-03-2009, 08:52 AM
Based on the errors you ran into compiling, I'm guessing you are running a 64bit system. There are other changes needed to get 64bit working properly (and it's still a work in progress). Let me know if I am correct and I'll post some patches for you.

I am running it on a 64-bit server yes. The issue I'm having right now is that it times out attempting to load items from the database when launching the world or zone servers.

Also, addendum to above: Copy libEMuShareMem.so into /lib64.

[Debug] [WORLD__INIT] Loading items..
[Status] libEMuShareMem.so loaded


Error: EMuShareMem: DLLLoadItems: !ItemsMMF.IsLoaded() (timeout)
[Debug] [WORLD__INIT_ERR] Error: Could not load item data. But ignoring

gaeorn
06-03-2009, 12:25 PM
Did you increase the shared memory size for the system? If not, add:

kernel.shmmax = 134217728

to /etc/sysctl.conf and reboot. Otherwise, I have no idea why you would be having problems reading in the items.

RequiemTCE
06-16-2009, 11:43 PM
I just got back to trying to get this working.

From /etc/sysctl.conf:

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296


You had mentioned some patches, is there a suggested method for going about getting a codebase that will work in 64-bit?

gaeorn
06-17-2009, 01:10 PM
If you look in these forums under development: code submissions, there is a list of patches for 64bit systems I have submitted to be included in the code base.