grub-devel
[Top][All Lists]
Advanced

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

Re: Compiling grub2 on *BSD?


From: Robert Millan
Subject: Re: Compiling grub2 on *BSD?
Date: Sat, 26 Jan 2008 18:21:20 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Sat, Jan 26, 2008 at 09:08:59AM -0800, walt wrote:
> As a test of my tolerance for frustration I'm building grub2 on FreeBSD,
> DragonFlyBSD, NetBSD, and OpenBSD, and (naturally) each build fails in a
> different way, but all the problems seem related to mutations of gcc.
> 
> NetBSD:
> 
> The problem is the -nostdlib flag when linking kernel.exec.

What is the problem initially?

> Adding -lc
> and -lgcc solves part of the problem, but then libc wants crt0.o:
> 
> # nm --defined-only /usr/lib/crt0.o
> 00000018 T ___start
> 00000000 D __progname  <---- Needed by libc
> 00000000 B __ps_strings
> 00000000 T __start
> 000000f0 T _rtld_setup
> 00000000 T _start   <----- Conflicts with i386/pc/startup.S
> 00000004 C environ  <----- Needed by libc

You don't want -lc, adding that is wrong.

> OpenBSD:
> 
> OBSD is off on another planet, as usual.  They use a non-standard
> definition of memcpy in <string.h>:
> void    *memcpy(void *, const void *, size_t)
>                 __attribute__ ((__bounded__(__buffer__,1,3)))
>                 __attribute__ ((__bounded__(__buffer__,2,3)));

What's the error?

> FreeBSD:
> 
> lnxboot.S: Assembler messages:
> lnxboot.S:49: Error: `0x200+data_start - data_next(%ebx,%eax)' is not a 
> valid 16 bit base/index expression
> lnxboot.S:264: Error: `(%esi,%eax)' is not a valid 16 bit base/index 
> expression
> lnxboot.S:265: Error: `(%edi,%eax)' is not a valid 16 bit base/index 
> expression

I recall having seen this before.  Please, can you check the list archives?
I think we solved it for other files, but it might have been respawned in
lnxboot.S.

> DragonFlyBSD:
> 
> This was easy.  All I did was add -lc and -lgcc to kernel_img_LDFLAGS in
> i386-pc.mk.  I have no idea why the same trick doesn't work for NetBSD.

I'm surprised -lc works.  Maybe gcc/ld skips it.  Anyway, you should tell
us the initial error.

Thanks!

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)




reply via email to

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