lang/gcc32 and pthreads problem
Oleg Sharoiko
os at rsu.ru
Sun Jan 2 15:58:27 GMT 2005
Hello, David!
It looks like your commit
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=305919+0+archive/2004/cvs-all/20041226.cvs-all
has broke -pthreads switch in gcc32. Number of people complained about
editors/openoffice-1.1 not being able to install. It happens because binaries
link against both libc_r and libpthread. And this happens because gcc32 links
to c_r instead of pthread:
wolf, ~/src/test > uname -a
FreeBSD wolf.os.rsu.ru 5.3-STABLE FreeBSD 5.3-STABLE #0: Sat Jan 1 21:36:31
MSK 2005
os at wolf.os.rsu.ru:/usr/obj/usr/src/sys/wolf.os.i686.RELENG_5.2005-01-01 i386
With system compiler:
wolf, ~/src/test > gcc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.2 [FreeBSD] 20040728
wolf, ~/src/test > gcc -Wall -pedantic -pthread test_pth.c -o test_pth
wolf, ~/src/test > ldd test_pth
test_pth:
libpthread.so.1 => /usr/lib/libpthread.so.1 (0x28081000)
libc.so.5 => /lib/libc.so.5 (0x280a7000)
With gcc32 from ports
wolf, ~/src/test > gcc32 -v
Reading specs from /usr/local/lib/gcc-lib/i386-portbld-freebsd5.3/3.2.3/specs
Configured with: ./..//gcc-3.2.3/configure --disable-nls
--with-gxx-include-dir=/usr/local/lib/gcc-lib/i386-portbld-freebsd5.3/3.2.3/include/g++-v3
--with-system-zlib
--includedir=/usr/local/lib/gcc-lib/i386-portbld-freebsd5.3/3.2.3/include/Java
--disable-shared --prefix=/usr/local i386-portbld-freebsd5.3
Thread model: posix
gcc version 3.2.3
wolf, ~/src/test > gcc32 -Wall -pedantic -pthread test_pth.c -o test_pth
wolf, ~/src/test > ldd test_pth
test_pth:
libc_r.so.5 => /usr/lib/libc_r.so.5 (0x28081000)
libc.so.5 => /lib/libc.so.5 (0x280a5000)
I suppose __FreeBSD_version is not available in gcc/config/freebsd-spec.h and
your patch doesn't work. At least in comments above #define FBSD_LIB_SPEC they
say osreldate.h can not be used as it breaks cross-compiling. Though this is
just an assumption and I may be mistaken. I do not propose any patches because
I'm not sure if I correctly identified the source of the problem and I don't
know in which way exactly should it be fixed. Anyway I think you can do it
better and it won't take too much of your time.
p.s. Happy New Year and thank you for the great work you are doing for
FreeBSD.
--
Oleg Sharoiko.
Software and Network Engineer
Computer Center of Rostov State University.
More information about the freebsd-openoffice
mailing list