Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1ME9YI-0007Pw-TH for mharc-grub-devel@gnu.org; Tue, 09 Jun 2009 18:12:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ME9YG-0007Lh-E3 for grub-devel@gnu.org; Tue, 09 Jun 2009 18:12:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ME9YB-0007Cq-A9 for grub-devel@gnu.org; Tue, 09 Jun 2009 18:12:15 -0400 Received: from [199.232.76.173] (port=51422 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME9YB-0007Bv-2l for grub-devel@gnu.org; Tue, 09 Jun 2009 18:12:11 -0400 Received: from c60.cesmail.net ([216.154.195.49]:47979) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1ME9YA-0002BG-MB for grub-devel@gnu.org; Tue, 09 Jun 2009 18:12:10 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 09 Jun 2009 18:12:11 -0400 Received: from mj.roinet.com (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 2386734C6A for ; Tue, 9 Jun 2009 18:16:25 -0400 (EDT) From: Pavel Roskin To: grub-devel@gnu.org Date: Tue, 09 Jun 2009 18:12:09 -0400 Message-ID: <20090609221209.30586.59241.stgit@mj.roinet.com> In-Reply-To: <20090609221203.30586.29218.stgit@mj.roinet.com> References: <20090609221203.30586.29218.stgit@mj.roinet.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH 2/2] Allow compilation without having target libc installed 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: Tue, 09 Jun 2009 22:12:17 -0000 ChangeLog: * configure.ac: Use -nostdlib when probing for the target. * include/grub/multiboot2.h: Provide compatibility defines for multiboot.h. * include/multiboot2.h: Don't include stdint.h. It's the responsibility of the code that includes that header. * loader/i386/pc/multiboot2.c: Include multiboot2.h after grub/multiboot2.h. * loader/ieee1275/multiboot2.c: Likewise. * loader/multiboot2.c: Likewise. * loader/multiboot_loader.c: Likewise. --- configure.ac | 2 +- include/grub/multiboot2.h | 5 +++++ include/multiboot2.h | 2 -- loader/i386/pc/multiboot2.c | 2 +- loader/ieee1275/multiboot2.c | 2 +- loader/multiboot2.c | 2 +- loader/multiboot_loader.c | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 8ece359..e29495a 100644 --- a/configure.ac +++ b/configure.ac @@ -405,7 +405,7 @@ AC_SUBST(TARGET_LDFLAGS) # Set them to their new values for the tests below. CC="$TARGET_CC" -CFLAGS="$TARGET_CFLAGS" +CFLAGS="$TARGET_CFLAGS -nostdlib" CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" diff --git a/include/grub/multiboot2.h b/include/grub/multiboot2.h index bfbffcc..6d7f19d 100644 --- a/include/grub/multiboot2.h +++ b/include/grub/multiboot2.h @@ -24,6 +24,11 @@ #include #include +#ifndef GRUB_UTIL +typedef grub_uint32_t uint32_t; +#define __WORDSIZE (8 * GRUB_TARGET_SIZEOF_VOID_P) +#endif + struct multiboot_tag_header; grub_err_t diff --git a/include/multiboot2.h b/include/multiboot2.h index 0f2b0cf..7270075 100644 --- a/include/multiboot2.h +++ b/include/multiboot2.h @@ -34,8 +34,6 @@ #ifndef ASM_FILE -#include "stdint.h" - /* XXX not portable? */ #if __WORDSIZE == 64 typedef uint64_t multiboot_word; diff --git a/loader/i386/pc/multiboot2.c b/loader/i386/pc/multiboot2.c index 2c14ee2..7d7c685 100644 --- a/loader/i386/pc/multiboot2.c +++ b/loader/i386/pc/multiboot2.c @@ -17,8 +17,8 @@ * along with GRUB. If not, see . */ -#include #include +#include #include #include #include diff --git a/loader/ieee1275/multiboot2.c b/loader/ieee1275/multiboot2.c index c253fc9..61f21b0 100644 --- a/loader/ieee1275/multiboot2.c +++ b/loader/ieee1275/multiboot2.c @@ -17,10 +17,10 @@ * along with GRUB. If not, see . */ -#include #include #include #include +#include #include #include #include diff --git a/loader/multiboot2.c b/loader/multiboot2.c index fd82828..6f8a679 100644 --- a/loader/multiboot2.c +++ b/loader/multiboot2.c @@ -17,10 +17,10 @@ * along with GRUB. If not, see . */ -#include #include #include #include +#include #include #include #include diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index 11ba666..707f55e 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -17,10 +17,10 @@ * along with GRUB. If not, see . */ -#include #include #include #include +#include #include #include #include