grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] to make grub2 compile on NetBSD


From: walt
Subject: Re: [PATCH] to make grub2 compile on NetBSD
Date: Mon, 11 Feb 2008 14:44:18 -0800
User-agent: Thunderbird 3.0a1pre (X11/2008021105)


On Mon, 2008-02-04 at 16:56 +0100, Marco Gerards wrote:
walt <address@hidden> writes:

> NetBSD's gcc wants libgcc and libc to define __enable_execute_stack,
> but this is useless for a free-standing executable like grub.  Define
> a dummy function in lieu of libgcc to supply __enable_execute_stack.

...  If this is for NetBSD only,
shouldn't you add a #ifdef instead of a comment?

Third try:

2008-??-??  walt <address@hidden>

        Make NetBSD's gcc happy.  Based on pkgsrc/wip/grub2 patches.

        * include/grub/mm.h
        [__NetBSD__] (__enable_execute_stack): New function prototype.
        * kern/mm.c
        [__NetBSD__] (__enable_execute_stack): New function.



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   4 Feb 2008 20:05:36 -0000
@@ -34,6 +34,11 @@
 void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size);
 void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size);
 +#ifdef __NetBSD__
+/* Dummy symbol to make gcc happy. */
+void EXPORT_FUNC(__enable_execute_stack) (void);
+#endif
+
 /* For debugging.  */
 #if defined(MM_DEBUG) && !defined(GRUB_UTIL)
 /* Set this variable to 1 when you want to trace all memory function
calls.  */
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   4 Feb 2008 20:05:36 -0000
@@ -66,6 +66,14 @@
 #include <grub/disk.h>
 #include <grub/dl.h>
 +#ifdef __NetBSD__
+/* Dummy symbol to make gcc happy. */
+void
+__enable_execute_stack (void)
+{
+}
+#endif
+
 #ifdef MM_DEBUG
 # undef grub_malloc
 # undef grub_realloc





reply via email to

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