[Liboil-commit] 2 commits - examples/orc orc/Makefile.am orc/orc.c orc/orcprogram-powerpc.c orc/orcprogram-unknown-os.c orc/orcprogram-x86.c orc/orcprogram.h orc/orcrules-mmx.c orc/orcrules-sse.c orc/orcrules-x86.c orc/x86.c

David Schleef ds at kemper.freedesktop.org
Thu May 29 13:55:39 PDT 2008


 examples/orc/jit.c          |    1 
 examples/orc/simple.c       |    1 
 orc/Makefile.am             |   13 +++++++++
 orc/orc.c                   |    2 -
 orc/orcprogram-powerpc.c    |    1 
 orc/orcprogram-unknown-os.c |   58 ++++++++++++++++++++++++++++++++++++++++++++
 orc/orcprogram-x86.c        |    1 
 orc/orcprogram.h            |    1 
 orc/orcrules-mmx.c          |    1 
 orc/orcrules-sse.c          |    1 
 orc/orcrules-x86.c          |    1 
 orc/x86.c                   |    1 
 12 files changed, 72 insertions(+), 10 deletions(-)

New commits:
commit 3f2f4de734538c39d41989c1e203d0d78e4da0ba
Author: David Schleef <ds at ginger.bigkitten.com>
Date:   Thu May 29 13:55:02 2008 -0700

    [orc] Fixes for compiling for windows

diff --git a/examples/orc/jit.c b/examples/orc/jit.c
index cab412c..9f40a73 100644
--- a/examples/orc/jit.c
+++ b/examples/orc/jit.c
@@ -1,7 +1,6 @@
 
 #include "config.h"
 
-#include <glib.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/examples/orc/simple.c b/examples/orc/simple.c
index 4cc1e84..ef75e86 100644
--- a/examples/orc/simple.c
+++ b/examples/orc/simple.c
@@ -1,7 +1,6 @@
 
 #include "config.h"
 
-#include <glib.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
commit ab5b03acfb40d446e4934e49a0f38bb02137468d
Author: David Schleef <ds at ginger.bigkitten.com>
Date:   Thu May 29 13:49:04 2008 -0700

    [orc] Fixes for compiling for windows

diff --git a/orc/Makefile.am b/orc/Makefile.am
index bb0d56e..b46eaac 100644
--- a/orc/Makefile.am
+++ b/orc/Makefile.am
@@ -5,6 +5,11 @@ lib_LTLIBRARIES = liborc- at LIBOIL_MAJORMINOR@.la
 
 liborc_ at LIBOIL_MAJORMINOR@_la_LIBS = $(LIBOIL_LIBS) $(GLIB_LIBS)
 liborc_ at LIBOIL_MAJORMINOR@_la_CFLAGS = $(LIBOIL_CFLAGS) $(GLIB_CFLAGS)
+liborc_ at LIBOIL_MAJORMINOR@_la_LDFLAGS = \
+	-no-undefined \
+	-version-info $(LIBOIL_LIBVERSION) \
+	-export-symbols-regex '^orc_'
+
 
 liborc_ at LIBOIL_MAJORMINOR@_la_SOURCES = \
 	orc.c \
@@ -17,12 +22,18 @@ liborc_ at LIBOIL_MAJORMINOR@_la_SOURCES = \
 	orcprogram-powerpc.c \
 	orcprogram.h \
 	orcopcodes.c \
-	orcprogram-linux.c \
 	orcrules-mmx.c \
 	orcrules-x86.c \
 	orcrules-sse.c \
 	x86.c
 
+if HAVE_OS_LINUX
+liborc_ at LIBOIL_MAJORMINOR@_la_SOURCES += orcprogram-linux.c
+else
+liborc_ at LIBOIL_MAJORMINOR@_la_SOURCES += orcprogram-unknown-os.c
+endif
+
+
 pkginclude_HEADERS = \
 	orc.h \
 	orcprogram.h \
