Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-26-2003, 08:47 PM
var1ety
Sarnak
 
Join Date: Jan 2003
Posts: 59
Default Full compatibility patches for FreeBSD 5.2rc2 (0.5.3dr2)

(Patch updated 01 January 2004)

Compatibility patches for FreeBSD 5.2rc2 against 0.5.2rc2.

https://sourceforge.net/tracker/inde...mp;atid=430534

Everything works fine. CRC patch is NOT included. To fix CRC compilation problems with gcc 3.3.x the solution I use is to comment out the offending ASM code in common/crc32.cpp in a manner such as:

/*
#elif defined(i386)
...
*/
#else
for(uint32 i=0; i < bufsize; i++)
Calc(buf[i], crc32);
return crc32;
}
#endif



To use:

gzip -d freebsd.diff.gz
unzip 0.5.2rc2 archive
cp zone/makefile.perl zone/makefile (there is no makefile in the 0.5.2rc2 archive by default)
patch -p1 < freebsd.diff

cd <module directory>
edit makefile - comment out some lines, uncomment some others
gmake

copy to a central place and run



README

Requires 5.2rc2 or later - any 5.x with gcc 3.2 or higher *should* work fine, but 5.2rc2 only has gcc 3.3 to test with.

Requires the port lang/perl5 to be installed (version 5.6.1ish).

Requires the port devel/linuxthreads to be installed.

Patch includes a fix from Daeken to allow common/crc32.cpp to compile with gcc 3.3 (which is the standard compiler with 5.2rc2).

Patch modifies the default makefiles for all modules and adds commented out compile lines for FreeBSD - they are labeled, so go in, uncomment the FreeBSD ones, comment out the defaults, don't comment the Perl ones unless you want to lose Perl compatibility.


Perl modules and shared memory *both* work. Make sure you've installed IO::Scalar, or you will get a strange fatal error running zone. Make sure that your LD_LIBRARY_PATH contains the directory your libEMuShareMem.so is in, or it will fail to load.


(Stop reading here)


Implementation notes:

The semun union is #ifndef'd out in all cases where it appears - FreeBSD already has an identical one in its system header files already.

Many of the changes are simply swapping header order, and all changes are controlled by a required -DFREEBSD, so they will not impact any other OS's compile. If the headers are swapped it shouldn't affect any other operating system, and the #ifdefs could be removed. The majority of changes are in the makefiles - note that liblstdc++ is used instead of libstdc++, note that -pthread is absent, and note that -pg is removed. All three of these are required in addition to including linuxthreads stuff for proper compiling.

A change was made to the end of EMuShareMem/MMF.cpp to get rid of an incorrect error message for FreeBSD users - shmdt(2) returns -1 on failure, and does not modify the value of the pointer sent to it. The existing code sends an error message if the pointer passed to shmdt(2) does not point to 0 after an attempt to free(2) or shmdt(2) it. This change will only manifest itself if FREEBSD is defined at compile time.


FreeBSD 4.x compatibility notes:

It is a nightmare to mix the gcc 2.95 libraries from the base system with gcc 3.2.x+ from ports. I was unable to get it working properly, although I did get some very strange things happening with a compiled binary - mostly freezes in mutex_lock functions, although I got some core dumps as well. I think that all libraries need to be compiled with the same major version of gcc, and you need to ensure that the include files packaged with the ports version of gcc are included before the system includes.
Reply With Quote
  #2  
Old 12-26-2003, 09:12 PM
var1ety
Sarnak
 
Join Date: Jan 2003
Posts: 59
Default crc32.cpp

If gcc 3.2.x complains about the changes to crc32.cpp you can edit them out of the diff, or overwrite common/crc32.cpp with common/crc32.cpp.orig.
Reply With Quote
  #3  
Old 01-01-2004, 06:21 AM
var1ety
Sarnak
 
Join Date: Jan 2003
Posts: 59
Default crc

Eh, the CRC code in the patch doesn't work. It compiles fine but it doesn't compute the CRC correctly when people connect. The CRC code in the patch attached is actually incomplete, but even the complete version fails.


Will follow up with another patch against the next release when CRC works with gcc 3.3.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:37 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3