grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] Allow compilation without having target libc installed


From: Pavel Roskin
Subject: [PATCH 2/2] Allow compilation without having target libc installed
Date: Tue, 09 Jun 2009 18:12:09 -0400
User-agent: StGIT/0.14.3

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 <grub/err.h>
 #include <grub/elf.h>
 
+#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 <http://www.gnu.org/licenses/>.
  */
 
-#include <multiboot2.h>
 #include <grub/multiboot2.h>
+#include <multiboot2.h>
 #include <grub/elf.h>
 #include <grub/err.h>
 #include <grub/machine/loader.h>
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 <http://www.gnu.org/licenses/>.
  */
 
-#include <multiboot2.h>
 #include <grub/loader.h>
 #include <grub/ieee1275/ieee1275.h>
 #include <grub/multiboot2.h>
+#include <multiboot2.h>
 #include <grub/err.h>
 #include <grub/elf.h>
 #include <grub/misc.h>
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 <http://www.gnu.org/licenses/>.
  */
 
-#include <multiboot2.h>
 #include <grub/loader.h>
 #include <grub/machine/loader.h>
 #include <grub/multiboot2.h>
+#include <multiboot2.h>
 #include <grub/elfload.h>
 #include <grub/file.h>
 #include <grub/err.h>
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 <http://www.gnu.org/licenses/>.
  */
 
-#include <multiboot2.h>
 #include <grub/machine/machine.h>
 #include <grub/multiboot.h>
 #include <grub/multiboot2.h>
+#include <multiboot2.h>
 #include <grub/elf.h>
 #include <grub/file.h>
 #include <grub/err.h>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]