From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IuDFJ-0006iq-GD for mharc-grub-devel@gnu.org; Mon, 19 Nov 2007 15:29:29 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IuDFH-0006i8-KU for grub-devel@gnu.org; Mon, 19 Nov 2007 15:29:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IuDFG-0006hj-4z for grub-devel@gnu.org; Mon, 19 Nov 2007 15:29:27 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IuDFG-0006hg-2K for grub-devel@gnu.org; Mon, 19 Nov 2007 15:29:26 -0500 Received: from mailout05.sul.t-online.de ([194.25.134.82] helo=mailout05.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IuDFF-0001ps-HV for grub-devel@gnu.org; Mon, 19 Nov 2007 15:29:25 -0500 Received: from fwd32.aul.t-online.de by mailout05.sul.t-online.com with smtp id 1IuDFE-0002yk-03; Mon, 19 Nov 2007 21:29:24 +0100 Received: from [10.3.2.2] (SrPvHBZJZhwvBzrs6eZkGiwnXIL2+H9y+729MLt6sJl7f6oEaQEV0u2ynJ9xtXWg-d@[217.235.205.150]) by fwd32.aul.t-online.de with esmtp id 1IuDF9-0PU31M0; Mon, 19 Nov 2007 21:29:19 +0100 Message-ID: <4741F21F.5020106@t-online.de> Date: Mon, 19 Nov 2007 21:29:19 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: The development of GRUB 2 References: <473E2086.9040502@t-online.de> <20071118070706.GA3531@thorin> <87oddrrdk4.fsf@xs4all.nl> In-Reply-To: <87oddrrdk4.fsf@xs4all.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: SrPvHBZJZhwvBzrs6eZkGiwnXIL2+H9y+729MLt6sJl7f6oEaQEV0u2ynJ9xtXWg-d X-TOI-MSGID: 9e94c772-eb7b-4cce-af5f-0b3c7288fdef X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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: Mon, 19 Nov 2007 20:29:28 -0000 Marco Gerards wrote: > Robert Millan writes: > > >> On Fri, Nov 16, 2007 at 11:58:14PM +0100, Christian Franke wrote: >> >>> ... >>> 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. > > Actually, binutils actually does not have this ("convert relocatable object files from format X to ELF") stuff. >> How about building binutils with --enable-targets=i386-elf ? Maybe the >> Cygwin maintainers would even add it as default. It is not so easy: Cygwin's libbfd, ld and objcopy support elf32-i386, gas does not. But ld refuses to output elf32-i386 if pe-i386 is the input format. This restriction is hard-coded into ld because some pe-specific operations are hard-coded into bfd backend (This includes the hack which fixes the pc-relative relocation in the executable). Enable elf32-i386 as additional output format for gas does not work. The compilation fails, multiple emulations are not supported on i386 platform. But even building gas as a cross-assembler does not help. Some assembler directives, like symbol type specs, are output format specific. Output from Cygwin's gcc produces syntax errors. Therefore, you would need also a gcc build as a cross-compiler. Not really worth the effort, so I posted the patch for kern/i386/dl.c instead. >> 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. >> > > Better prompt "sorry", as rebuilding binutils probably won't work OOTB in many cases ... :-) Christian