All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: multiboot2.h includes stdint.h - not good
Date: Mon, 23 Mar 2009 20:38:30 -0400	[thread overview]
Message-ID: <1237855110.5199.28.camel@mj> (raw)
In-Reply-To: <49C7D857.9070108@nic.fi>

On Mon, 2009-03-23 at 20:43 +0200, Vesa Jääskeläinen wrote:
> Pavel Roskin wrote:
> > By the way, I already noticed that the inclusion of stdint.h from
> > multiboot2.h is one of the problems preventing cross-compilation of GRUB
> > without the libc for the target.  Perhaps GRUB should provide its
> > replacement for stdint.h when compiling for the target.  Alternatively,
> > multiboot2.h should use GRUB types.
> 
> In grub ecosystem grub_* types should be used to specify arch dependent
> types. Where as I favor stdint.h types like uint8_t for many things, the
> idea for grub's own replacement is to easily detect wrong types used on
> compilation process.
> 
> So... stdint.h out... grub types in..

OK, let's fix the error messages for now.

It turns out *.lst files for *.S files are generated without ASM_FILE
defined.  Real compilation defines ASM_FILE.  Several *.S files define
ASM_FILE internally, but loader/i386/multiboot_helper.S is not one of
them.

It's hard to capture errors in the *.lst generation without splitting a
pipe into separate commands and introducing a temporary file, so it's
probably not worth the trouble.  Besides, any errors in the list
generation will be caught at the compilation stage if the compiler flags
are the same.  But they are not the same, and that's a problem.

ASM_FILE should be consistently defined for the same files in the
compilation rules and in the list generating rules in genmk.rb.

ChangeLog:

	* genmk.rb: Define ASM_FILE for *.S files when generating
	any lists.

Index: genmk.rb
===================================================================
--- genmk.rb	(revision 2043)
+++ genmk.rb	(working copy)
@@ -159,17 +159,17 @@
 
 #{command}: #{src} $(#{src}_DEPENDENCIES) gencmdlist.sh
 	set -e; \
-	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
+	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
 	  | sh $(srcdir)/gencmdlist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
 
 #{fs}: #{src} $(#{src}_DEPENDENCIES) genfslist.sh
 	set -e; \
-	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
+	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
 	  | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
 
 #{partmap}: #{src} $(#{src}_DEPENDENCIES) genpartmaplist.sh
 	set -e; \
-	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
+	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \
 	  | sh $(srcdir)/genpartmaplist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
 
 


-- 
Regards,
Pavel Roskin



      reply	other threads:[~2009-03-24  0:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 16:56 multiboot2.h includes stdint.h - not good Pavel Roskin
2009-03-23 18:43 ` Vesa Jääskeläinen
2009-03-24  0:38   ` Pavel Roskin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1237855110.5199.28.camel@mj \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.