From: Yusuke Endoh Date: 2010-05-28T02:46:06+09:00 Subject: [ruby-core:30472] [Bug #2826](Feedback) pthreads compilation failure on Solaris Issue #2826 has been updated by Yusuke Endoh. Status changed from Assigned to Feedback Priority changed from Normal to Low Hi, Fabian Sorry for late response. 2010/2/28 Fabian Groffen : > Original bug: > http://bugs.gentoo.org/show_bug.cgi?id=307159 I don't know gentoo's packaging system. USE=threads means ./configure --enable-pthread, right? Could you show all configure options? > Ruby's configure tries to find the right way to link against pthread libs by itself. ?This fails amongst others on Solaris. ? Works for me with i386-pc-solaris2.11 on VirtualBox. compiling bigdecimal gmake[1]: Entering directory `/export/home/mame/work/ruby18/ext/bigdecimal' gcc -I. -I../.. -I../../. -I../.././ext/bigdecimal -DBASE=10000UL -DBASE_FIG=4 -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c bigdecimal.c gcc -shared -o ../../.ext/i386-solaris2.11/bigdecimal.so bigdecimal.o -L. -L../.. -L. -lpthread -lrt -ldl -lcrypt -lm -lc gmake[1]: Leaving directory `/export/home/mame/work/ruby18/ext/bigdecimal' > GCC itself knows fairly well how to link against pthreads libs using -pthread. *snip* > When -lpthread is replaced by -pthread (hence letting GCC inject the right linker arguments -- and in the correct order) this compiles fine. I created a patch to configure.in for this, but it is quite hacky, and only serves as an indication. Unfortunately, gcc3 seems not to understand -pthread: compiling bigdecimal gmake[1]: Entering directory `/export/home/mame/work/ruby18/ext/bigdecimal' gcc -I. -I../.. -I../../. -I../.././ext/bigdecimal -DBASE=10000UL -DBASE_FIG=4 -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -c bigdecimal.c gcc -shared -o ../../.ext/i386-solaris2.11/bigdecimal.so bigdecimal.o -L. -L../.. -L. -pthread -lrt -ldl -lcrypt -lm -lc gcc: unrecognized option `-pthread' gmake[1]: Leaving directory `/export/home/mame/work/ruby18/ext/bigdecimal' $ gcc -v Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/specs Configured with: /builds2/sfwnv-111a/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++,f77,objc --enable-shared Thread model: posix gcc version 3.4.3 (csl-sol210-3_4-20050802) By searching with the error message, this seems to be solaris10's problem or binutils/ld's, not ruby's. http://sourceware.org/bugzilla/show_bug.cgi?id=6431 So I change priority to Low. If you get something indicating ruby's bug and/or a better patch, please inform us. Thanks! -- Yusuke Endoh ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2826 ---------------------------------------- http://redmine.ruby-lang.org