patchmldonkey, a multi-networks file-sharing client - Patches: patch #4358, Add thread support for MinGW

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4358: Add thread support for MinGW

Submitter:  z <zet>
Submitted:  Fri 26 Aug 2005 08:51:26 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Assigned to:  None
Open/Closed:  Closed

Jump to the original submission

Thu 01 Dec 2005 04:09:55 PM UTC, comment #6: 

Hello Zed

I adapted your patch for mulus. I can compile it but Mulus crash at the start. Perhaps you cat take a look at it. The patch is for the current SVN version.

kenny711 <kenny711>
Sun 28 Aug 2005 10:59:00 AM UTC, comment #5: 

Applied 2005/08/28, updated Wiki page with build instructions

spiralvoice <spiralvoice>
Group administrator
Sat 27 Aug 2005 01:50:25 PM UTC, comment #4: 

The configure patch works for me, thanks.

z <zet>
Group Member
Sat 27 Aug 2005 11:52:21 AM UTC, comment #3: 

"make mld_hash" also works with this patch

spiralvoice <spiralvoice>
Group administrator
Sat 27 Aug 2005 11:20:32 AM UTC, comment #2: 

Please try the attached patch for configure/Makefile stuff.
Now a normal "./configure" should work on MinGW/MSYS.
Note that renaming libpthreadGC2.a is not necessary anymore, so
rename the file in /mingw/lib if you already installed it there.

Otherwise step 5 should read:

cp libpthreadGC2.a /mingw/lib

spiralvoice <spiralvoice>
Group administrator
Fri 26 Aug 2005 09:19:59 PM UTC, comment #1: 

Step 6:

Actually, I copied *.h into /mingw/include

z <zet>
Group Member
Fri 26 Aug 2005 08:51:26 PM UTC, original submission:  


This patch fixes two bugs in thread code
which prevented pthreads from running on mingw.

It also adds pthread static library support for mingw
(start/exit external calls to initialize the library)

Mldonkey currently uses 2 threads: a hasher thread
and a namelookup thread.

Installation in MSYS:


0. cd /usr/src

1. Download pthreads-win32 from http://sourceware.org/pthreads-win32/
wget ftp://sources.redhat.com/pub/pthreads-win32/pthreads-w32-2-7-0-release.tar.gz

2. tar -zxvf pthreads-w32-2-7-0-release.tar.gz
3. cd pthreads-w32-2-7-0-release
4. make clean GC-static

5. cp libpthreadGC2.a /mingw/lib/libpthread.a
6. cp pthread.h /mingw/include/pthread.h

Now build MLDONKEY

7. cd ~/mldonkey
8. CFLAGS="-O2 -DPTW32_STATIC_LIB" LIBS=-lwsock32 ./configure
9. make mlnet.static
10. mv mlnet.static mlnet.exe


---

Notes:

MinGW doesn't seem to support signal disabling like
pthread_sigmask/sigfillset so they are defined out.

The aclocal macro ACX_PTHREAD is hardcoded to look
for certain thread libraries. pthreadGC2 is not one
of them, so it was renamed to libpthread as above.
This library has calls to 2 functions in wsock32, so
the "-lwsock32" is required.  (step #8 above)

This pthread library can be compiled dynamically,
but a define of PTW32_STATIC_LIB was added to os_stubs.h
for the moment if using mingw since everything else seems
to be statically compiled with mingw.  WSOCK32 was already
a dependency.

(use "objdump -p mlnet.exe | grep DLL" to see dependencies)

"make ed2k_hash" won't work without adding -lwsock32 to
config/Makefile.config: PTHREAD_LIBS=-lpthread -lwsock32


Someone better at Makefile magic can hopefully handle all
this to make it a cleaner config/install process.

Tested for 5 minutes on XP...

z <zet>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #4319:  pthread_for_mulus.patch added by kenny711 (6KiB - application/octet-stream)
file #9298:  pthread_configure.patch added by spiralvoice (1KiB - text/x-patch)
file #9294:  pthreads.diff added by zet (6KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-12-01 kenny711 Attached File- Added pthread_for_mulus.patch, #5538
2005-08-28 spiralvoice StatusNone Done
    Open/ClosedOpen Closed
2005-08-27 spiralvoice Attached File- Added pthread_configure.patch, #5089
2005-08-26 zet Attached File- Added pthreads.diff, #5085

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code