OpenCores

The openrisc bugtracker has been moved to: bugzilla.opencores.org. This page is read-only

Patch or1ksim to build on Mac OS X (Snow Leopard)

Back to bugtracker overview.

Information:
Type :: REQUEST
Status :: CLOSED
Assigned to :: Jeremy, Bennett

Description:
There are a few minor issues that prevent or1ksim from building on Mac OS X; the following patch should resolve them. Index: configure.ac =================================================================== --- configure.ac (revision 59) +++ configure.ac (working copy) @@ -137,6 +137,8 @@ # check for GNU readline AC_CHECK_LIB(readline, add_history) +# Not all versions of readline have rl_event_hook (e.g., Mac OS X) +AC_CHECK_DECLS(rl_event_hook, [], [], [#include ]) # yuck case "$host_os" in Index: sim-cmd.c =================================================================== --- sim-cmd.c (revision 59) +++ sim-cmd.c (working copy) @@ -837,8 +837,10 @@ /* Tell the completer that we want a crack first. */ rl_attempted_completion_function = sim_completion; +#if HAVE_DECL_RL_EVENT_HOOK /* Handle the gdb socket while waiting for input */ rl_event_hook = check_gdb_comm; +#endif } /* Attempt to complete on the contents of TEXT. START and END bound the Index: peripheral/atadevice.c =================================================================== --- peripheral/atadevice.c (revision 59) +++ peripheral/atadevice.c (working copy) @@ -30,8 +30,16 @@ #include "port.h" /* System includes */ +#ifdef __APPLE__ +#include +#define bswap_16(x) OSSwapInt16(x) +#define bswap_32(x) OSSwapInt32(x) +#define bswap_64(x) OSSwapInt64(x) +#else #include +#endif + /* Package includes */ #include "atadevice.h" #include "atadevice-cmdi.h" Index: port/strndup.c =================================================================== --- port/strndup.c (revision 59) +++ port/strndup.c (working copy) @@ -29,7 +29,8 @@ #ifndef HAVE_STRNDUP - +/* the definition of size_t is provided in stddef.h */ +#include /* Taken from glibc */ char * strndup (const char *s, size_t n)

Comments:

Bennett, Jeremy Apr 20, 2010

Patches committed to SVN tree.

Bennett, Jeremy Dec 30, 2009

Hi Mark,

Thanks for the update. The autobuild structure for Or1ksim needs reviewing (see your bug Move/remove or1ksim/downloads and or1ksim/build. There seem to be some dependencies on which version of autobuild is being used. I did the 0.3.0 work with Fedora 9, which uses autoconf 2.61, automake 1.10.1 and libtool 1.5.24.

I'll try to resolve this with the next release of Or1ksim.

Jeremy

--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com

Jarvin, Mark Dec 23, 2009
Thanks for applying the patch. The code more-or-less builds cleanly from SVN on my Macbook (10.6.2). Presently, I have to execute the following to get the build to complete:
svn co --username=${OCUSER} http://opencores.org/ocsvn/openrisc/openrisc/trunk/or1ksim
cd or1ksim
automake --add-missing
autoreconf
./configure --target=or32-elf --prefix=${OR32TOOLS}/or32-elf
sed -i.bak -e's/^ECHO=/echo=/' libtool
make all install
Bennett, Jeremy Dec 23, 2009

I've applied your patch to the Or1ksim SVN tree and also provided a patch for the Or1ksim 0.3.0 distribution on the downloads page.

Bennett, Jeremy Dec 22, 2009

Hi Mark,

Thanks for this. I'll get your patch uploaded to the website, so it's immediately available. I'll also update the Or1ksim page with information about the patch. May take a day or two.

When I do an update of Or1ksim, I'll incorporate these changes. I have no way to test on Mac OS X, so I hope you'll be able to test things when we get to that stage. I'll leave the bug open until then.

Formatting of bugs is a pain in the neck. You have to do them explicitly as HTML. Here is what you submitted for the record:

Index: configure.ac
===================================================================
--- configure.ac  (revision 59)
+++ configure.ac  (working copy)
@@ -137,6 +137,8 @@

 # check for GNU readline
 AC_CHECK_LIB(readline, add_history)
+# Not all versions of readline have rl_event_hook (e.g., Mac OS X)
+AC_CHECK_DECLS(rl_event_hook, [], [], [#include ])

 # yuck
 case "$host_os" in
Index: sim-cmd.c
===================================================================
--- sim-cmd.c (revision 59)
+++ sim-cmd.c (working copy)
@@ -837,8 +837,10 @@
   /* Tell the completer that we want a crack first. */
   rl_attempted_completion_function = sim_completion;

+#if HAVE_DECL_RL_EVENT_HOOK
   /* Handle the gdb socket while waiting for input */
   rl_event_hook = check_gdb_comm;
+#endif
 }

 /* Attempt to complete on the contents of TEXT.  START and END bound the
Index: peripheral/atadevice.c
===================================================================
--- peripheral/atadevice.c  (revision 59)
+++ peripheral/atadevice.c  (working copy)
@@ -30,8 +30,16 @@
 #include "port.h"

 /* System includes */
+#ifdef __APPLE__
+#include 

+#define bswap_16(x) OSSwapInt16(x)
+#define bswap_32(x) OSSwapInt32(x)
+#define bswap_64(x) OSSwapInt64(x)
+#else
 #include 
+#endif

+
 /* Package includes */
 #include "atadevice.h"
 #include "atadevice-cmdi.h"
Index: port/strndup.c
===================================================================
--- port/strndup.c  (revision 59)
+++ port/strndup.c  (working copy)
@@ -29,7 +29,8 @@


 #ifndef HAVE_STRNDUP
-
+/* the definition of size_t is provided in stddef.h */
+#include 
 /* Taken from glibc */
 char *
 strndup (const char *s, size_t n)

Jeremy

--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com

Jarvin, Mark Dec 21, 2009
Er... formatting didn't come through. At any rate, the patch is clean if you "View source" on the page. I've uploaded a copy to http://jarv.in/or1ksim.svn.min.patch, just in case.

Post a comment:
Login to post comments!

Back to bugtracker overview.

© copyright 1999-2012 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.