[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cinvoke-svn] r20 - in trunk/cinvoke/lib: . arch
From: |
will |
Subject: |
[cinvoke-svn] r20 - in trunk/cinvoke/lib: . arch |
Date: |
15 Jun 2006 00:14:47 -0400 |
Author: will
Date: 2006-06-15 00:14:47 -0400 (Thu, 15 Jun 2006)
New Revision: 20
Modified:
trunk/cinvoke/lib/Makefile
trunk/cinvoke/lib/arch/gcc_x86_linux.c
Log:
freebsd compile fixes
Modified: trunk/cinvoke/lib/Makefile
===================================================================
--- trunk/cinvoke/lib/Makefile 2006-06-15 03:43:35 UTC (rev 19)
+++ trunk/cinvoke/lib/Makefile 2006-06-15 04:14:47 UTC (rev 20)
@@ -5,10 +5,10 @@
clean:
rm -f *.o $(TARGET)
-cinvoke-archspec.c: arch/gcc_x86_linux.c
- cp -f arch/gcc_x86_linux.c cinvoke-archspec.c
-cinvoke-archspec.h: arch/gcc_x86_linux.h
- cp -f arch/gcc_x86_linux.h cinvoke-archspec.h
+cinvoke-archspec.c: arch/gcc_x86_unix.c
+ cp -f arch/gcc_x86_unix.c cinvoke-archspec.c
+cinvoke-archspec.h: arch/gcc_x86_unix.h
+ cp -f arch/gcc_x86_unix.h cinvoke-archspec.h
SRCS = cinvoke.c structure.c hashtable.c cinvoke-archspec.c
Modified: trunk/cinvoke/lib/arch/gcc_x86_linux.c
===================================================================
--- trunk/cinvoke/lib/arch/gcc_x86_linux.c 2006-06-15 03:43:35 UTC (rev 19)
+++ trunk/cinvoke/lib/arch/gcc_x86_linux.c 2006-06-15 04:14:47 UTC (rev 20)
@@ -42,7 +42,7 @@
ArchLibrary *library_out) {
void *dl = dlopen(path, RTLD_LAZY);
if (!dl) {
- context_set_error(context, -1, dlerror(), 0);
+ context_set_error(context, -1, (char*)dlerror(), 0);
return CINV_ERROR;
}
@@ -55,7 +55,7 @@
ArchLibrary *library, const char *name, void **entrypoint_out) {
void *sym = dlsym(library->dl, name);
if (!sym) {
- context_set_error(context, -1, dlerror(), 0);
+ context_set_error(context, -1, (char*)dlerror(), 0);
return CINV_ERROR;
}
@@ -66,7 +66,7 @@
}
cinv_status_t arch_library_delete(CInvContext *context, ArchLibrary *library) {
if (dlclose(library->dl)) {
- context_set_error(context, -1, dlerror(), 0);
+ context_set_error(context, -1, (char*)dlerror(), 0);
return CINV_ERROR;
}
@@ -78,8 +78,13 @@
char *arch_callback_stub(void *functionp, void *param,
short stacksize, cinv_callconv_t cc) {
+#if defined (__linux__)
char *ret = mmap(0, LEN, PROT_EXEC|PROT_READ|PROT_WRITE,
MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
+#else
+ char *ret = mmap(0, LEN, PROT_EXEC|PROT_READ|PROT_WRITE,
+ MAP_ANON|MAP_PRIVATE, -1, 0);
+#endif
if (ret == MAP_FAILED)
return NULL;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cinvoke-svn] r20 - in trunk/cinvoke/lib: . arch,
will <=