From: walt <wa1ter@myrealbox.com>
To: grub-devel@gnu.org
Subject: Re: Compiling grub2 on *BSD?
Date: Wed, 30 Jan 2008 11:06:50 -0800 [thread overview]
Message-ID: <1201720010.27623.26.camel@k9.localnet> (raw)
In-Reply-To: <fnq94r$9fc$1@ger.gmane.org>
On Wed, 2008-01-30 at 08:38 -0800, walt wrote:
> Robert Millan wrote:
> ...
> > What happens if you define the missing symbols somewhere? Any part of
> > the GRUB kernel will do (e.g. kern/main.c). Just add them as empty
> > functions:
> >
> > void
> > __sysctl (void)
> > {
> > }
> >
> > void
> > mprotect (void)
> > {
> > }
> >
> > and check if that works.
> Anyway, your suggestion helps, but not quite enough. The c code now
> compiles and links okay into *.mod files, but now __enable_execute_stack
> shows up in several und-*.lst files...
I've been hacking the various flags for elf.mod just to get *any* module
to link properly but no luck. Here is the actual text printed by gcc
as it links elf.mod:
gcc -m32 -nostdlib -lgcc -L/usr/lib -Wl,-r,-d,-lgcc,-L/usr/lib -o
elf.mod pre-elf.o mod-elf.o
You can tell I'm desperate because I'm putting -lgcc everywhere I can
think of. Here is the symbol in libgcc.a:
_enable_execute_stack.o:
00000000 T __enable_execute_stack
And here is the symbol table from the resulting elf.mod:
# nm elf.mod
U __enable_execute_stack <======= WTF?
0000038a T grub_elf32_load
000003fe T grub_elf32_size
Okay, I found one *more* place to put libgcc:
gcc -m32 -nostdlib -lgcc -L/usr/lib -Wl,-r,-d,-lgcc,-L/usr/lib -o
elf.mod pre-elf.o mod-elf.o /usr/lib/libgcc.a
Here is the puzzling (to me) result:
# nm elf.mod
00000784 T __enable_execute_stack
U __sysctl
0000038a T grub_elf32_load
000003fe T grub_elf32_size
next prev parent reply other threads:[~2008-01-30 19:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-26 17:08 Compiling grub2 on *BSD? walt
2008-01-26 17:21 ` Robert Millan
2008-01-26 18:15 ` Bean
2008-01-28 10:14 ` Bean
2008-01-28 10:47 ` Robert Millan
2008-01-28 11:15 ` Bean
2008-01-28 12:56 ` Marco Gerards
2008-01-29 11:00 ` Bean
2008-01-26 20:11 ` walt
2008-01-27 8:56 ` Robert Millan
2008-01-29 5:30 ` jakllsch
2008-01-29 13:47 ` Robert Millan
2008-01-30 0:37 ` jakllsch
2008-01-30 8:56 ` Marco Gerards
2008-01-30 13:23 ` Robert Millan
2008-01-30 13:51 ` walt
2008-01-30 14:00 ` Robert Millan
2008-01-30 16:38 ` walt
2008-01-30 18:40 ` Robert Millan
2008-01-30 19:06 ` walt [this message]
2008-01-30 19:14 ` Robert Millan
2008-01-30 21:55 ` jakllsch
2008-01-31 11:03 ` Robert Millan
2008-02-01 21:11 ` walt
2008-02-01 21:38 ` Robert Millan
2008-02-04 15:32 ` Marco Gerards
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=1201720010.27623.26.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.