From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.33) id 1Cc3ml-0007Nj-22 for mharc-grub-devel@gnu.org; Wed, 08 Dec 2004 10:31:23 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Cc3mj-0007Nc-08 for grub-devel@gnu.org; Wed, 08 Dec 2004 10:31:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Cc3mi-0007NM-AU for grub-devel@gnu.org; Wed, 08 Dec 2004 10:31:20 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cc3mi-0007NC-39 for grub-devel@gnu.org; Wed, 08 Dec 2004 10:31:20 -0500 Received: from [193.45.208.6] (helo=griffin.skarpodata.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1Cc3cd-0005ta-Jk for grub-devel@gnu.org; Wed, 08 Dec 2004 10:20:56 -0500 Received: from localhost.localdomain (183.201.216.81.s-s.siw.siwnet.net [81.216.201.183]) by griffin.skarpodata.com (8.12.10/8.12.10) with ESMTP id iB8Gj5ld002113; Wed, 8 Dec 2004 17:45:05 +0100 To: Marco Gerards References: <87sm6iqs9s.fsf@night.trouble.net> <87acsqp3fe.fsf@marco.marco-g.com> <87k6rtoyrj.fsf@night.trouble.net> <87hdmxhufk.fsf@marco.marco-g.com> <87fz2hotzi.fsf@night.trouble.net> <87d5xlhtcb.fsf@marco.marco-g.com> <87brd4q5wq.fsf@night.trouble.net> <878y887s7s.fsf@marco.marco-g.com> From: Johan Rydberg Date: Wed, 08 Dec 2004 16:32:33 +0100 In-Reply-To: <878y887s7s.fsf@marco.marco-g.com> (Marco Gerards's message of "Wed, 08 Dec 2004 14:57:43 +0000") Message-ID: <873bygpzzi.fsf@night.trouble.net> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: The development of GRUB 2 Subject: Re: multiboot 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, 08 Dec 2004 15:31:21 -0000 Marco Gerards writes: > Johan Rydberg writes: > >> The initial problem was that AC_CHECK_SIZEOF doesn't work if you're >> cross-compiling. I fixed this by using AC_COMPILE_CHECK_SIZEOF [1] >> instead. > > This sounds right to me, but I do not see this in the patch... Of course not. I didn't include it :) I'm sure you can download the m4 macro, install it in acinclude.m4 and change AC_CHECK_SIZEOF to AC_COMPILE_CHECK_SIZEOF. If you're as lazy as I am, I can include it in a later patch. >> But the major problem is that parts of GRUB2 requires a C library to >> be installed, at least headers such as alloca.h and stdint.h. Is this >> really a valid demand? > > Is this required for grubof? IIRC those headers are not a part of the > C library, but a part of gcc or libgcc or so. Am I right about that? My GCC installation (3.2.2 configured for powerpc-elf) installed the following headers: /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/syslimits.h /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/stdarg.h /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/stddef.h /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/varargs.h /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/stdbool.h /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/iso646.h /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/ppc-asm.h /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/altivec.h /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/limits.h /gnu/lib/gcc-lib/powerpc-elf/3.2.2/include/float.h And my native installation of GCC (3.3.4 configured for i486-linux) includes: /usr/lib/gcc-lib/i486-linux/3.3.4/include/iso646.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/float.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/limits.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/stdarg.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/stdbool.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/stddef.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/syslimits.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/unwind.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/varargs.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/mmintrin.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/emmintrin.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/pmmintrin.h /usr/lib/gcc-lib/i486-linux/3.3.4/include/xmmintrin.h A little more research shows that both stdint.h and alloca.h is part of glibc: $ head -2 /usr/include/stdint.h /* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. $ head -2 /usr/include/alloca.h /* Copyright (C) 1992, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. So either we stop using then, or write our own versions. > Instead of alloca we can also use something like: > [...] > In most cases that will remove the dependency on alloca. IMHO it is > better not to use alloca. It is also possible to use __builtin_alloca if alloca.h is missing, provided that there's a requirement for GCC. >> That brings us the next issue; BUILD_CC is used to build _everything_, >> including the host-specific object files, and since BUILD_CC is set to >> /usr/bin/gcc in my cross-compiler environment it will try to compile >> PPC assembler sources with a i386 compiler. Not good. >> >> My suggestion is to create a new class for programs that should be >> host-specific, and let Utilities be compiled on the build machine. >> See the patch. > > Ok, that sounds sane. But what if you really want to cross-compile a > complete system (including libc, GRUB, etc)? Good call. I'm not sure what to do. Got any ideas? > Can you make one big patch with a changelog entry so it can be > committed after Okuji agrees with the patch? I would prefer Okuji looked at the changes to genmk.rb before that. ~j