All of lore.kernel.org
 help / color / mirror / Atom feed
* Compiling grub2 on *BSD?
@ 2008-01-26 17:08 walt
  2008-01-26 17:21 ` Robert Millan
  0 siblings, 1 reply; 26+ messages in thread
From: walt @ 2008-01-26 17:08 UTC (permalink / raw)
  To: grub-devel

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.  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

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)));

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

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.

Anyone have any ideas for elegant ways to fix these four problems?

Thanks!




^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2008-02-04 15:30 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.