On Thu, 10 Mar 2011, Jeremy Evans wrote:

> Because our lang/ruby/1.8 port does not link with pthread, but qt3
> does, attempting to load the qtruby extension in ruby will currently
> crash the ruby interpreter unless you run ruby with
> LD_PRELOAD=libpthread.  This makes the LD_PRELOAD hack unnecessary, by
> using -lpthread (not -pthread) when linking.
> 
> I believe this technique was discovered by bernd@, it's also used in the
> textproc/ruby-hyperestraier port.

It's not a technique, it's an horrible hack and despites my numerous 
attempts asking him to revert it, he never answered.

> Tested on amd64.  Looking for OKs.

Personnally I think this is something we should not do, it's wrong and 
shows the wrong example. But it may be just me.


> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/x11/kde/bindings3/Makefile,v
> retrieving revision 1.73
> diff -u -p -r1.73 Makefile
> --- Makefile  15 Jan 2011 01:09:43 -0000      1.73
> +++ Makefile  15 Feb 2011 23:39:29 -0000
> @@ -16,7 +16,7 @@ LIB_DEPENDS =       x11/kde/libs3 \
>               x11/qt3 \
>               ${MODRUBY_LIB_DEPENDS}
>  
> -REVISION =   13
> +REVISION =   14
>  #XXX missing -rpath to /usr/local ?
>  USE_LIBTOOL =        gnu
>  USE_GROFF =  Yes
> Index: patches/patch-qtruby_rubylib_qtruby_Makefile_in
> ===================================================================
> RCS file: 
> /cvs/ports/x11/kde/bindings3/patches/patch-qtruby_rubylib_qtruby_Makefile_in,v
> retrieving revision 1.3
> diff -u -p -r1.3 patch-qtruby_rubylib_qtruby_Makefile_in
> --- patches/patch-qtruby_rubylib_qtruby_Makefile_in   29 Aug 2008 11:27:44 
> -0000      1.3
> +++ patches/patch-qtruby_rubylib_qtruby_Makefile_in   11 Mar 2011 01:33:10 
> -0000
> @@ -1,6 +1,20 @@
>  $OpenBSD: patch-qtruby_rubylib_qtruby_Makefile_in,v 1.3 2008/08/29 11:27:44 
> espie Exp $
> ---- qtruby/rubylib/qtruby/Makefile.in.orig   Wed Aug 20 17:38:15 2008
> -+++ qtruby/rubylib/qtruby/Makefile.in        Thu Aug 28 10:56:33 2008
> +
> +Add -lpthread linking to remove need for LD_PRELOAD=libpthread,
> +since the lang/ruby/1.8 port is not linked to libpthread, but
> +qt3 is.
> +
> +--- qtruby/rubylib/qtruby/Makefile.in.orig   Wed Aug 20 08:38:15 2008
> ++++ qtruby/rubylib/qtruby/Makefile.in        Wed Feb 16 00:13:53 2011
> +@@ -260,7 +260,7 @@ LIB_KUNITTEST = @LIB_KUNITTEST@
> + LIB_KUTILS = @LIB_KUTILS@
> + LIB_POLL = @LIB_POLL@
> + LIB_QPE = @LIB_QPE@
> +-LIB_QT = @LIB_QT@
> ++LIB_QT = @LIB_QT@ -lpthread
> + LIB_SMB = @LIB_SMB@
> + LIB_X11 = @LIB_X11@
> + LIB_XEXT = @LIB_XEXT@
>  @@ -428,7 +428,7 @@ libqtrubyinternal_la_SOURCES = Qt.cpp handlers.cpp 
>   rubylibdir = $(RUBY_SITEARCHDIR)
>   rubylib_LTLIBRARIES = qtruby.la
> 
> 

-- 
Antoine

Reply via email to