Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JKIHA-0004cg-Gy for mharc-grub-devel@gnu.org; Wed, 30 Jan 2008 14:07:12 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JKIH8-0004cI-Uz for grub-devel@gnu.org; Wed, 30 Jan 2008 14:07:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JKIH7-0004c4-CT for grub-devel@gnu.org; Wed, 30 Jan 2008 14:07:10 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKIH7-0004c1-8k for grub-devel@gnu.org; Wed, 30 Jan 2008 14:07:09 -0500 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JKIH6-0002Pz-Jt for grub-devel@gnu.org; Wed, 30 Jan 2008 14:07:09 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JKIGy-0002Zs-7T for grub-devel@gnu.org; Wed, 30 Jan 2008 19:07:00 +0000 Received: from adsl-69-234-200-201.dsl.irvnca.pacbell.net ([69.234.200.201]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Jan 2008 19:07:00 +0000 Received: from wa1ter by adsl-69-234-200-201.dsl.irvnca.pacbell.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Jan 2008 19:07:00 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: grub-devel@gnu.org From: walt Date: Wed, 30 Jan 2008 11:06:50 -0800 Organization: gmane Message-ID: <1201720010.27623.26.camel@k9.localnet> References: <20080126172120.GA4119@thorin> <1201378308.10461.10.camel@k9.localnet> <20080127085650.GB11381@thorin> <20080129053051.GY1341@kirkkit.kollasch.net> <20080129134707.GF27435@thorin> <20080130003750.GB1341@kirkkit.kollasch.net> <20080130132314.GA15277@thorin> <1201701103.17791.9.camel@k9.localnet> <20080130140017.GA16576@thorin> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: adsl-69-234-200-201.dsl.irvnca.pacbell.net In-Reply-To: X-Mailer: Evolution 2.12.3 Sender: news X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Subject: Re: Compiling grub2 on *BSD? 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: Wed, 30 Jan 2008 19:07:11 -0000 On Wed, 2008-01-30 at 08:38 -0800, walt wrote: > Robert Millan wrote: > ... > > What happens if you define the missing symbols somewhere? Any part of > > the GRUB kernel will do (e.g. kern/main.c). Just add them as empty > > functions: > > > > void > > __sysctl (void) > > { > > } > > > > void > > mprotect (void) > > { > > } > > > > and check if that works. > Anyway, your suggestion helps, but not quite enough. The c code now > compiles and links okay into *.mod files, but now __enable_execute_stack > shows up in several und-*.lst files... I've been hacking the various flags for elf.mod just to get *any* module to link properly but no luck. Here is the actual text printed by gcc as it links elf.mod: gcc -m32 -nostdlib -lgcc -L/usr/lib -Wl,-r,-d,-lgcc,-L/usr/lib -o elf.mod pre-elf.o mod-elf.o You can tell I'm desperate because I'm putting -lgcc everywhere I can think of. Here is the symbol in libgcc.a: _enable_execute_stack.o: 00000000 T __enable_execute_stack And here is the symbol table from the resulting elf.mod: # nm elf.mod U __enable_execute_stack <======= WTF? 0000038a T grub_elf32_load 000003fe T grub_elf32_size Okay, I found one *more* place to put libgcc: gcc -m32 -nostdlib -lgcc -L/usr/lib -Wl,-r,-d,-lgcc,-L/usr/lib -o elf.mod pre-elf.o mod-elf.o /usr/lib/libgcc.a Here is the puzzling (to me) result: # nm elf.mod 00000784 T __enable_execute_stack U __sysctl 0000038a T grub_elf32_load 000003fe T grub_elf32_size