[llvm-commits] [vmkit] r49424 - in /vmkit/trunk: configure.ac lib/JnJVM/Makefile.am lib/JnJVM/VMCore/JavaIsolate.cpp lib/JnJVM/VMCore/JavaThread.cpp lib/Mvm/JIT.cpp lib/N3/VMCore/PNetLib.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Wed Apr 9 06:33:24 PDT 2008


Author: geoffray
Date: Wed Apr  9 08:33:23 2008
New Revision: 49424

URL: http://llvm.org/viewvc/llvm-project?rev=49424&view=rev
Log:
Compilation fixes for Darwin

Modified:
    vmkit/trunk/configure.ac
    vmkit/trunk/lib/JnJVM/Makefile.am
    vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp
    vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp
    vmkit/trunk/lib/Mvm/JIT.cpp
    vmkit/trunk/lib/N3/VMCore/PNetLib.cpp

Modified: vmkit/trunk/configure.ac
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure.ac?rev=49424&r1=49423&r2=49424&view=diff

==============================================================================
--- vmkit/trunk/configure.ac (original)
+++ vmkit/trunk/configure.ac Wed Apr  9 08:33:23 2008
@@ -113,6 +113,7 @@
 dnl **************************************************************************
 case $target_os in
   *darwin*)
+    DYLIB_EXTENSION="dylib"
     rdynamic=""
     ;;
   *linux*)
@@ -129,6 +130,7 @@
     )
     
     rdynamic="-rdynamic"
+    DYLIB_EXTENSION="so"
     AC_DEFINE([HAVE_DISASSEMBLER], [1], [Using libopcodes])
 
     ;;
@@ -141,6 +143,7 @@
 
 AC_SUBST([rdynamic])
 AC_SUBST([LLVMDYLIB])
+AC_SUBST([DYLIB_EXTENSION])
 
 dnl **************************************************************************
 dnl VVM thread type
@@ -245,10 +248,14 @@
   echo Using ${gnuclasspathinstallationprefix} as GNU CLASSPATH installation prefix;
   classpathglibj=${gnuclasspathinstallationprefix}/share/classpath/glibj.zip;
   classpathlibs=${gnuclasspathinstallationprefix}/lib/classpath/;
+  CFLAGS=$CFLAGS -I$gnuclasspathinstallationprefix/include
+  CXXFLAGS=$CXXFLAGS -I$gnuclasspathinstallationprefix/include
 else
   echo Using ${gnuclasspathlocalprefix} as GNU CLASSPATH local prefix;
   classpathglibj=${gnuclasspathlocalprefix}/lib/;
   classpathlibs=${gnuclasspathlocalprefix}/lib/;
+  CFLAGS="$CFLAGS -I$gnuclasspathlocalprefix/include"
+  CXXFLAGS="$CXXFLAGS -I$gnuclasspathlocalprefix/include"
 fi
 
 

Modified: vmkit/trunk/lib/JnJVM/Makefile.am
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Makefile.am?rev=49424&r1=49423&r2=49424&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/Makefile.am (original)
+++ vmkit/trunk/lib/JnJVM/Makefile.am Wed Apr  9 08:33:23 2008
@@ -2,7 +2,7 @@
 SUBDIRS = VMCore Classpath
 EXTRA_DIST = OpcodeNames.def
 bin_PROGRAMS = main
-lib_LTLIBRARIES = libjnjvm.la
+#lib_LTLIBRARIES = libjnjvm.la
 
 THREADDIR=../Mvm/CommonThread
 ALLOCDIR=../Mvm/Allocator
@@ -21,5 +21,5 @@
 main_LDADD = VMCore/.libs/libJnJVM.a Classpath/.libs/libClasspath.a $(LIBSUVM) @LLVMDYLIB@
 main_LDFLAGS = @rdynamic@
 
-libjnjvm.la:
-	gcc -shared VMCore/.libs/libJnJVM.so Classpath/.libs/libClasspath.so -o libjnjvm.so
+#libjnjvm.la:
+#	gcc -shared VMCore/.libs/libJnJVM.$(DYLIB_EXTENSION) Classpath/.libs/libClasspath.$(DYLIB_EXTENSION) -o libjnjvm.$(DYLIB_EXTENSION)

Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp?rev=49424&r1=49423&r2=49424&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp Wed Apr  9 08:33:23 2008
@@ -63,7 +63,7 @@
   assert(0 && "implement me");
 }
 
