diff options
-rw-r--r-- | orc/Makefile.am | 13 | ||||
-rw-r--r-- | orc/orc.c | 2 | ||||
-rw-r--r-- | orc/orcprogram-powerpc.c | 1 | ||||
-rw-r--r-- | orc/orcprogram-unknown-os.c | 58 | ||||
-rw-r--r-- | orc/orcprogram-x86.c | 1 | ||||
-rw-r--r-- | orc/orcprogram.h | 1 | ||||
-rw-r--r-- | orc/orcrules-mmx.c | 1 | ||||
-rw-r--r-- | orc/orcrules-sse.c | 1 | ||||
-rw-r--r-- | orc/orcrules-x86.c | 1 | ||||
-rw-r--r-- | orc/x86.c | 1 |
10 files changed, 72 insertions, 8 deletions
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-@LIBOIL_MAJORMINOR@.la liborc_@LIBOIL_MAJORMINOR@_la_LIBS = $(LIBOIL_LIBS) $(GLIB_LIBS) liborc_@LIBOIL_MAJORMINOR@_la_CFLAGS = $(LIBOIL_CFLAGS) $(GLIB_CFLAGS) +liborc_@LIBOIL_MAJORMINOR@_la_LDFLAGS = \ + -no-undefined \ + -version-info $(LIBOIL_LIBVERSION) \ + -export-symbols-regex '^orc_' + liborc_@LIBOIL_MAJORMINOR@_la_SOURCES = \ orc.c \ @@ -17,12 +22,18 @@ liborc_@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_@LIBOIL_MAJORMINOR@_la_SOURCES += orcprogram-linux.c +else +liborc_@LIBOIL_MAJORMINOR@_la_SOURCES += orcprogram-unknown-os.c +endif + + pkginclude_HEADERS = \ orc.h \ orcprogram.h \ @@ -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> @@ -7,7 +7,6 @@ #include <unistd.h> #include <sys/types.h> -#include <sys/mman.h> #include <orc/orcprogram.h> #include <orc/x86.h> |