This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3.3 regression?] flag_hosted and back-ends


Jason R Thorpe <thorpej at wasabisystems dot com> writes:

> I have a problem that I need some advice on how to fix.
> 
> A NetBSD user reported to me a problem compiling GRUB.  The problem is
> that GRUB uses nested functions, yet is a freestanding program; it uses
> -nostdlib, but even if it did link against libgcc, the __enable_execute_stack()
> function would not work, because it assumes a hosted environment.
> 
> The fix that was obvious to me was to make GRUB use -ffreestanding (it
> currently uses -fno-builtin), and to enable the __enable_execute_stack()
> libcall if flag_hosted is false.
> 
> The problem is that flag_hosted is specific to the C-family front-ends,
> and so I can't reference it in the back-end where the libcall is emitted.
> 
> Since the call to __enable_execute_stack() by the i386 back-end is new
> in 3.3, I think this technically qualifies as a regression.
> 
> My initial thought on how to solve the problem is to move flag_hosted
> into a language-independent part of the compiler, thus enabling the
> back-ends to use it.  If anyone has another suggestion, let me know.
> In the mean time, I will cook up a patch that moves flag_hosted.
> 
> Thanks...

Why can't GRUB supply its own __enable_execute_stack function, that
does whatever the right thing is for GRUB's environment?

-- 
- Geoffrey Keating <geoffk at geoffk dot org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]