All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Javier Martín" <lordhabbit@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] remove target_os
Date: Mon, 26 Jan 2009 23:17:09 +0100	[thread overview]
Message-ID: <1233008230.24663.8.camel@localhost> (raw)
In-Reply-To: <497E1596.7040802@t-online.de>

[-- Attachment #1: Type: text/plain, Size: 2744 bytes --]

Hi GRUB devs,
El lun, 26-01-2009 a las 20:57 +0100, Christian Franke escribió:
> Robert Millan wrote:
> > Hi,
> >
> > Based on the description of host/target triplets in configure.ac:
> >
> > dnl   build  -- the environment for building GRUB
> > dnl   host   -- the environment for running utilities
> > dnl   target -- the environment for running GRUB
> >
> > it seems that target_os is an oxymoron.  There's no OS in the environment
> > where GRUB will run (well, there's the firmware, but we already use
> > target_vendor for that, and _os has a well-defined meaning).
> >
> > Attached patch fixes that by supressing all references to target_os, and
> > replacing them with host_os where suitable.
> >
> > Christian: since this mostly affects Cygwin, could you verify that it doesn't
> > cause breakage before I commit it?
> >
> >   
> 
> Hi Robert,
> 
> thanks for sending the patch first. Cygwin build looks good.
> 
> 
> But even if GRUB itself is build for some $target_cpu-$target_vendor 
> (i386-pc), the target_os is not useless if cross-compilation support is 
> desired:
> 
> - GRUB tools like grub-setup are build for the target_os
> - Package structure may depend on target_os.
> 
> - The gcc code generator may emit special code tailored for the assumed 
> target_os
> Examples:
> Stack frame checks
> Nested function trampolines (__enable_execute_stack())
> 
> Unfortunately, gcc has no '-fno_os' option to specify the bare CPU as 
> target.

Might -ffreestanding be what you are looking for?

> Fortunately, all current issues can be handled by autoconf checks.
> 
> 
> >  AC_MSG_CHECKING([for command to convert module to ELF format])
> > -case "${host_os}:${target_os}" in
> > -  cygwin:cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;;
> > +case "${host_os}" in
> > +  cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;;
> >    *) ;;
> >  esac
> >   
> 
> This won't work for a Linux cross compiler hosted on Cygwin. It would 
> emit ELF format and does not need pe2elf.

A, say, AMD64 Linux cross compiler hosted on x86 Cygwin would have
$build=i686-pc-cygwin and $host=amd64-linux-gnu. Thus, no conflict ought
to arise even with cross compilation enabled.

AFAIK, the full power of $build+$host+$target only matters when building
_compilers_ (and binutils, etc.), because you might want to use an
AMD64/Linux machine to build a compiler that will run on PPC/Darwin but
produce executables for a x86/Cygwin machine

> 
> But all this is theoretical unless cross compilation is really needed.
>
> Christian
> 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel

[-- Attachment #2: Esta parte del mensaje está firmada digitalmente --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2009-01-26 22:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-25 23:12 [PATCH] remove target_os Robert Millan
2009-01-26 19:57 ` Christian Franke
2009-01-26 22:17   ` Javier Martín [this message]
2009-01-27 16:51     ` Vesa Jääskeläinen
2009-01-27 17:33       ` Javier Martín
2009-02-07 21:53         ` remove OS part of --target=xxx (Re: [PATCH] remove target_os) Robert Millan
2009-01-27 17:21     ` [PATCH] remove target_os Christian Franke
2009-01-27 17:40       ` Javier Martín
2009-01-27 19:56         ` Christian Franke
2009-01-27 21:52           ` Javier Martín
2009-01-29  7:00             ` Christian Franke
2009-02-07 21:54           ` Robert Millan
2009-02-08 19:59             ` Robert Millan
2009-02-07 21:48   ` Robert Millan

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=1233008230.24663.8.camel@localhost \
    --to=lordhabbit@gmail.com \
    --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.