-extern "C" int strnstr(const char *haystack, const char *needle) {
+extern "C" int sys_strnstr(const char *haystack, const char *needle) {
   char * res = strstr(haystack, needle);
   if (res) return res - haystack;
   else return -1; 
@@ -72,10 +72,10 @@
 
 static char* findInformation(ArrayUInt8* manifest, const char* entry, uint32 len) {
   uint8* ptr = manifest->elements;
-  sint32 index = strnstr((char*)ptr, entry);
+  sint32 index = sys_strnstr((char*)ptr, entry);
   if (index != -1) {
     index += len;
-    sint32 end = strnstr((char*)&(ptr[index]), "\n");
+    sint32 end = sys_strnstr((char*)&(ptr[index]), "\n");
     if (end == -1) end = manifest->size;
     else end += index;
 

Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp?rev=49424&r1=49423&r2=49424&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Wed Apr  9 08:33:23 2008
@@ -112,5 +112,9 @@
 
 void JavaThread::returnFromNative() {
   assert(sjlj_buffers.size());
+#if defined(__MACH__)
+  longjmp((int*)sjlj_buffers.back(), 1);
+#else
   longjmp((__jmp_buf_tag*)sjlj_buffers.back(), 1);
+#endif
 }

Modified: vmkit/trunk/lib/Mvm/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/JIT.cpp?rev=49424&r1=49423&r2=49424&view=diff

==============================================================================
--- vmkit/trunk/lib/Mvm/JIT.cpp (original)
+++ vmkit/trunk/lib/Mvm/JIT.cpp Wed Apr  9 08:33:23 2008
@@ -513,7 +513,7 @@
 
   
     // Constant declaration
-  constantLongMinusOne = ConstantInt::get(Type::Int64Ty, -1);
+  constantLongMinusOne = ConstantInt::get(Type::Int64Ty, (uint64_t)-1);
   constantLongZero = ConstantInt::get(Type::Int64Ty, 0);
   constantLongOne = ConstantInt::get(Type::Int64Ty, 1);
   constantZero = ConstantInt::get(Type::Int32Ty, 0);
@@ -526,7 +526,7 @@
   constantSix = ConstantInt::get(Type::Int32Ty, 6);
   constantSeven = ConstantInt::get(Type::Int32Ty, 7);
   constantEight = ConstantInt::get(Type::Int32Ty, 8);
-  constantMinusOne = ConstantInt::get(Type::Int32Ty, -1);
+  constantMinusOne = ConstantInt::get(Type::Int32Ty, (uint64_t)-1);
   constantMinInt = ConstantInt::get(Type::Int32Ty, MinInt);
   constantMaxInt = ConstantInt::get(Type::Int32Ty, MaxInt);
   constantMinLong = ConstantInt::get(Type::Int64Ty, MinLong);

Modified: vmkit/trunk/lib/N3/VMCore/PNetLib.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/PNetLib.cpp?rev=49424&r1=49423&r2=49424&view=diff

==============================================================================
--- vmkit/trunk/lib/N3/VMCore/PNetLib.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/PNetLib.cpp Wed Apr  9 08:33:23 2008
@@ -678,6 +678,16 @@
 
 #define ASSEMBLY_VALUE(obj) ((Assembly**)obj)[3]
 
+#if !defined(__GNU__)
+void* memrchr(const void* s, int c, size_t n) {
+  unsigned char* m = (unsigned char*) s;
+  for (;;) {
+    if (!(n--)) return NULL;
+    else if (*m-- == (unsigned char)c) return (void*)(m+1);
+  }
+}
+#endif
+
 extern "C" VMObject* System_Reflection_Assembly_GetType(VMObject* obj, CLIString* str, bool onError, bool ignoreCase) {
   Assembly* ass = ASSEMBLY_VALUE(obj);
   const UTF8* utf8 = str->value;





More information about the llvm-commits mailing list