From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1ItiQb-0007Wu-Ld for mharc-grub-devel@gnu.org; Sun, 18 Nov 2007 06:35:05 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ItiQZ-0007VO-TM for grub-devel@gnu.org; Sun, 18 Nov 2007 06:35:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ItiQY-0007TL-8p for grub-devel@gnu.org; Sun, 18 Nov 2007 06:35:03 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItiQY-0007TH-2n for grub-devel@gnu.org; Sun, 18 Nov 2007 06:35:02 -0500 Received: from smtp-vbr9.xs4all.nl ([194.109.24.29]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ItiQX-0004lt-2v for grub-devel@gnu.org; Sun, 18 Nov 2007 06:35:01 -0500 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr9.xs4all.nl (8.13.8/8.13.8) with ESMTP id lAIBYx95076983 for ; Sun, 18 Nov 2007 12:35:00 +0100 (CET) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <473E2086.9040502@t-online.de> <20071118070706.GA3531@thorin> Mail-Copies-To: mgerards@xs4all.nl Date: Sun, 18 Nov 2007 12:35:55 +0100 In-Reply-To: <20071118070706.GA3531@thorin> (Robert Millan's message of "Sun, 18 Nov 2007 08:07:07 +0100") Message-ID: <87oddrrdk4.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: Building GRUB on platforms without ELF support 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: Sun, 18 Nov 2007 11:35:04 -0000 Robert Millan writes: > On Fri, Nov 16, 2007 at 11:58:14PM +0100, Christian Franke wrote: >> Building GRUB modules requires ELF support in gas and ld. For platforms >> where ELF is not the native format, ld may support ELF output. If not >> (like on Cywin) some conversion to ELF is necessary. >> >> In general, GNU objcopy allows conversion between object file formats. >> Unfortunately, objcopy (and BFD itself) does not include any support for >> the conversion of relocation formats (even conversion between ELF >> variants do not work). In particular, when converting PE (a COFF >> variant) to ELF, objcopy does not abort but silently produces bad >> PC-relative relocation offsets. In my first Cygwin patch, there is a >> hack to fix this in the GRUB ELF loader. >> >> For specific conversions, fixing this in objcopy itself is easy. But >> there is not much chance that such pragmatic patches will be accepted >> upstream. >> (http://sourceware.org/ml/binutils/2007-10/threads.html#00302) >> >> I have prepared a reduced (~680 LoC) version of objcopy with the PE->ELF >> fix added. To support build on non-ELF platforms, I would suggest to add >> this to the GRUB codebase. It can be later extended for other platforms >> if desired. > > I'm not sure what the GRUB maintainers will think, but I'm not very inclined > to duplicate stuff that binutils already have. So am I. > How about building binutils with --enable-targets=i386-elf ? Maybe the > Cygwin maintainers would even add it as default. We could also have a > configure check that aborts build when -m elf_i386 is not supported (which > may also be a problem on pure-x86_64 environment!) and prompt user to > rebuild binutils. That would be a nice check to have. -- Marco