[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiling grub2 on *BSD?
From: |
Marco Gerards |
Subject: |
Re: Compiling grub2 on *BSD? |
Date: |
Mon, 04 Feb 2008 16:32:22 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
walt <address@hidden> writes:
> On Thu, 2008-01-31 at 12:03 +0100, Robert Millan wrote:
>> On Wed, Jan 30, 2008 at 03:55:59PM -0600, address@hidden wrote:
>> > On Wed, Jan 30, 2008 at 11:06:50AM -0800, walt wrote:
>> > >
>> > > You can tell I'm desperate because I'm putting -lgcc everywhere I can
>> > > think of. Here is the symbol in libgcc.a:
>> >
>> > I (like I found in pkgsrc-wip/grub2) am using a fake
>> > __enable_execute_stack(),
>>
>> Ok, we could add that dummy __enable_execute_stack() but ...
>>
>> > -lgcc isn't necessary.
>>
>> ... if we remove -lgcc, what happens if it becomes necessary for other
>> versions
>> of GCC? Or does gcc already add libgcc per demand?
>
> I got grub2 compiled on NetBSD using the fake in those pkgsrc patches.
> I regenerated the patches below against grub2 cvs. They are the same
> ideas you suggested earlier, I just didn't use them all at the same
> time:
>
> Index: include/grub/mm.h
> ===================================================================
> RCS file: /sources/grub/grub2/include/grub/mm.h,v
> retrieving revision 1.8
> diff -u -r1.8 mm.h
> --- include/grub/mm.h 21 Jul 2007 23:32:22 -0000 1.8
> +++ include/grub/mm.h 1 Feb 2008 21:04:27 -0000
> @@ -33,6 +33,7 @@
> void EXPORT_FUNC(grub_free) (void *ptr);
> void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size);
> void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size);
> +void EXPORT_FUNC(__enable_execute_stack) (void);
Is this arch specific?
> /* For debugging. */
> #if defined(MM_DEBUG) && !defined(GRUB_UTIL)
> Index: kern/mm.c
> ===================================================================
> RCS file: /sources/grub/grub2/kern/mm.c,v
> retrieving revision 1.19
> diff -u -r1.19 mm.c
> --- kern/mm.c 23 Jan 2008 14:57:40 -0000 1.19
> +++ kern/mm.c 1 Feb 2008 21:04:28 -0000
> @@ -66,6 +66,9 @@
> #include <grub/disk.h>
> #include <grub/dl.h>
>
> +void __enable_execute_stack(void);
> +void __enable_execute_stack(void) {}
> +
Is this arch specific? Please put braces on separate lines.
Won't this break on GNU/Linux? Or on other architectures? Did you
test this?
--
Marco