grub-devel
[Top][All Lists]
Advanced

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

[PATCH]: Fix fs modules on sparc64 build with newer gcc


From: David Miller
Subject: [PATCH]: Fix fs modules on sparc64 build with newer gcc
Date: Sat, 11 Apr 2009 01:27:31 -0700 (PDT)

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  <address@hidden>

        * 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 <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
+
 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





reply via email to

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