https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112010-03-01T10:40:04ZRuby Issue Tracking SystemBackport187 - Backport #2826: pthreads compilation failure on Solarishttps://bugs.ruby-lang.org/issues/2826?journal_id=84902010-03-01T10:40:04Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>nobu (Nobuyoshi Nakada)</i></li></ul><p>=begin<br>
This also effects Ruby 1.9.<br>
=end</p> Backport187 - Backport #2826: pthreads compilation failure on Solarishttps://bugs.ruby-lang.org/issues/2826?journal_id=113042010-05-28T02:46:05Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Feedback</i></li><li><strong>Priority</strong> changed from <i>Normal</i> to <i>3</i></li></ul><p>=begin<br>
Hi, Fabian</p>
<p>Sorry for late response.</p>
<p>2010/2/28 Fabian Groffen <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a>:</p>
<blockquote>
<p>Original bug:<br>
<a href="http://bugs.gentoo.org/show_bug.cgi?id=307159" class="external">http://bugs.gentoo.org/show_bug.cgi?id=307159</a></p>
</blockquote>
<p>I don't know gentoo's packaging system.<br>
USE=threads means ./configure --enable-pthread, right?<br>
Could you show all configure options?</p>
<blockquote>
<p>Ruby's configure tries to find the right way to link against pthread libs by itself. ?This fails amongst others on Solaris. ?</p>
</blockquote>
<p>Works for me with i386-pc-solaris2.11 on VirtualBox.</p>
<p>compiling bigdecimal<br>
gmake[1]: Entering directory <code>/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 </code>/export/home/mame/work/ruby18/ext/bigdecimal'</p>
<blockquote>
<p>GCC itself knows fairly well how to link against pthreads libs using -pthread.<br>
<em>snip</em><br>
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.</p>
</blockquote>
<p>Unfortunately, gcc3 seems not to understand -pthread:</p>
<p>compiling bigdecimal<br>
gmake[1]: Entering directory <code>/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 </code>-pthread'<br>
gmake[1]: Leaving directory `/export/home/mame/work/ruby18/ext/bigdecimal'</p>
<p>$ gcc -v<br>
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/specs<br>
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<br>
Thread model: posix<br>
gcc version 3.4.3 (csl-sol210-3_4-20050802)</p>
<p>By searching with the error message, this seems to be solaris10's<br>
problem or binutils/ld's, not ruby's.</p>
<p><a href="http://sourceware.org/bugzilla/show_bug.cgi?id=6431" class="external">http://sourceware.org/bugzilla/show_bug.cgi?id=6431</a></p>
<p>So I change priority to Low.<br>
If you get something indicating ruby's bug and/or a better patch,<br>
please inform us. Thanks!</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a><br>
=end</p> Backport187 - Backport #2826: pthreads compilation failure on Solarishttps://bugs.ruby-lang.org/issues/2826?journal_id=795082019-07-15T16:01:19Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Backport</i></li><li><strong>Project</strong> changed from <i>Ruby 1.8</i> to <i>Backport187</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/79508/diff?detail_id=52988">diff</a>)</li><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li><li><strong>ruby -v</strong> deleted (<del><i>ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-solaris2.10]</i></del>)</li></ul>