diff --git a/orc/orc.c b/orc/orc.c
index 6094adb..27b4d35 100644
--- a/orc/orc.c
+++ b/orc/orc.c
@@ -12,7 +12,7 @@
 void
 orc_init (void)
 {
-  oil_init ();
+  //oil_init ();
   orc_opcode_init();
   orc_x86_init();
   orc_powerpc_init();
diff --git a/orc/orcprogram-powerpc.c b/orc/orcprogram-powerpc.c
index 543b95b..131f594 100644
--- a/orc/orcprogram-powerpc.c
+++ b/orc/orcprogram-powerpc.c
@@ -7,7 +7,6 @@
 
 #include <unistd.h>
 #include <sys/types.h>
-#include <sys/mman.h>
 
 #include <orc/orcprogram.h>
 
diff --git a/orc/orcprogram-unknown-os.c b/orc/orcprogram-unknown-os.c
new file mode 100644
index 0000000..130fc34
--- /dev/null
+++ b/orc/orcprogram-unknown-os.c
@@ -0,0 +1,58 @@
+
+#include "config.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <unistd.h>
+#include <sys/types.h>
+#if 0
+#include <sys/mman.h>
+#endif
+
+#include <orc/orcprogram.h>
+
+#define SIZE 65536
+
+
+void
+orc_program_allocate_codemem (OrcProgram *program)
+{
+#if 0
+  char filename[32] = "/tmp/orcexecXXXXXX";
+  int fd;
+
+  fd = mkstemp (filename);
+  if (fd == -1) {
+    /* FIXME oh crap */
+    printf("failed to create temp file\n");
+    program->error = TRUE;
+    return;
+  }
+  unlink (filename);
+
+  ftruncate (fd, SIZE);
+
+  program->code = mmap (NULL, SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+  if (program->code == MAP_FAILED) {
+    /* FIXME oh crap */
+    printf("failed to create write map\n");
+    program->error = TRUE;
+    return;
+  }
+  program->code_exec = mmap (NULL, SIZE, PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0);
+  if (program->code_exec == MAP_FAILED) {
+    /* FIXME oh crap */
+    printf("failed to create exec map\n");
+    program->error = TRUE;
+    return;
+  }
+
+  close (fd);
+
+  program->code_size = SIZE;
+  program->codeptr = program->code;
+#endif
+}
+
diff --git a/orc/orcprogram-x86.c b/orc/orcprogram-x86.c
index ca70bb2..7308b7b 100644
--- a/orc/orcprogram-x86.c
+++ b/orc/orcprogram-x86.c
@@ -7,7 +7,6 @@
 
 #include <unistd.h>
 #include <sys/types.h>
-#include <sys/mman.h>
 
 #include <orc/orcprogram.h>
 #include <orc/x86.h>
diff --git a/orc/orcprogram.h b/orc/orcprogram.h
index 3281f0e..2dbacf4 100644
--- a/orc/orcprogram.h
+++ b/orc/orcprogram.h
@@ -3,6 +3,7 @@
 #define _ORC_PROGRAM_H_
 
 //#include <glib.h>
+#include <liboil/liboil-stdint.h>
 
 typedef struct _OrcType OrcType;
 typedef struct _OrcExecutor OrcExecutor;
diff --git a/orc/orcrules-mmx.c b/orc/orcrules-mmx.c
index 23248de..7ecadeb 100644
--- a/orc/orcrules-mmx.c
+++ b/orc/orcrules-mmx.c
@@ -7,7 +7,6 @@
 
 #include <unistd.h>
 #include <sys/types.h>
-#include <sys/mman.h>
 
 #include <orc/orcprogram.h>
 #include <orc/x86.h>
diff --git a/orc/orcrules-sse.c b/orc/orcrules-sse.c
index 9f559e0..155ac5f 100644
--- a/orc/orcrules-sse.c
+++ b/orc/orcrules-sse.c
@@ -7,7 +7,6 @@
 
 #include <unistd.h>
 #include <sys/types.h>
-#include <sys/mman.h>
 
 #include <orc/orcprogram.h>
 #include <orc/x86.h>
diff --git a/orc/orcrules-x86.c b/orc/orcrules-x86.c
index 4becb48..e2fbd73 100644
--- a/orc/orcrules-x86.c
+++ b/orc/orcrules-x86.c
@@ -7,7 +7,6 @@
 
 #include <unistd.h>
 #include <sys/types.h>
-#include <sys/mman.h>
 
 #include <orc/orcprogram.h>
 #include <orc/x86.h>
diff --git a/orc/x86.c b/orc/x86.c
index 55de4b3..aaf09c1 100644
--- a/orc/x86.c
+++ b/orc/x86.c
@@ -7,7 +7,6 @@
 
 #include <unistd.h>
 #include <sys/types.h>
-#include <sys/mman.h>
 
 #include <orc/orcprogram.h>
 #include <orc/x86.h>


More information about the Liboil-commit mailing list