From owner-cvs-all@FreeBSD.ORG Mon Oct 12 13:15:50 2009 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC77B106568D; Mon, 12 Oct 2009 13:15:50 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DBA7E8FC13; Mon, 12 Oct 2009 13:15:50 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n9CDFoGb023693; Mon, 12 Oct 2009 13:15:50 GMT (envelope-from stas@repoman.freebsd.org) Received: (from stas@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n9CDFobB023692; Mon, 12 Oct 2009 13:15:50 GMT (envelope-from stas) Message-Id: <200910121315.n9CDFobB023692@repoman.freebsd.org> From: Stanislav Sedov Date: Mon, 12 Oct 2009 13:15:50 +0000 (UTC) To: ports-committers@FreeBSD.org, cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: ports/Mk bsd.ruby.mk ports/lang/ruby18 Makefile ports/lang/ruby18/files patch-gc.c patch-main.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Oct 2009 13:15:51 -0000 stas 2009-10-12 13:15:50 UTC FreeBSD ports repository Modified files: Mk bsd.ruby.mk lang/ruby18 Makefile lang/ruby18/files patch-gc.c Added files: lang/ruby18/files patch-main.c Log: - Don't build ruby with threads support on FreeBSD versions before 7.2 - On FreeBSD >= 7.2 allocate the new thread with adequate amount of stack space to run the main ruby code in. This allows to mitigate problem when too low stack space available for ruby when running with pthreads enabled. - Bump portrevision. The long version. Before this change we used to link ruby against pthreads uncoditionally on all versions of FreeBSD. This is indispensable in order to load the threaded shared objects withing ruby. However, this causes a dramatic decrease in the stack space available as pthreads only allows up to several megabytes of stack space for the main application threads. The only solution to this is to create the new thread immediately after the program start with rigth stack size attributes set. Nonetheless this scheme won't work for us on FreeBSD version before 7.2 as malloc implementation in these versions was not threaded fork safe (i.e. this is impossible to fork from the threaded program and expect malloc/free functions to work). Thus the only solution for now can be to disable pthreads entirely on FreeBSD <= 7.2. This won't cause any performance/usability problems for users as Ruby 1.8 uses green threads, however it may prevent <= 7.2 users to load shared libraries linked agains pthreads. Reported by: "François Montel" Tested by: Sean Mullen Revision Changes Path 1.187 +2 -2 ports/Mk/bsd.ruby.mk 1.145 +7 -0 ports/lang/ruby18/Makefile 1.5 +57 -18 ports/lang/ruby18/files/patch-gc.c 1.1 +86 -0 ports/lang/ruby18/files/patch-main.c (new)