This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[3.3 regression?] flag_hosted and back-ends
- From: Jason R Thorpe <thorpej at wasabisystems dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 14 Mar 2003 14:59:10 -0800
- Subject: [3.3 regression?] flag_hosted and back-ends
- Organization: Wasabi Systems, Inc.
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...
--
-- Jason R. Thorpe <thorpej at wasabisystems dot com>