Patches for 64bit linux
I'll be posting patches to improve compatibility with 64bit linux compiles in this thread.
First up, makefile changes to allow it to begin compiling. Code:
Index: eqlaunch/makefile If desired, I could create patches so the makefile will selectively add the -march=i686 for 32 bit machines. |
Type cast in common/TCPConnection.cpp to fix compile error under 64bit.
Code:
Index: common/TCPConnection.cpp |
Apparently va_lists are not preserved in (most) 64bit linux libraries after vprintf (and variations) calls. This causes segfaults under 64bit when a va_list is reused. This patch avoids reusing va_lists.
Code:
Index: common/MiscFunctions.cpp |
This patch fixes disappearing augments and no drop flags seemingly randomly toggling on items in inventory with 64bit linux compiles.
Code:
Index: common/shareddb.cpp |
This patch fixes assembler errors on some 64bit systems.
Code:
Index: common/crc32.cpp |
I did a whole pile of type casts where MakeAnyLenString was being used with %lu in the format string. This patch is over 400 lines long so rather than post it here, it can be retrieved at:
Code:
svn diff -c 8 https://www.tsahosting.net/svn/eqemu64/trunk/ |
The following patch removes the optimize flag (-O) when building common/patches/SoF.o. There is a bug in gcc that causes stringstreams not to work if optimized under 64bit.
Without this patch to the makefile, zone will segfault when a SoF client tries to enter the game (post char select). I also patch the makefile for world since the same object file is linked into world. Code:
Index: world/makefile |
I needed to add this header include to ucs/clientlist.cpp to compile on my system. I do not know if this is a 64bit problem or just my version of gcc.
Code:
Index: ucs/clientlist.cpp |
Just realized I hadn't given credit to ndnet for his work on the patch that fixed the missing augments. He is the one who found that fix.
|
I'll try to get to this stuff in the next few days, sorry I almost forgot about it.
|
No worries. I just figured they could be done one at a time as time permits. Thanks.
|
Quote:
|
I was gonna commit some of this tonight but I ran into some issues; not entirely your fault.
Some comments: There is no va_copy() on windows. I also don't believe socklen_t is defined type on windows, though I didn't look into it further. |
The va_copy() probably could be replaced with a memcpy. The socklen_t could be inside an #ifdef.
Feel free to do whatever you think is best. And fyi, I know C much better than I know C++, so if there are better ways of doing things, change it :) |
Here is another patch. This one fixes loading the regular and water map files.
Code:
Index: zone/map.h |
Quote:
va_list apcopy = ap; From what I was reading, va_copy is just the following define in most cases: #define va_copy(d,s) ((d) = (s)) |
In fact, it probably would be more efficient to simply create copies of va_lists everywhere instead of reusing va_start and va_end like I did in my patch. I could submit another patch doing that and accounting for va_copy missing under windows if you would like.
|
I can get it to compile without bots, but when I activate -DEQBOTS, I get a lot of this;
Code:
/usr/bin/ld: Dwarf Error: Offset (217430) greater than or equal to .debug_str size (1812). Hoping you might can help me. thanks |
Quote:
Sorry for all the questions, but the more information you get me, the more likely I'll be able to find the problem. Thanks. |
GCC ver is 4.3.2, and is 64 bit - what you have posted here;
https://www.tsahosting.net/svn/eqemu64/trunk/ I just downloaded it and compiled - it appeared to have all the patches posted in this thread. here's the piece where it crashes; Code:
[root@marysol zone]# make |
Looks to me like you didn't add the bot object files into zone/makefile.common that are needed for -EQBOTS to work. This patch will do it for you.
Code:
diff -up EQEmuServer/zone/makefile.common.dan EQEmuServer/zone/makefile.common |
KLS, try this patch for va_lists under windows. It defines va_copy if it is not already defined.
Code:
Index: common/MiscFunctions.cpp |
Somehow a uint16 in the patch was changed to a uint32 in the SVN. The following patch fixes this:
Code:
Index: zone/map.h |
If the va_list patch is what is causing the zone.exe crashes under windows, this patch should avoid the problem by using #ifndef WIN32 blocks. This patch should be applied against rev706 or later.
Code:
Index: common/MiscFunctions.cpp |
No crashes for va_lists from windows that I can find.
|
Excellent.
|
All times are GMT -4. The time now is 09:35 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.