grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] remove target_os


From: Javier Martín
Subject: Re: [PATCH] remove target_os
Date: Tue, 27 Jan 2009 22:52:59 +0100

El mar, 27-01-2009 a las 20:56 +0100, Christian Franke escribió:
> Javier Martín wrote:
> > El mar, 27-01-2009 a las 18:21 +0100, Christian Franke escribió:
> >   
> >> Javier Martín wrote:
> >>     
> >>>> Unfortunately, gcc has no '-fno_os' option to specify the bare CPU as 
> >>>> target.
> >>>>     
> >>>>         
> >>> Might -ffreestanding be what you are looking for?
> >>>
> >>>   
> >>>       
> >> The option '-ffreestanding' is the same as '-fno-hosted'.
> >>
> >> According to gcc (4.3.1) source, '-fno-hosted' clears variable 
> >> 'flag_hosted' and sets '-fno-builtin'. The latter is already set within 
> >> GRUB build.
> >>
> >> A cleared 'flag_hosted' apparently has only 2 effects:
> >> - disable the special handling of 'main()'.
> >> - #define __STDC_HOSTED__ to 0 instead of 1
> >>
> >> There is no effect on the target_os dependent parts of the gcc code 
> >> generation. For example, on i386, __enable_execute_stack() calls are 
> >> generated for target_os netbsd, openbsd and cygwin, but not for linux. 
> >> The emit call is hard-coded in 
> >> gcc/configs/i386/i386.c:x86_initialize_trampoline().
> >>     
> >
> > In that case, we are dealing with a GCC bug. We might want to require
> > the user to create a bare "no-OS" cross compiler. 
> >
> >   
> 
> Is building a bare 'no-OS' compiler supported by the upstream GCC sources?
> Probably a too strict prerequisite for building GRUB.

I can't vouch so for all possible environments, but I can say that
"clean" no-OS targets like i386-pc-elf exist at least for x86 and x86_64
(this last being added as of GCC 4.3.2). However, as I said, if
-ffreestanding does not do its job of providing a "true" freestanding
environment (i.e. without relying on _any_ external libraries or
syscalls, as opposite to the usual hosted environment), a bug report
should be posted.

Attachment: signature.asc
Description: Esta parte del mensaje está firmada digitalmente


reply via email to

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