All of lore.kernel.org
 help / color / mirror / Atom feed
* GRUB2 Build on Mac OS X
@ 2005-12-08  6:10 Andre Smith
  2005-12-08 12:26 ` Marco Gerards
  2005-12-08 15:09 ` Andrei Warkentin
  0 siblings, 2 replies; 25+ messages in thread
From: Andre Smith @ 2005-12-08  6:10 UTC (permalink / raw)
  To: The development of GRUB 2

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.

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.

Thanks,
Andre



^ permalink raw reply	[flat|nested] 25+ messages in thread
* Re:  GRUB2 Build on Mac OS X
@ 2005-12-08 22:01 andre-smith
  2005-12-08 23:06 ` Andrei Warkentin
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: andre-smith @ 2005-12-08 22:01 UTC (permalink / raw)
  To: The development of GRUB 2

The Mac OS X GCC compiler will not build GRUB2, due static linking at address 0x2000; this error can be confirmed during the configure process. If I could build GRUB2 using the Mac OS X GCC, I would be able to build GRUB2 images from Mac OS X.

The binary I attempted the build using the cross compiler tool chain powerpc-elf, would have executed on PowerPC Linux, but I would not build due to the nested function support being disabled in the Apple GCC.

Since the GRUB2 tools built using a Linux GCC compiler will suffice at the moment, I can see why the team is not overly concerned with this issue. If GRUB2 is going to be portable(Mac OS X), then some changes will be needed to accomplish this goal.

If stack execution support is disabled in future releases of other operating systems, it will become an issue of nested functions implemented with stack execution, and less of an Apple GCC compiler issue.

I do agree that more arguments will be needed on function calls if nested functions are not going to be used, if the list is willing to accept patches to address this issue.

As far as the GRUB2 tools, binaries executed on the PowerPC platform only need to be pure ELF. I am not sure if creating Mach-O boot binaries will yield any benefits for bringing up a kernel. If GRUB2 is to be used on the Mac OS X operating system, the tools need to be Mach-O based.

Andre

> -----Original Message-----
> From: Andrei Warkentin [mailto:andrey.warkentin@gmail.com]
> Sent: Thursday, December 8, 2005 08:10 PM
> To: 'The development of GRUB 2'
> Subject: Re: GRUB2 Build on Mac OS X
>
> I understand (still had my mind on GRUB 1 :)) - then looks like two
> GCC installations will be
> required to construct GRUB2 on OS X - one to generate OS X-hosted
> GRUB utilities (which will
> be Mach-O files), and one to generate ELF files  that will be used in  
> the booting process.
>
> On Dec 8, 2005, at 2:00 PM, Marco Gerards wrote:
>
> > Andrei Warkentin <andrey.warkentin@gmail.com> writes:
> >
> > Hi Andrei,
> >
> >> There is another issue with GRUB2 on OS X which I am not sure has
> >> been brought up yet.
> >> Right now, AFAIK (but I haven't tested it), GRUB2 (the part that runs
> >> from OpenFrimware) can be built
> >> with a bootstrap powerpc-elf-targetted GCC hosted on OS X. However,
> >> the local GRUB2 binary (one that can run
> >> from OS X and perform installation and some such) needs to be
> >> compiled with the OS X compiler. Why? OS X doesn't use ELF -
> >> it uses Mach-O. If you want to be able to build GRUB2 in OS X with
> >> purely the OS X GCC, then the build procedure must take into account
> >> the Mach-O
> >> output format. AFAIK, new OpenFirmware versions (3.x) can boot Mach-O
> >> binaries but I haven't had a chance to experiment with this yet.
> >
> > You mean the utilities like grub-setup, grub-mkimage, grub-emu, etc?
> > They should be able to run on macos, right?  Of perhaps I am missing
> > your point.
> >
> > If those utilities can be build in a better way so nothing breaks and
> > it will work on macos, I am quite interested in hearing how to solve
> > that.
> >
> > Mach-O binaries for booting is a different subject.  We rely on ELF
> > files, grub-mkimage even creates ELF files and uses ELF load
> > segments.  Without it GRUB just won't work, unless grub-mkimage is
> > changed intensively.  So it seems easier just to use ELFs in any case.
> >
> > --
> > Marco
> >
> >
> >
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > http://lists.gnu.org/mailman/listinfo/grub-devel
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>





^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2005-12-10 18:53 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-08  6:10 GRUB2 Build on Mac OS X Andre Smith
2005-12-08 12:26 ` Marco Gerards
2005-12-08 16:27   ` Peter Jones
2005-12-08 18:25     ` Yoshinori K. Okuji
2005-12-08 23:40       ` Peter Jones
2005-12-10  0:18         ` Yoshinori K. Okuji
2005-12-10 14:32           ` Marco Gerards
2005-12-08 18:45     ` Marco Gerards
2005-12-08 19:10     ` Andrei Warkentin
2005-12-08 20:00       ` Marco Gerards
2005-12-08 20:10         ` Andrei Warkentin
2005-12-08 20:14           ` Marco Gerards
2005-12-08 20:51             ` Andrei Warkentin
2005-12-09 22:49     ` Hollis Blanchard
2005-12-09 23:07       ` Peter Jones
2005-12-09 23:32         ` Marco Gerards
2005-12-10  0:23           ` Yoshinori K. Okuji
2005-12-10 18:52             ` Peter Jones
2005-12-09 23:26       ` Marco Gerards
2005-12-08 15:09 ` Andrei Warkentin
  -- strict thread matches above, loose matches on Subject: below --
2005-12-08 22:01 andre-smith
2005-12-08 23:06 ` Andrei Warkentin
2005-12-09 21:34   ` Marco Gerards
2005-12-08 23:18 ` Andrei Warkentin
2005-12-09 21:40 ` Marco Gerards

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.