From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Htm83-0007B2-Bv for mharc-grub-devel@gnu.org; Thu, 31 May 2007 10:59:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Htm81-00079Y-94 for grub-devel@gnu.org; Thu, 31 May 2007 10:59:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Htm80-00078g-KT for grub-devel@gnu.org; Thu, 31 May 2007 10:59:52 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Htm80-00078a-6h for grub-devel@gnu.org; Thu, 31 May 2007 10:59:52 -0400 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 1Htm7z-0000Pl-GM for grub-devel@gnu.org; Thu, 31 May 2007 10:59:51 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Htm7L-0004Er-J2 for grub-devel@gnu.org; Thu, 31 May 2007 16:59:14 +0200 Received: from cable-87-78-192-133.netcologne.de ([87.78.192.133]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 May 2007 16:59:11 +0200 Received: from patrick by cable-87-78-192-133.netcologne.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 May 2007 16:59:11 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: grub-devel@gnu.org From: Patrick Georgi Date: Thu, 31 May 2007 16:59:49 +0200 Message-ID: References: <464F1811.7060507@georgi-clan.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060006070702070408050305" X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cable-87-78-192-133.netcologne.de User-Agent: Thunderbird 2.0b2 (X11/20070411) In-Reply-To: <464F1811.7060507@georgi-clan.de> Sender: news X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) Subject: Re: [PATCH] make grub2 compile with libc-less crosscompilers 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: Thu, 31 May 2007 14:59:53 -0000 This is a multi-part message in MIME format. --------------060006070702070408050305 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Hi, any more comments or questions on this patch, so I can improve it if necessary? Thanks, Patrick Georgi --------------060006070702070408050305 Content-Type: text/plain; name*0="patch-20070519-1-grub2-configure-script-on-libc-less-cross-compi"; name*1="ler" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="patch-20070519-1-grub2-configure-script-on-libc-less-cross-c"; filename*1="ompiler" Index: aclocal.m4 =================================================================== RCS file: /sources/grub/grub2/aclocal.m4,v retrieving revision 1.6 diff -u -r1.6 aclocal.m4 --- aclocal.m4 3 Feb 2007 11:36:13 -0000 1.6 +++ aclocal.m4 19 May 2007 15:07:33 -0000 @@ -188,10 +188,20 @@ AC_MSG_RESULT([$grub_cv_i386_asm_absolute_without_asterisk])]) +dnl Build wrapped code with different cflags, restore cflags at the end +dnl Written by Patrick Georgi +dnl grub_WRAP_FOR_CFLAGS([CFLAGS],[actual code]) +AC_DEFUN(grub_WRAP_FOR_CFLAGS, +[save_CFLAGS=$CFLAGS +CFLAGS="$1" +$2 +CFLAGS=$save_CFLAGS]) + dnl Check what symbol is defined as a start symbol. dnl Written by Yoshinori K. Okuji. AC_DEFUN(grub_CHECK_START_SYMBOL, [AC_REQUIRE([AC_PROG_CC]) +grub_WRAP_FOR_CFLAGS([-nostdlib -fno-builtin],[ AC_MSG_CHECKING([if start is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_start_symbol, [AC_TRY_LINK([], [asm ("incl start")], @@ -215,14 +225,18 @@ elif test "x$grub_cv_check_uscore_start_symbol" = xyes; then AC_DEFINE([START_SYMBOL], [_start]) else - AC_MSG_ERROR([neither start nor _start is defined]) + dnl assume some default in case none exists (eg. libc-less xcompiler) + dnl the code provides both of them + AC_DEFINE([START_SYMBOL], [_start]) fi ]) +]) dnl Check what symbol is defined as a bss start symbol. dnl Written by Michael Hohmoth and Yoshinori K. Okuji. AC_DEFUN(grub_CHECK_BSS_START_SYMBOL, [AC_REQUIRE([AC_PROG_CC]) +grub_WRAP_FOR_CFLAGS([-nostdlib -fno-builtin],[ AC_MSG_CHECKING([if __bss_start is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_uscore_uscore_bss_start_symbol, [AC_TRY_LINK([], [asm ("incl __bss_start")], @@ -259,11 +273,13 @@ AC_MSG_ERROR([none of __bss_start, edata or _edata is defined]) fi ]) +]) dnl Check what symbol is defined as an end symbol. dnl Written by Yoshinori K. Okuji. AC_DEFUN(grub_CHECK_END_SYMBOL, [AC_REQUIRE([AC_PROG_CC]) +grub_WRAP_FOR_CFLAGS([-nostdlib -fno-builtin],[ AC_MSG_CHECKING([if end is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_end_symbol, [AC_TRY_LINK([], [asm ("incl end")], @@ -290,6 +306,7 @@ AC_MSG_ERROR([neither end nor _end is defined]) fi ]) +]) dnl Check if the C compiler has a bug while using nested functions when dnl mregparm is used on the i386. Some gcc versions do not pass the third --------------060006070702070408050305--