After last night's update
P configure P configure.ac P dlls/msvcrt/msvcrt.spec P dlls/msvcrt/process.c P dlls/msvcrtd/msvcrtd.spec P dlls/ntdll/rtlstr.c P dlls/winmm/winealsa/audio.c P dlls/x11drv/keyboard.c P files/dos_fs.c P files/profile.c P include/config.h.in P include/file.h P libs/wine/Makefile.in cvs server: libs/wine/errno.c is no longer in the repository P misc/registry.c P programs/wineconsole/Makefile.in P programs/wineconsole/curses.c P tools/Makefile.in P tools/winegcc.c P tools/winewrap.c
Wine fails to build on FreeBSD 4.8 with the following failure mode:
/usr/bin/gcc -c -I. -I. -I../../include -I../../include -I/usr/X11R6/include -D_REENTRANT -fPIC -D__WINESRC__ -Wall -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith -g -O2 -o glu32.spec.o glu32.spec.c /usr/bin/gcc -shared -Wl,-Bsymbolic,-z,defs glu32.spec.o glu.o glu32.dll.dbg.o -o glu32.dll.so -L../../dlls -L../../libs/wine -lwine -L/usr/X11R6/lib -lSM -lICE -lXxf86dga -lXxf86vm -lXv -lXext -lX11 -lGL -lGLU -lpthread -L../../libs/port -lwine_port -lm -lc /usr/libexec/elf/ld: cannot find -lpthread gmake[2]: *** [glu32.dll.so] Error 1 gmake[2]: Leaving directory `/.amd_mnt/nashira/files5/test/wine/dlls/glu32' gmake[1]: *** [glu32] Error 2
Gerald
Gerald Pfeifer gerald@pfeifer.com writes:
Wine fails to build on FreeBSD 4.8 with the following failure mode:
/usr/bin/gcc -c -I. -I. -I../../include -I../../include -I/usr/X11R6/include -D_REENTRANT -fPIC -D__WINESRC__ -Wall -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith -g -O2 -o glu32.spec.o glu32.spec.c /usr/bin/gcc -shared -Wl,-Bsymbolic,-z,defs glu32.spec.o glu.o glu32.dll.dbg.o -o glu32.dll.so -L../../dlls -L../../libs/wine -lwine -L/usr/X11R6/lib -lSM -lICE -lXxf86dga -lXxf86vm -lXv -lXext -lX11 -lGL -lGLU -lpthread -L../../libs/port -lwine_port -lm -lc /usr/libexec/elf/ld: cannot find -lpthread
So what's the right way to link with libpthread on FreeBSD?
[ I'm Cc:ing Julian Elischer, who is one of the FreeBSD experts on threading. Julian, at http://www.winehq.org/hypermail/wine-devel/2003/08/0401.html you'll find the original three messages on this. ]
On Wed, 20 Aug 2003, Alexandre Julliard wrote:
Wine fails to build on FreeBSD 4.8 with the following failure mode:
/usr/bin/gcc -c -I. -I. -I../../include -I../../include -I/usr/X11R6/include -D_REENTRANT -fPIC -D__WINESRC__ -Wall -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith -g -O2 -o glu32.spec.o glu32.spec.c /usr/bin/gcc -shared -Wl,-Bsymbolic,-z,defs glu32.spec.o glu.o glu32.dll.dbg.o -o glu32.dll.so -L../../dlls -L../../libs/wine -lwine -L/usr/X11R6/lib -lSM -lICE -lXxf86dga -lXxf86vm -lXv -lXext -lX11 -lGL -lGLU -lpthread -L../../libs/port -lwine_port -lm -lc /usr/libexec/elf/ld: cannot find -lpthread
So what's the right way to link with libpthread on FreeBSD?
Wine builds fine if I just omit the -lpthread line above.
man pthread, however, notes the following (both FreeBSD 4.8 and 5.1):
The current FreeBSD POSIX thread implementation is built in the library libc_r which contains both thread-safe libc functions and the thread functions. This library replaces libc for threaded applications.
A FreeBSD specific option has been added to gcc to make linking threaded processes simple. gcc -pthread links a threaded process against libc_r instead of libc.
So perhaps we ought to use -lc_r instead of -lc and omit -lpthread on FreeBSD (or use -pthread)?
Gerald
Update: with Alexandre's followup patch, Wine now builds on FreeBSD with GCC 3.2.x (though with the system compiler we have some problems, but let's postpone those).
On Thu, 21 Aug 2003, Gerald Pfeifer wrote:
So perhaps we ought to use -lc_r instead of -lc and omit -lpthread on FreeBSD (or use -pthread)?
I tried that, and everything builds fine, but when I start Wine, I immediately get the following:
FIXME:pthread_cond_init Segmentation fault (core dumped)
with this backtrace:
#0 0x5c258aac in .cerror () from /usr/lib/libc.so.4 #1 0x5c305ca6 in flock () from /usr/lib/libc_r.so.4 #2 0x5c238919 in _yp_dobind () from /usr/lib/libc.so.4 #3 0x5c238fa8 in yp_match () from /usr/lib/libc.so.4 #4 0x5c21cc12 in endpwent () from /usr/lib/libc.so.4 #5 0x5c21c3b8 in getpwuid () from /usr/lib/libc.so.4 #6 0x5c0d76a5 in init_paths () at config.c:112 #7 0x5c0d7a22 in wine_get_server_dir () at config.c:191 #8 0x5c0848f2 in CLIENT_InitServer () at ../../scheduler/client.c:640 #9 0x5c085834 in process_init (argv=0xbfbff670) at ../../scheduler/process.c:309 #10 0x5c085d61 in __wine_process_init (argc=1, argv=0xbfbff670) at ../../scheduler/process.c:486 #11 0x5c0d9176 in wine_init (argc=1, argv=0xbfbff670, error=0xbfbff220 "", error_size=1024) at loader.c:427 #12 0x3c000621 in main (argc=1, argv=0xbfbff670) at main.c:33 #13 0x3c000566 in _start ()
I'm afraid I'm lost.
Gerald
[ Sorry, I just realized this was in my postponed! Alexandre, this should have gone out yesterday, sorry. ]
On Wed, 20 Aug 2003, Gerald Pfeifer wrote:
Wine fails to build on FreeBSD 4.8 with the following failure mode:
/usr/bin/gcc -c -I. -I. -I../../include -I../../include -I/usr/X11R6/include -D_REENTRANT -fPIC -D__WINESRC__ -Wall -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith -g -O2 -o glu32.spec.o glu32.spec.c /usr/bin/gcc -shared -Wl,-Bsymbolic,-z,defs glu32.spec.o glu.o glu32.dll.dbg.o -o glu32.dll.so -L../../dlls -L../../libs/wine -lwine -L/usr/X11R6/lib -lSM -lICE -lXxf86dga -lXxf86vm -lXv -lXext -lX11 -lGL -lGLU -lpthread -L../../libs/port -lwine_port -lm -lc /usr/libexec/elf/ld: cannot find -lpthread gmake[2]: *** [glu32.dll.so] Error 1 gmake[2]: Leaving directory `/.amd_mnt/nashira/files5/test/wine/dlls/glu32' gmake[1]: *** [glu32] Error 2
Update: If I simply remove -lpthread from dlls/glu32/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dx8/Makefile dlls/opengl32/Makefile Wine, builds without problems.
Gerald