All of lore.kernel.org
 help / color / mirror / Atom feed
From: walt <wa1ter@myrealbox.com>
To: grub-devel@gnu.org
Subject: Re: [PATCH] to make grub2 compile on NetBSD
Date: Mon, 04 Feb 2008 12:21:11 -0800	[thread overview]
Message-ID: <1202156471.582.11.camel@k9.localnet> (raw)
In-Reply-To: <874pco90mm.fsf@xs4all.nl>


On Mon, 2008-02-04 at 16:56 +0100, Marco Gerards wrote:
> walt <wa1ter@myrealbox.com> 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?

Second try:

	Make NetBSD's gcc happy.

	* kern/mm.c: New dummy symbol __enable_execute_stack.
	(include/grub/mm.h): Likewise.


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	other threads:[~2008-02-04 20:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-03 21:33 [PATCH] to make grub2 compile on NetBSD walt
2008-02-04 15:56 ` Marco Gerards
2008-02-04 20:21   ` walt [this message]
2008-02-04 20:55     ` Marco Gerards
2008-02-04 22:27     ` Robert Millan
2008-02-04 22:55       ` walt
2008-02-04 23:30         ` Robert Millan
2008-02-05  6:37         ` Marco Gerards
2008-02-11 22:44   ` walt
2008-02-12  7:22     ` Yoshinori K. Okuji
2008-02-12 23:56       ` walt
2008-02-13  3:55         ` Yoshinori K. Okuji

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1202156471.582.11.camel@k9.localnet \
    --to=wa1ter@myrealbox.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.