# Re: Problem with Ruby 1.8.6-p110 on DragonFly (was \[PATCH\] Problem with ruby 1.8.6-p36 (and p39) on

**URL:** <https://www.ruby-forum.com/t/re-problem-with-ruby-1-8-6-p110-on-dragonfly-was-patch-problem-with-ruby-1-8-6-p36-and-p39-on/116131>\
**Category:** Development\
**Created:** [October 2, 2007, 6:16pm UTC](https://www.ruby-forum.com/t/re-problem-with-ruby-1-8-6-p110-on-dragonfly-was-patch-problem-with-ruby-1-8-6-p36-and-p39-on/116131 "2007-10-02T18:16:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Takahiro\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/76d3ee/32.png) [@Takahiro\_K](https://www.ruby-forum.com/u/Takahiro_K)\
**Post date:** [October 2, 2007, 6:16pm UTC](https://www.ruby-forum.com/t/re-problem-with-ruby-1-8-6-p110-on-dragonfly-was-patch-problem-with-ruby-1-8-6-p36-and-p39-on/116131/1 "2007-10-02T18:16:03Z")

</div>

e$B$3$s$P$s$O!#e(B

DragonFly BSDe$B\>e$Ge(BRuby 1.8.6  
p110e$B$r!"$=$N$^$^:n@.$7$h$&$H$9$k$H!"e(B

% sh configure --enable-pthread --enable-shared  
…  
% make  
ar rcu libruby-static.a array.o bignum.o class.o compar.o dir.o  
dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o  
marshal.o math.o numeric.o object.o pack.o parse.o process.o  
prec.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o  
st.o string.o struct.o time.o util.o variable.o version.o isnan.o  
isinf.o dmyext.o  
gcc -g -O2 -fPIC -DRUBY\_EXPORT -I. -I. -c main.c  
gcc -g -O2 -fPIC -DRUBY\_EXPORT -L. -rdynamic main.o  
libruby-static.a -lcrypt -lm -o miniruby  
libruby-static.a(eval.o)(.text+0x15002): In function  
`rb_thread_start_0': /var/tmp/ruby-1.8.6-p110/eval.c:11945: undefined reference to `pthread\_create’  
libruby-static.a(eval.o)(.text+0x1501e):/var/tmp/ruby-1.8.6-p110/eval.c:11947:  
undefined reference to `pthread\_atfork’  
\*\*\* Error code 1

Stop in /var/tmp/ruby-1.8.6-p110.

e$B$H!"$J$j$^$9!#e(Bpthreade$B$J%i%$%V%i%j$Oe(Blibc\_r.{a,so}e$B$K4^$^$l$F$$$k$h$&$G$9!#e(B

e$B0lJ}!“e(Bpkgsrce$B$JOHAH$\_$NCf$G$O!”\>e5-$NLdBj$OLLE]8+$F$/$l$F$$$k$N$G$9$,!"e(B  
e$B:#EY$Oe(Bminirubye$B$N%j%s%/;~$K!"e(Bpthread\_atfork()e$B$,L$Dj5A$H$J$j$^$9!#e(B

pthread\_atfork()e$B$Oe(B /usr/lib/libthread\_xu.so  
e$B$H$$$C$?$“$?$j$K$”$k$h$&$G!"e(B  
e$B:G=_E_$K$Oe(Blibc\_r.soe$B$rCV$-49$($k$h$&$J0LCVIU$1$N%i%$%V%i%j$N$h$&$G$9!#e(B  
(e$B$7$+$7!"e(B1.10.1e$B$H$$$C$?:G?7$N%j%j!\<%90J30$G$O!"40A4$G$O$J$$$h$&$G$9!#e(B)

pkgsrce$B$Oe(B 2007Q3 e$B$N%V%i%s%A$,6a$$$?$a!"e(B

$NetBSD: patch-ad,v 1.7 2007/10/02 15:59:23 taca Exp $

— eval.c.orig 2007-09-23 09:01:50.000000000 +0900  
+++ eval.c  
@@ -11944,7 +11944,9 @@ rb\_thread\_start\_0(fn, arg, th)  
#ifdef \_THREAD\_SAFE  
pthread\_create(&time\_thread, 0, thread\_timer, 0);  
time\_thread\_alive\_p = 1;  
+#ifndef **DragonFly**  
pthread\_atfork(0, 0, rb\_child\_atfork);  
+#endif  
#else  
rb\_thread\_start\_timer();  
#endif

e$B$H!"$$$C$?%Q%C%A$G$\*Cc$rBy$7$F$$$^$9!#e(B

[ruby-dev:31253]  
In message [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
on Wed, 18 Jul 2007 21:49:39 +0900,  
“Vincent I.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> e$B$3$N%a!\<%k$K\>.$5$$!Je(Bpthread\_atforke$B$r;H$C$F$k!K%Q%C%A$rE:IU$7$?$s$G$9!#e(B  
> e$B$G$b$3$N%Q%C%A$OK\Ev$K@5$7$$D\>$7J}$G$“$k$+$I$&$+!D$o$+$i$J$$$G$9!#e(B  
> e$B$\*$=$i$/e(Bpthread\_atfork()e$B$,MQ0U$5$l$F$$$J$$4D6-$b$”$k$H$$$&$3$H$G!#e(B

–  
e$B?@8Me(B e$BN4Gne(B / Takahiro K.

P.S.  
e$B;d\<+?H$Oe(Bpkgsrce$B$NLLE]$r8+$F$kN)\>l$G=q$$$F$$$^$9$,!“e(BDragonFly  
BSDe$B$r\>oF|:“e(B  
e$B;HMQ$7$F$$$k$o$1$G$O$”$j$^$;$s$,!”$I$J$?$+F0:n3NG’$J$I$O$5$l$F$$$k$N$Ge(B  
e$B$7$g$&$+e(B? (make  
test-alle$B$H$+$9$k$H!"e(B3e$B$D$/$i$$0z$C3]$+$k$h$&$G$9!#e(B)

---

<div class="post-metadata">

**Author:** ![Takahiro\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/76d3ee/32.png) [@Takahiro\_K](https://www.ruby-forum.com/u/Takahiro_K)\
**Post date:** [October 8, 2007, 4:14pm UTC](https://www.ruby-forum.com/t/re-problem-with-ruby-1-8-6-p110-on-dragonfly-was-patch-problem-with-ruby-1-8-6-p36-and-p39-on/116131/2 "2007-10-08T16:14:09Z")

</div>

In message [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
on Wed, 3 Oct 2007 01:14:32 +0900,  
Takahiro K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> DragonFly BSDe$B\>e$Ge(BRuby 1.8.6 p110e$B$r!"$=$N$^$^:n@.$7$h$&$H$9$k$H!"e(B

e$B2?$b1~Ez$,$J$$$H$$$&$3$H$O!"e(B

o DragonFly  
BSDe$B$G$OI8=`$N%Q%C%1!<%8!&%7%9%F%`$G$"$ke(Bpkgsrce$B$Ge(BRubye$B$r;H$C$F$k!#e(B  
o DragonFly  
BSDe$B$G%Q%C%1!\<%8!&%7%9%F%`$J$7$Ge(BRubye$B$r;H$C$F$k?M$O$$$J$$!#e(B

e$B$H!"$$$&$3$H$J$s$G$7$g$&$+e(B…?

---

<div class="post-metadata">

**Author:** ![Takahiro\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/76d3ee/32.png) [@Takahiro\_K](https://www.ruby-forum.com/u/Takahiro_K)\
**Post date:** [October 8, 2007, 11:13pm UTC](https://www.ruby-forum.com/t/re-problem-with-ruby-1-8-6-p110-on-dragonfly-was-patch-problem-with-ruby-1-8-6-p36-and-p39-on/116131/3 "2007-10-08T23:13:02Z")

</div>

e$B$J$+$@$G$9!#e(B

At Wed, 3 Oct 2007 01:14:32 +0900,  
Takahiro K. wrote in [ruby-dev:31927]:

> gcc -g -O2 -fPIC -DRUBY\_EXPORT -L. -rdynamic main.o libruby-static.a -lcrypt -lm -o miniruby  
> libruby-static.a(eval.o)(.text+0x15002): In function `rb_thread_start_0': /var/tmp/ruby-1.8.6-p110/eval.c:11945: undefined reference to`pthread\_create’  
> libruby-static.a(eval.o)(.text+0x1501e):/var/tmp/ruby-1.8.6-p110/eval.c:11947: undefined reference to `pthread\_atfork’  
> \*\*\* Error code 1
> 
> Stop in /var/tmp/ruby-1.8.6-p110.
> 
> e$B$H!"$J$j$^$9!#e(Bpthreade$B$J%i%$%V%i%j$Oe(Blibc\_r.{a,so}e$B$K4^$^$l$F$$$k$h$&$G$9!#e(B

pthreade$B%i%$%V%i%j$Oe(B pthread pthreads c c\_r  
e$B$N=g$KC5$7$F$$$k$N$G!“e(B  
e$B8+IU$+$k$O$:$@$H;W$&$N$G$9$,!”$R$g$C$H$7$F!"e(BDragonFly  
BSDe$B$G$Oe(B  
-pthreade$B$rIU$1$F$be(Blibc\_re$B$O%j%s%/$5$l$J$$$N$G$7$g$&$+!#e(B

> e$B0lJ}!“e(Bpkgsrce$B$JOHAH$\_$NCf$G$O!”\>e5-$NLdBj$OLLE]8+$F$/$l$F$$$k$N$G$9$,!"e(B  
> e$B:#EY$Oe(Bminirubye$B$N%j%s%/;~$K!"e(Bpthread\_atfork()e$B$,L$Dj5A$H$J$j$^$9!#e(B
> 
> pthread\_atfork()e$B$Oe(B /usr/lib/libthread\_xu.so e$B$H$$$C$?$"$?$j$K$"$k$h$&$G!"e(B  
> e$B:G=_E_$K$Oe(Blibc\_r.soe$B$rCV$-49$($k$h$&$J0LCVIU$1$N%i%$%V%i%j$N$h$&$G$9!#e(B  
> (e$B$7$+$7!"e(B1.10.1e$B$H$$$C$?:G?7$N%j%j!\<%90J30$G$O!"40A4$G$O$J$$$h$&$G$9!#e(B)

e$BM%@h=g0L$H$7$F$Oe(Blibce$B$h$j$b@h$G$9$+e(B?

> +#ifndef **DragonFly**  
> pthread\_atfork(0, 0, rb\_child\_atfork);  
> +#endif

HAVE\_PTHREAD\_ATFORKe$B$r;H$&$[$&$,$$$$$G$7$g$&$M!#e(B

# Index: configure.in

— configure.in (revision 13643)  
+++ configure.in (working copy)  
@@ -861,5 +861,5 @@ AC\_DEFINE\_UNQUOTED(STACK\_GROW\_DIRECTION,

if test x"$enable\_pthread" = xyes; then

- for pthread\_lib in pthread pthreads c c\_r; do

- for pthread\_lib in pthread pthreads thread\_xu c c\_r; do  
AC\_CHECK\_LIB($pthread\_lib, pthread\_kill,  
rb\_with\_pthread=yes, rb\_with\_pthread=no)  
@@ -883,5 +883,5 @@ if test x"$enable\_pthread" = xyes; then  
AC\_MSG\_WARN(“Don’t know how to find pthread library on your system –  
thread support disabled”)  
fi

- AC\_CHECK\_FUNCS(nanosleep)

- AC\_CHECK\_FUNCS(nanosleep pthread\_atfork)  
if test x"$ac\_cv\_func\_nanosleep" = xno; then  
AC\_CHECK\_LIB(rt, nanosleep)

---

<div class="post-metadata">

**Author:** ![Takahiro\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/76d3ee/32.png) [@Takahiro\_K](https://www.ruby-forum.com/u/Takahiro_K)\
**Post date:** [October 9, 2007, 5:36am UTC](https://www.ruby-forum.com/t/re-problem-with-ruby-1-8-6-p110-on-dragonfly-was-patch-problem-with-ruby-1-8-6-p36-and-p39-on/116131/4 "2007-10-09T05:36:21Z")

</div>

In message [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
on Tue, 9 Oct 2007 06:12:24 +0900,  
Nobuyoshi N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > e$B$H!"$J$j$^$9!#e(Bpthreade$B$J%i%$%V%i%j$Oe(Blibc\_r.{a,so}e$B$K4^$^$l$F$$$k$h$&$G$9!#e(B
> 
> pthreade$B%i%$%V%i%j$Oe(B pthread pthreads c c\_r e$B$N=g$KC5$7$F$$$k$N$G!“e(B  
> e$B8+IU$+$k$O$:$@$H;W$&$N$G$9$,!”$R$g$C$H$7$F!“e(BDragonFly BSDe$B$G$Oe(B  
> -pthreade$B$rIU$1$F$be(Blibc\_re$B$O%j%s%/$5$l$J$$$N$G$7$g$&$+!#e(B  
> e$B:#!”\<B5!$K%"%/%;%9$G$-$J$$$N$G$9$,!"N.@P$Ke(B -pthread  
> e$BIU$1$?$H$-$Oe(B  
> libc\_re$B$r%j%s%/$7$F$$$?$H5-21$7$F$$$^$9!#e(B

> e$BM%@h=g0L$H$7$F$Oe(Blibce$B$h$j$b@h$G$9$+e(B?  
> e$B$I$&$b!"$3$NJU$j$O$h$/$o$+$i$J$$$N$G$9$,!"e(BDragonFly  
> 1.10.1e$B$N%j%j!\<%9!&e(B  
> e$B%N!\<%H$K$O!"e(B

DragonFly’s Light Weight Process abstraction is now finished and  
working via libthread\_xu but the default threading library is not  
quite ready to be changed from libc\_r yet. All threaded programs now  
link against an actual ‘libpthread’ which is a softlink to libc\_r or  
libthread\_xu, allowing the new threading library to be tested more  
fully.

e$B$H!“$$$C$?5-=R$,$”$j$^$9!#e(Blibc\_re$B$He(Blibthread\_xue$B$OJBNs!&GSB\>Aj8\_E\*$Je(B  
e$BB8:\_$N$h$&$G$9$,!"e(B1.10.1e$B$h$j$b8E$$%j%j!\<%9$G$Oe(Blibthread\_xue$B$OI]$/$F;H$(e(B  
e$B$J$$$H$$$&2DG=@-$b9b$$$H8@$($^$9!#e(B

> > +#ifndef **DragonFly**  
> > pthread\_atfork(0, 0, rb\_child\_atfork);  
> > +#endif
> 
> HAVE\_PTHREAD\_ATFORKe$B$r;H$&$[$&$,$$$$$G$7$g$&$M!#e(B  
> e$B$b$A$m$s!“$=$&$G$9!#$”$/$^$G;CDjE\*$J=$@5$G$7$?$N$G!#e(B:-)
