From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JIoWI-0007xz-Sr for mharc-grub-devel@gnu.org; Sat, 26 Jan 2008 12:08:43 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIoWH-0007wl-3F for grub-devel@gnu.org; Sat, 26 Jan 2008 12:08:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIoWF-0007vY-90 for grub-devel@gnu.org; Sat, 26 Jan 2008 12:08:40 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIoWE-0007vI-Ux for grub-devel@gnu.org; Sat, 26 Jan 2008 12:08:39 -0500 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JIoWE-0000Nb-Jw for grub-devel@gnu.org; Sat, 26 Jan 2008 12:08:38 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JIoWA-0006p1-Ay for grub-devel@gnu.org; Sat, 26 Jan 2008 17:08:34 +0000 Received: from adsl-69-234-204-161.dsl.irvnca.pacbell.net ([69.234.204.161]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Jan 2008 17:08:34 +0000 Received: from wa1ter by adsl-69-234-204-161.dsl.irvnca.pacbell.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Jan 2008 17:08:34 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: grub-devel@gnu.org From: walt Date: Sat, 26 Jan 2008 09:08:59 -0800 Organization: none Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: adsl-69-234-204-161.dsl.irvnca.pacbell.net User-Agent: Thunderbird 3.0a1pre (X11/2008012604) Sender: news X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Subject: Compiling grub2 on *BSD? X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2008 17:08:41 -0000 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 : 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!