EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Linux Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=588)
-   -   Building the login server on CentOS 4.8 (https://www.eqemulator.org/forums/showthread.php?t=31034)

number6 04-13-2010 11:17 AM

Building the login server on CentOS 4.8
 
As subject, I am trying to build the SVN login server and having difficulties linking with the pre-compiled crypto libraries. I am using the gentoo 32-bit files, though the ubuntu ones also fail with more errors. The output from the link:
Code:

-bash-3.00$ make
gcc -o EQEmuLoginServer Client.o ClientManager.o Config.o
DatabaseMySQL.o ErrorLog.o Main.o ServerManager.o WorldServer.o
.obj/BasePacket.o .obj/Condition.o .obj/CRC16.o .obj/crc32.o .obj/debug.o
 .obj/emu_opcodes.o .obj/EmuTCPConnection.o .obj/EmuTCPServer.o
.obj/EQPacket.o .obj/EQStream.o .obj/EQStreamFactory.o .obj/logsys.o
.obj/logsys_eqemu.o .obj/misc.o .obj/MiscFunctions.o .obj/Mutex.o
.obj/opcodemgr.o .obj/packet_dump.o .obj/packet_functions.o .obj/rdtsc.o
.obj/TCPConnection.o .obj/TCPServer.o .obj/timeoutmgr.o .obj/timer.o
.obj/unix.o -Wall -Wuninitialized -Wwrite-strings -Wcast-qual
-Wno-deprecated  -Wcomment -Wcast-align -O -g -march=i686 -pthread
-pipe -DEQLAUNCH -DEQDEBUG=5 -I/usr/include/mysql  -g -pipe -m32
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-fno-strict-aliasing -fwrapv  -rdynamic -L. -lstdc++ -ldl -rdynamic -L/usr
/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib -lssl -lcrypto
-lEQEmuAuthCrypto -lcryptopp -fno-stack-protector

./libEQEmuAuthCrypto.a(EQEmuAuthCrypto.o)(.text+0x1488):
In function `DecryptUsernamePassword(char const*, unsigned int, int)':

: undefined reference to `__stack_chk_fail'
./libEQEmuAuthCrypto.a(EQEmuAuthCrypto.o)(.text+0x1738):
In function `Encrypt(char const*, unsigned int, unsigned int&)':

: undefined reference to `__stack_chk_fail'
./libEQEmuAuthCrypto.a(EQEmuAuthCrypto.o)(.text+0x18d4):
In function `encSHA(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':

: undefined reference to `__stack_chk_fail'
./libEQEmuAuthCrypto.a(EQEmuAuthCrypto.o)(.text+0x1a55):
In function `encSHA512(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':

: undefined reference to `__stack_chk_fail'
collect2: ld returned 1 exit status
make: *** [EQEmuLoginServer] Error 1

I added "-fno-stack-protector" to the link command after some googling but to no avail. I have a feeling this is a mismatch of gcc versions used to make the libraries and my own one.
Code:

-bash-3.00$ gcc -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking

 --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-11)

Anyone got any ideas? I am at a bit of a loss!

Thanks

Paul.

gaeorn 04-13-2010 11:55 AM

One of the devs with the crypto source will probably have to build a new version of the library for it to work on a system that old. And I'm not sure anyone will want to bother since that is a rather old version of CentOS.

Have you tried building the login server under a more recent version of CentOS?

number6 04-13-2010 12:34 PM

Quote:

Originally Posted by gaeorn (Post 186484)
Have you tried building the login server under a more recent version of CentOS?

I see what you mean. The trouble is that this is a managed server and I don't have a way to get it updated in the short term due to other stuff running on it that's critical.

Kobaz 04-14-2010 05:16 PM

you could try using alien and debbootstrap to build a minimal up-to-date version of debian that runs in a chroot and build your login server in that. Probably wise to test on a non-critical system 1st though.

Once you have the server built, put it in a directory with the libraries it depends upon and use the LD_PRELOAD variable to force it to use the right libraries, so you don't have to use a chroot if you don't want to (I would run it in a chroot, to minimise the risk to business applications).

The old-school businessman part of me wonders why you'd build a game server on a system that has a "mission critical" role. Seems like a great way to piss off bosses/shareholders.

number6 04-15-2010 03:34 AM

Quote:

Originally Posted by Kobaz (Post 186535)
The old-school businessman part of me wonders why you'd build a game server on a system that has a "mission critical" role. Seems like a great way to piss off bosses/shareholders.

Well, I'm not at liberty to say except that the only person I'd piss off would be me. So that's alright then. :)

Thanks for the ideas, I'll ponder...

Paul.

number6 04-19-2010 08:47 AM

A very quick update - I got it working! I compiled with Centos 5.4 and copied the binary and libraries over. The only extra thing was to launch the executable with ld-2.5.so - see the following script which also shows the various libraries that were copied. I simply put these in a subdirectory "lib". Anyway I hope this is of some use to someone.

Cheers

Paul.
Code:

#!/bin/sh
# noddy script to run login server with wrong libraries
# NB the LD_PRELOAD stuff is all on one line in the real file

cd /home/eq/server/loginserver
LD_PRELOAD="lib/libc-2.5.so:lib/libcrypto.so:lib/libcrypt.so:lib/libc.so.6:lib
/libdl.so:lib/libgcc_s.so:lib/libm.so:lib/libnsl.so:lib/libpthread.so.0:
lib/libssl.so:lib/libstdc++.so.6:lib/libz.so.1"
export LD_PRELOAD
./ld-2.5.so ./EQEmuLoginServer



All times are GMT -4. The time now is 04:41 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.