Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LsYZ2-0003PT-2s for mharc-grub-devel@gnu.org; Sat, 11 Apr 2009 04:27:48 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LsYZ0-0003Nw-09 for grub-devel@gnu.org; Sat, 11 Apr 2009 04:27:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LsYYz-0003Mr-1P for grub-devel@gnu.org; Sat, 11 Apr 2009 04:27:45 -0400 Received: from [199.232.76.173] (port=34542 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsYYy-0003Mc-PS for grub-devel@gnu.org; Sat, 11 Apr 2009 04:27:44 -0400 Received: from [74.93.104.97] (port=40431 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LsYYy-0003JS-9m for grub-devel@gnu.org; Sat, 11 Apr 2009 04:27:44 -0400 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id 203C635C12A for ; Sat, 11 Apr 2009 01:27:32 -0700 (PDT) Date: Sat, 11 Apr 2009 01:27:31 -0700 (PDT) Message-Id: <20090411.012731.101657495.davem@davemloft.net> To: grub-devel@gnu.org From: David Miller X-Mailer: Mew version 6.2.51 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH]: Fix fs modules on sparc64 build with newer gcc 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, 11 Apr 2009 08:27:46 -0000 Newer versions of gcc emit references to libgcc internal functions __bswapsi2 and __bswapdi2 when building ufs and some other filesystem modules on sparc64. Unfortunately older versions of gcc lack these symbols in libgcc so we can't export them universally, we have to check for it using configure link tests. I commited this under the "trust dave with sparc stuff" rule. Let me know if it that wasn't appropriate in this case :-) I also rebuild configure when commiting these changes. Thanks. 2009-04-11 David S. Miller * conf/sparc64-ieee1275.rmk (kernel_img_LDFLAGS): Link with static libgcc. * configure.ac: Check for __bswapsi2 and __bswapdi2 presence. * include/grub/sparc64/libgcc.h (__bswapsi2): Export libgcc function, if present. (__bswapdi2): Likewise. --- conf/sparc64-ieee1275.rmk | 2 +- configure.ac | 2 +- include/grub/sparc64/libgcc.h | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 1658a66..f1fdb5b 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -81,7 +81,7 @@ kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ kernel_elf_HEADERS = grub/sparc64/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc +kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc # Modules. #_linux.mod linux.mod diff --git a/configure.ac b/configure.ac index 134e0a3..69f9783 100644 --- a/configure.ac +++ b/configure.ac @@ -200,7 +200,7 @@ if test "$target_cpu"-"$platform" = i386-pc; then fi # Check for functions. -AC_CHECK_FUNCS(posix_memalign memalign asprintf) +AC_CHECK_FUNCS(posix_memalign memalign asprintf __bswapsi2 __bswapdi2) # # Check for target programs. diff --git a/include/grub/sparc64/libgcc.h b/include/grub/sparc64/libgcc.h index e30c717..4a6b619 100644 --- a/include/grub/sparc64/libgcc.h +++ b/include/grub/sparc64/libgcc.h @@ -16,4 +16,16 @@ * along with GRUB. If not, see . */ +#include + void EXPORT_FUNC (memset) (void); + +#ifdef HAVE___BSWAPSI2 +typedef int SItype __attribute__ ((mode (SI))); +SItype EXPORT_FUNC (__bswapsi2) (SItype); +#endif + +#ifdef HAVE___BSWAPDI2 +typedef int DItype __attribute__ ((mode (DI))); +DItype EXPORT_FUNC (__bswapdi2) (DItype); +#endif -- 1.6.2.1.222.g570cc