grub-devel
[Top][All Lists]
Advanced

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

Re: GRUB2 Build on Mac OS X


From: Marco Gerards
Subject: Re: GRUB2 Build on Mac OS X
Date: Thu, 08 Dec 2005 13:26:02 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Andre Smith <address@hidden> writes:

Hi Andre,

> The GRUB2 build fails on Mac OS X, due to non-support of nested
> functions in GCC on OS X. The reasoning behind this, the GCC
> implementation of nested functions uses stack based execution.
> Hackers use buffer overflows, along with stack based execution, to
> exploit weaknesses in poorly written code. Apple has decided to
> disable nested function support until a volunteer has patched GCC
> with a non-stack based implementation of nested functions.

Right, there has been a discussion about this on the list.

> I would like to see the PowerPC port of Open Solaris build on Mac
> hardware. I have been working on patches for the code that uses
> nested functions in the GRUB2 project and I would like get some
> feedback from the list. I would also like to solicit help in testing
> the patches against the official tree for regression testing.

It's not acceptable to me to just remove the nested functions because
someone broke some unofficial build of gcc.  When an executable stack
is not available, there are the following options (as I see them):

Enable the executable stack using:
1) Set some bit in the ELF file so the OS knows we want this
  (that's what linux does).
2) Enable it using some function.
3) Creating our own stack.

So on the apple nested functions should not cause an error.  Perhaps a
serious warning that the stack is not available and a runtime error.
In that case we can use the fixes above.

So on the apple the right thing to do would be:

1) Fix gcc so nested functions are not fatal.
2) fix GRUB using the methods I described above.

What kind of restrictions does opensolaris have on nested functions?
If it doesn't cause an error, the problem for opensolaris is not that
big.

Thanks,
Marco





reply via email to

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