From owner-freebsd-threads@FreeBSD.ORG Fri Dec 31 20:19:57 2010 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FD9F1065730 for ; Fri, 31 Dec 2010 20:19:57 +0000 (UTC) (envelope-from freebsdml@marino.st) Received: from shepard.synsport.net (mail.synsport.com [208.69.230.148]) by mx1.freebsd.org (Postfix) with ESMTP id 051C78FC18 for ; Fri, 31 Dec 2010 20:19:56 +0000 (UTC) Received: from [192.168.1.33] (78.red-79-158-163.staticip.rima-tde.net [79.158.163.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by shepard.synsport.net (Postfix) with ESMTP id 34CEC438BE; Fri, 31 Dec 2010 14:19:54 -0600 (CST) Message-ID: <4D1E3AE8.8090907@marino.st> Date: Fri, 31 Dec 2010 21:19:52 +0100 From: John Marino User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Kostik Belousov References: <4D1DC299.2090808@marino.st> <20101231122225.GK90883@deviant.kiev.zoral.com.ua> <4D1DCE02.3050601@marino.st> <20101231125215.GL90883@deviant.kiev.zoral.com.ua> <4D1DD5CF.5020305@marino.st> <20101231132706.GN90883@deviant.kiev.zoral.com.ua> <4D1DDC99.7000400@marino.st> <20101231134418.GO90883@deviant.kiev.zoral.com.ua> <4D1E30EA.7050308@marino.st> <20101231194619.GS90883@deviant.kiev.zoral.com.ua> In-Reply-To: <20101231194619.GS90883@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-threads@freebsd.org Subject: Re: AMD64 version of GNAT Ada compiler broken due to libthr X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 20:19:57 -0000 Ah, interesting. I didn't realize the ramifications of AMD64-only application of mprotect(). It's easy enough to apply the same macro to both architectures. As far as pushing it upstream, I've got literally a few dozen patches, and the majority of them should be contributed back. I haven't gone through the absurdly difficult and time-consuming process of assigning copyright over to the FSF, partly because I reside in France with a Dutch employer and nobody I work for would sign the legal documents FSF requests (if I even wanted to share with my employers what I do in my own time.) I may go through the process some day if we can leave my employers out of it, but it's not a priority at this moment. I'm not philosophically opposed to giving back, although I am dismayed at the number of offered patches that are never reviewed by the gcc developers and die on the vine. If I could find a way to "fast-track" these patches in where I wouldn't be wasting my time, I'd do it. It's a pain to maintain a parallel fork and I'd love to reduce the number of differences between the code bases. Obviously if you have any ideas that get my FreeBSD work into the gcc efficiently, I'm all ears. Regards, John Kostik Belousov wrote: > On Fri, Dec 31, 2010 at 08:37:14PM +0100, John Marino wrote: >> Hi Kostik, >> >> Thanks for pointing me in the right direction. After some research, I >> discovered that only DragonFly BSD allows execution on the stack by >> default. NetBSD and OpenBSD (and Solaris and Darwin) all were specially >> configured within gcc to execute mprotect first to enable this >> functionality. FreeBSD never had this gcc configuration code and >> frankly it looks like it should have already been there. >> >> I created my own __enable_execute_stack macro function based on these >> previous works and now GNAT has passed all tests! Since i386 always >> worked, I only applied to macro to the AMD64 configuration header. > You need the same application of mprotect() for i386 too, since > 32bit binary executed on amd64 kernel gets non-executable stack as well. > >> You've been a great help! Once I understood what the issue was, >> everything fell into place. > Will you upstream the changes to gcc ? >