Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1EhtLN-0004tK-AH for mharc-grub-devel@gnu.org; Thu, 01 Dec 2005 13:39:46 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EhtLI-0004sF-SF for grub-devel@gnu.org; Thu, 01 Dec 2005 13:39:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EhtKn-0004Yw-4o for grub-devel@gnu.org; Thu, 01 Dec 2005 13:39:40 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EhtKm-0004Ya-Of for grub-devel@gnu.org; Thu, 01 Dec 2005 13:39:08 -0500 Received: from [194.109.24.21] (helo=smtp-vbr1.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EhtKl-0004gI-Vn for grub-devel@gnu.org; Thu, 01 Dec 2005 13:39:08 -0500 Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by smtp-vbr1.xs4all.nl (8.13.3/8.13.3) with ESMTP id jB1Id59U078008 for ; Thu, 1 Dec 2005 19:39:06 +0100 (CET) (envelope-from mgerards@xs4all.nl) Mail-Copies-To: mgerards@xs4all.nl To: The development of GRUB 2 References: <1372.158.195.32.9.1133361813.squirrel@158.195.32.9> <87u0dt9bdt.fsf@xs4all.nl> From: Marco Gerards Date: Thu, 01 Dec 2005 19:39:05 +0100 In-Reply-To: (Hollis Blanchard's message of "Thu, 1 Dec 2005 10:00:05 -0600") Message-ID: <87mzjkachi.fsf@xs4all.nl> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner Subject: Re: [PATCH] NetBSD/i386 port X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2005 18:39:41 -0000 Hollis Blanchard writes: > On Dec 1, 2005, at 7:48 AM, Marco Gerards wrote: >>> Files affected: kern/mm.c, normal/misc.c >>> >>> This is probably more a gcc issue (my is gcc version 3.3.3 (NetBSD nb3 >>> 20040520)). As of 2.0, NetBSD/i386 uses non-executable mapping of >>> stack >>> and thus when nested functions are used it generates call to >>> __enable_execute_stack() (which is actually in libgcc) even if >>> -nostdlib >>> is used. Since I know no way to disable this behavior (but there >>> might be >>> some) only workaround known to me is providing dumb >>> __enable_execute_stack() >>> functions where apropriate. >> >> When is this required? When using grub-emu or any other userland >> utility? In that case GRUB is linked to the C library. >> >> In the case it is used for GRUB itself, it is useless. GRUB executes >> within its own environment. So in that case we should just make sure >> this doesn't show up. Perhaps by using different compiler flags. > > I think this is a problem Peter Jones was telling me about with Fedora > as well (non-executable stack conflicting with nested functions). > > Peter, do you know anything about that __enable_execute_stack()? > http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01700.html seems to > indicate it's only for Solaris, NetBSD, FreeBSD/SPARC64 and OSF, but > it sounds like we need it on Linux as well? In that case we only need it in util/, I assume? I wonder if it is possible to check this using autoconf and add it to util/misc.c in some initialization function (that yet has to be written). I was told that -ftrampolines might fix our problem, so looking at that flag might be useful. -- Marco