Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MCZwb-0001AX-Ie for mharc-grub-devel@gnu.org; Fri, 05 Jun 2009 09:58:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MCZwZ-0001AJ-GB for grub-devel@gnu.org; Fri, 05 Jun 2009 09:58:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MCZwW-00016z-3Z for grub-devel@gnu.org; Fri, 05 Jun 2009 09:58:51 -0400 Received: from [199.232.76.173] (port=60936 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MCZwV-00016u-LN for grub-devel@gnu.org; Fri, 05 Jun 2009 09:58:47 -0400 Received: from mail-bw0-f211.google.com ([209.85.218.211]:62262) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MCZwV-0006gA-00 for grub-devel@gnu.org; Fri, 05 Jun 2009 09:58:47 -0400 Received: by bwz7 with SMTP id 7so171344bwz.42 for ; Fri, 05 Jun 2009 06:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=c+eGaLrjngx88yrKVxYd2ZgC47yUNHgprLzuLoIGW5A=; b=iDJXLsra7z65x2g84Z+ptKGYVs/hWP9vh6f0WHhKwAvf5RPR6O5HqD6i3d6+iyl5FQ DO/WU/L0qg1kC3bVqQWb7aGgiJu5+PxKK4jWqhBrngjhWhyTyxYgvuxDPPdpBE9Wb8qQ +OYZacybKKrveKdfuP97Bsu84cKvcBKgfmHDQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Gu3hhFRTRUUcsOd6UUYCtp3euPoLWyFfHoX9rnIoVYuAjIxNufUQEZzQMqEaD94xVu LBWkfLFOQh0Y4faQl4IQErfr8yg9peyJuBqA79PdmOSPi94ve41RfTkf3skVxxH3674K lUAv0ckxnr/2uwmNtEe0+fQ2VeRbC8qg9FyTg= MIME-Version: 1.0 Received: by 10.204.117.16 with SMTP id o16mr2620361bkq.100.1244210325858; Fri, 05 Jun 2009 06:58:45 -0700 (PDT) In-Reply-To: <20090522233339.16268.62568.stgit@mj.roinet.com> References: <20090522233339.16268.62568.stgit@mj.roinet.com> Date: Fri, 5 Jun 2009 15:58:45 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] RFC: allow compilation without target libc 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: Fri, 05 Jun 2009 13:58:51 -0000 This patch greatly simplifies compiling on freebsd-amd64 and possibly other systems. Would be nice to get in into mainstream fastly. Concern about multiboot2.h however remains On Sat, May 23, 2009 at 1:33 AM, Pavel Roskin wrote: > ChangeLog: > > =A0 =A0 =A0 =A0* configure.ac: Define GRUB_SOURCE to identify GRUB source= s > =A0 =A0 =A0 =A0in include/multiboot2.h. =A0Use "-nostdlib" when testing t= arget > =A0 =A0 =A0 =A0compiler. > =A0 =A0 =A0 =A0* include/multiboot2.h: Use GRUB types and definitions. = =A0Provide > =A0 =A0 =A0 =A0compatibility layer when GRUB_SOURCE is not defined. > =A0 =A0 =A0 =A0* loader/i386/pc/multiboot2.c: Include multiboot2.h last t= o make > =A0 =A0 =A0 =A0sure that config.h was included first. > =A0 =A0 =A0 =A0* loader/multiboot2.c: Likewise. > =A0 =A0 =A0 =A0* loader/multiboot_loader.c: Likewise. > --- > > =A0configure.ac =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A03 ++- > =A0include/multiboot2.h =A0 =A0 =A0 =A0| =A0 24 +++++++++++++++--------- > =A0loader/i386/pc/multiboot2.c | =A0 =A02 +- > =A0loader/multiboot2.c =A0 =A0 =A0 =A0 | =A0 =A02 +- > =A0loader/multiboot_loader.c =A0 | =A0 =A02 +- > =A05 files changed, 20 insertions(+), 13 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 98cd841..af60603 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -161,6 +161,7 @@ test "x$GCC" =3D xyes || AC_MSG_ERROR([GCC is require= d]) > > =A0AC_GNU_SOURCE > =A0AC_SYS_LARGEFILE > +AC_DEFINE([GRUB_SOURCE], [1], [Define when compiling GRUB sources.]) > > =A0# Identify characteristics of the host architecture. > =A0AC_C_BIGENDIAN > @@ -366,7 +367,7 @@ AC_SUBST(TARGET_LDFLAGS) > > =A0# Set them to their new values for the tests below. > =A0CC=3D"$TARGET_CC" > -CFLAGS=3D"$TARGET_CFLAGS" > +CFLAGS=3D"$TARGET_CFLAGS -nostdlib" > =A0CPPFLAGS=3D"$TARGET_CPPFLAGS" > =A0LDFLAGS=3D"$TARGET_LDFLAGS" > > diff --git a/include/multiboot2.h b/include/multiboot2.h > index 0f2b0cf..e8fe425 100644 > --- a/include/multiboot2.h > +++ b/include/multiboot2.h > @@ -34,25 +34,31 @@ > > =A0#ifndef ASM_FILE > > -#include "stdint.h" > +#ifdef GRUB_SOURCE > +#include > +#else > +#include > +typedef uint32_t grub_uint32_t; > +typedef uint64_t grub_uint64_t; > +#define GRUB_TARGET_SIZEOF_VOID_P (__WORDSIZE / 8) > +#endif > > -/* XXX not portable? */ > -#if __WORDSIZE =3D=3D 64 > -typedef uint64_t multiboot_word; > +#if GRUB_TARGET_SIZEOF_VOID_P =3D=3D 8 > +typedef grub_uint64_t multiboot_word; > =A0#else > -typedef uint32_t multiboot_word; > +typedef grub_uint32_t multiboot_word; > =A0#endif > > =A0struct multiboot_header > =A0{ > - =A0uint32_t magic; > - =A0uint32_t flags; > + =A0grub_uint32_t magic; > + =A0grub_uint32_t flags; > =A0}; > > =A0struct multiboot_tag_header > =A0{ > - =A0uint32_t key; > - =A0uint32_t len; > + =A0grub_uint32_t key; > + =A0grub_uint32_t len; > =A0}; > > =A0#define MULTIBOOT2_TAG_RESERVED1 0 > diff --git a/loader/i386/pc/multiboot2.c b/loader/i386/pc/multiboot2.c > index 2c14ee2..25ef150 100644 > --- a/loader/i386/pc/multiboot2.c > +++ b/loader/i386/pc/multiboot2.c > @@ -17,7 +17,6 @@ > =A0* =A0along with GRUB. =A0If not, see . > =A0*/ > > -#include > =A0#include > =A0#include > =A0#include > @@ -25,6 +24,7 @@ > =A0#include > =A0#include > =A0#include > +#include > > =A0grub_err_t > =A0grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr) > diff --git a/loader/multiboot2.c b/loader/multiboot2.c > index fd82828..34e42c1 100644 > --- a/loader/multiboot2.c > +++ b/loader/multiboot2.c > @@ -17,7 +17,6 @@ > =A0* =A0along with GRUB. =A0If not, see . > =A0*/ > > -#include > =A0#include > =A0#include > =A0#include > @@ -28,6 +27,7 @@ > =A0#include > =A0#include > =A0#include > +#include > > =A0static grub_addr_t entry; > =A0extern grub_dl_t my_mod; > diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c > index 11ba666..654508e 100644 > --- a/loader/multiboot_loader.c > +++ b/loader/multiboot_loader.c > @@ -17,7 +17,6 @@ > =A0* =A0along with GRUB. =A0If not, see . > =A0*/ > > -#include > =A0#include > =A0#include > =A0#include > @@ -29,6 +28,7 @@ > =A0#include > =A0#include > =A0#include > +#include > > =A0grub_dl_t my_mod; > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko