All of lore.kernel.org
 help / color / mirror / Atom feed
* Mac OSX Ports
@ 2009-06-30  9:35 Yves BLUSSEAU
  2009-06-30 10:32 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Yves BLUSSEAU @ 2009-06-30  9:35 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

Hi,

i'm currently trying to ports grub2 to Mac OSX (leopard).
I can compil and build the code with XCode.
I have add the necessary functions and calls to support OSX (like 
getting block counts of a block device with ioctl calls).

The only problem is the  hook nested functions. XCode disable  nested 
functions by defaut.
So i enabled it with the gcc option -fnested-functions: all compil and 
build right but i have exceptions at runtime.
If i put nested functions outside  (putting also inner variables 
outside) i fix the problem and all work well.

So do you know if it exists a gcc option or a linker option to fix this 
nested functions problem ?

Also where or at who  i can sent my OSX patchs for incorporating into 
the main trunk ?

Thanks in advance,
Yves Blusseau

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3313 bytes --]

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

* Re: Mac OSX Ports
  2009-06-30  9:35 Mac OSX Ports Yves BLUSSEAU
@ 2009-06-30 10:32 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-30 10:32 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: Bean

Hello. I'm happy that my effort to make grub2 compile with Apple's CC
paid off. I personally don't care much about whether it compiles under
OSX but the idea was to attract new developpers by doing so. If you
came it means the effort paid off

On Tue, Jun 30, 2009 at 11:35 AM, Yves BLUSSEAU<cl7m42e02@sneakemail.com> wrote:
> Hi,
>
> i'm currently trying to ports grub2 to Mac OSX (leopard).
> I can compil and build the code with XCode.
> I have add the necessary functions and calls to support OSX (like getting
> block counts of a block device with ioctl calls).
>
I don't see why do you need XCode. You can compile grub2 with Apple's
cc in console with ./configure && make. It's better then using
xcodebuild because of maintainaibility. Current build system is
already a hell because you have to add same file to multiple lists
sometimes. Robert Milan is working on it. But especially don't add a
new location which must stay at sync. In short I'm opposed to using
XCode building system unless you make it a wrapper to current one,
otherwise it's simply unmaintainable
> The only problem is the  hook nested functions. XCode disable  nested
> functions by defaut.
> So i enabled it with the gcc option -fnested-functions: all compil and build
> right but i have exceptions at runtime.
> If i put nested functions outside  (putting also inner variables outside) i
> fix the problem and all work well.
>
> So do you know if it exists a gcc option or a linker option to fix this
> nested functions problem ?
>
The problem is the stack protection and trampolines.
http://grub.enbug.org/NestedFunctions
I personally think stack protection is a junk security for placebo
effect and to be sold out. It's pity grub can't work on such systems
even if this "security engineering" is braindeath. Just moving
functions outside isn't a good approach IMO. You need to add a way to
pass parameters to hooks. It was already discussed on this list how to
do it but nobody did.
Alternatively you can disable stack protection (-fno-stack-protector
or -fstack-protector may help or you  can disable it through sysctl,
idr how exactly)
This issue doesn't affect the ability to use grub - it compiles fine
and grub-mkimage generates a correct executable which you can use. But
it does affect the ability of developping since you can't use
grub-emu. But it's not a big deal of disabling stack protection
through sysctl for developpement
> Also where or at who  i can sent my OSX patchs for incorporating into the
> main trunk ?
>
Send it here. We'll review it. If they're copyright-significant we'll
need a copyright assignment from you. You can also contact me through
jabber (this email as id) or IRC (at freenode.net#grub) if you want a
small summary of what needs to be done.
> Thanks in advance,
> Yves Blusseau
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git



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

end of thread, other threads:[~2009-06-30 10:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-30  9:35 Mac OSX Ports Yves BLUSSEAU
2009-06-30 10:32 ` Vladimir 'phcoder' Serbinenko

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.