All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: Fix fs modules on sparc64 build with newer gcc
@ 2009-04-11  8:27 David Miller
  2009-04-12  3:53 ` Pavel Roskin
  2009-05-02 14:35 ` Robert Millan
  0 siblings, 2 replies; 8+ messages in thread
From: David Miller @ 2009-04-11  8:27 UTC (permalink / raw)
  To: grub-devel


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  <davem@davemloft.net>

	* 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




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

end of thread, other threads:[~2009-05-02 14:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-11  8:27 [PATCH]: Fix fs modules on sparc64 build with newer gcc David Miller
2009-04-12  3:53 ` Pavel Roskin
2009-04-12  7:58   ` David Miller
2009-04-12 21:19     ` Pavel Roskin
2009-04-13  1:05       ` David Miller
2009-04-13  5:06         ` Pavel Roskin
2009-04-13  6:31           ` David Miller
2009-05-02 14:35 ` Robert Millan

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.