1/1

|
or1ksim bug & Solaris build
by Unknown on Oct 20, 2004 |
Not available! | ||
|
I've been working on getting or1ksim to build on Solaris.
Attached is a patch file which makes this work.
There are four changes:
1) cpu/common/stats.c
This is just a bug - should affect all architectures.
The wrong loop count (DSTATS) was used to initialize the
sstats[] array, so it walked off the end.
2) cpu/common/parse.c
This relies on isblank() which is a GNU extension, not
available on SPARC. A test for it is added to the configure
script (later in this message) and a substitute function
provided if the system doesn't provide one.
3) configure.in
3a) Checks for the presence of isblank() as mentioned above
3b) Checks for sys/ethernet.h (which is where Solaris puts
its equivalent of net/ethernet.h)
3c) Removed a call to AC_SUBST(LOCAL_LDFLAGS) which is unrelated
to anything else here, but my version of autoconf objected
to it as LOCAL_LDFLAGS isn't defined in configure.in
4) peripheral/ethernet_i.h
Conditionally pulls in sys/ethernet.h and sets the
ETHER_ADDR_LEN and ETHER_HDR_LEN macros appropriately based
on that header.
This compiles (for me at least) on both Solaris 9 and
Fedora Core 2 (i.e. I don't think I've broken the Linux build).
I haven't done much testing of the code on Solaris so there
may well be more run-time bugs to fix...
regards
Adrian
-------------- next part --------------
Index: cpu/common/stats.c
===================================================================
--- cpu/common/stats.c (revision 52)
+++ cpu/common/stats.c (working copy)
@@ -124,7 +124,7 @@
{
int i;
memset(sstats, 0, sizeof(sstats));
- for (i = 0; i
-#else /* !HAVE_NET_ETHERNET_H -*/
+#elif HAVE_SYS_ETHERNET_H
+# include
+#ifndef ETHER_ADDR_LEN
+#define ETHER_ADDR_LEN ETHERADDRL
+#endif
+#ifndef ETHER_HDR_LEN
+#define ETHER_HDR_LEN sizeof(struct ether_header)
+#endif
+#else /* !HAVE_NET_ETHERNET_H && !HAVE_SYS_ETHERNET_H -*/
#include
|
|||
|
or1ksim bug & Solaris build
by Unknown on Oct 20, 2004 |
Not available! | ||
|
* Adrian Wise (adrian@adrianwise.co.uk) wrote:
I've been working on getting or1ksim to build on Solaris.
Attached is a patch file which makes this work. applied. best regards, p. |
|||
1/1

