|
Message
From: ja2morri@c... (James Morrison)
Date: Sat, 1 Nov 2003 15:35:34 -0500 (EST)
Subject: [openrisc] Cross toolchain on sparc.
Hi,
I was able to setup a GNU cross toolchain for or32 on my sparc thanks
the the instructions on the openrisc site. However, to get the simulator
to link and run I needed the following changes. If you apply this
patch remember to run automake, autoheader and autoconf.
Jim
Index: Makefile.am
===================================================================
RCS file: /home/oc/cvs/or1k/or1ksim/Makefile.am,v
retrieving revision 1.15
diff -u -r1.15 Makefile.am
--- Makefile.am 27 Oct 2002 21:19:15 -0000 1.15
+++ Makefile.am 1 Nov 2003 20:32:32 -0000
@@ -17,4 +17,4 @@
tick/libtick.a pm/libpm.a pic/libpic.a debug/libdebug.a \
vapi/libvapi.a cuc/libcuc.a
-sim_LDFLAGS = #-lreadline
+sim_LDFLAGS = -lm #-lreadline
Index: configure.in
===================================================================
RCS file: /home/oc/cvs/or1k/or1ksim/configure.in,v
retrieving revision 1.38
diff -u -r1.38 configure.in
--- configure.in 12 Sep 2003 10:17:42 -0000 1.38
+++ configure.in 1 Nov 2003 20:32:34 -0000
@@ -31,6 +31,7 @@
AC_PROG_CC
AC_MINIX
+AC_C_BIGENDIAN
AC_PROG_MAKE_SET
Index: cpu/common/elf.h
===================================================================
RCS file: /home/oc/cvs/or1k/or1ksim/cpu/common/elf.h,v
retrieving revision 1.2
diff -u -r1.2 elf.h
--- cpu/common/elf.h 12 Apr 2003 14:48:18 -0000 1.2
+++ cpu/common/elf.h 1 Nov 2003 20:32:34 -0000
@@ -1,15 +1,25 @@
#ifndef _LINUX_ELF_H
#define _LINUX_ELF_H
+#include "config.h"
+
+#ifdef WORDS_BIGENDIAN
+
+#define ELF_SHORT_H(ps) ps
+#define ELF_LONG_H(ps) ps
+
+#else
+
/* Load a short int from the following tables with big-endian formats */
#define ELF_SHORT_H(ps) ((((unsigned short)(ps) >> 8) & 0xff) |\
- (((unsigned short)(ps) << 8) & 0xff00))
+ (((unsigned short)(ps) << 8) & 0xff00))
/* Load a long int from the following tables with big-endian formats */
#define ELF_LONG_H(ps) ((((unsigned long)(ps) >> 24) & 0xff) |\
(((unsigned long)(ps) >> 8) & 0xff00)|\
(((unsigned long)(ps) << 8) & 0xff0000)|\
- (((unsigned long)(ps) << 24) & 0xff000000))
+ (((unsigned long)(ps) << 24) & 0xff000000))
+#endif
typedef unsigned long Elf32_Addr;
typedef unsigned short Elf32_Half;
|
 |