[vmkit-commits] Building VMkit: 32 bit and 64 bit - patch to build 64bits+tests

Minas Abrahamyan minas.subs at gmail.com
Wed Jul 14 01:17:46 PDT 2010


Hi,

After reading about some problems with building VMkit x86_64 in llvm-dev
list I realized that it wasn't tested too long to work in 64 bits

So I tried to build VMkit on 32 bit linux and it works fine: I mean it was
built ok, but crushes at run (SIGSEGV see net mail).

Building 64 bit version requires changes in Makefiles, as in patch I'm
supplying, and now 64bit version builds ok too. And J3 brings the same
SIGSEGV error.

Also I made some changes to tests (testAllocator, testCollector) to made
them just build, although I saw they are now not much of usefulness, but
anyway.

Please see/review attached patch file and apply it to sources, or give me
access for I do it myself.

Regards,
Minas

PS will mailserver pass attachments?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/vmkit-commits/attachments/20100714/57511a65/attachment.html>
-------------- next part --------------
diff -r tools-orig/j3/Makefile tools/j3/Makefile
37c37
< 	   Mvm.a MvmCompiler.a $(GCLIB).a CommonThread.a
---
> 	   Mvm.a MvmCompiler.a $(GCLIB).a Allocator.a CommonThread.a
diff -r tools-orig/testAllocator/Main.cpp tools/testAllocator/Main.cpp
16a17,39
> #include <sys/resource.h>
> 
> void set_stack_size16M()
> {
>     const rlim_t kStackSize = 16 * 1024 * 1024;   // min stack size = 16 MB
>     struct rlimit rl;
>     int result;
> 
>     result = getrlimit(RLIMIT_STACK, &rl);
>     if (result == 0)
>     {
>         if (rl.rlim_cur < kStackSize)
>         {
>             rl.rlim_cur = kStackSize;
>             result = setrlimit(RLIMIT_STACK, &rl);
>             if (result != 0)
>               fprintf(stderr, "setrlimit returned result = %d\n", result);
>             else
>               fprintf(stderr, "setrlimit OK\n");
>         }
>     }
> }
> 
74c97
< 	size_t n = 512*1024;
---
> 	size_t n = 512*1024; //512K 4bytes==2Mb, times3=6Mb; for x86_64:12Mb
118a142
> 	set_stack_size16M();
diff -r tools-orig/testAllocator/Makefile tools/testAllocator/Makefile
12c12
< USEDLIBS = Allocator
---
> USEDLIBS = Allocator.a
16a17
> #CXX.Flags += -I$(LEVEL)/lib/Mvm/Allocator -Wl,--stack,14680064
\ No newline at end of file
diff -r tools-orig/testCollector/Main.cpp tools/testCollector/Main.cpp
10c10
< #include "mvm/GC/GC.h"
---
> #include "MvmGC.h"
14c14
< mvm::Key<mvm::Thread>* mvm::Thread::threadKey = 0;
---
> //? mvm::Key<mvm::Thread>* mvm::Thread::threadKey = 0;
17c17
<  	printf("Destroy %p\n", me);
---
>  	printf("Destroy %p\n", (void*)me);
21c21
< 	// 	printf("Trace %p\n", me);
---
> 	// printf("Trace %p\n", (void*)me);
25c25
< 	//	printf("Marker...\n");
---
> 	// printf("Marker...\n");
29,30c29,30
<   mvm::Thread::initialise();
<   Collector::initialise(marker, 0);
---
>   //? mvm::Thread::initialise();
>   mvm::Collector::initialise(); //initialise(marker, 0);
34c34
<   Collector::destroy();
---
>   mvm::Collector::destroy();
39,43d38
< 
< 
< 
< 
< 
diff -r tools-orig/testCollector/Makefile tools/testCollector/Makefile
11,12c11,16
< TOOLNAME = CollectorTest
< USEDLIBS = Allocator GCMmap2 CommonThread
---
> TOOLNAME = testCollector
> USEDLIBS=GCMmap2.a CommonThread.a Allocator.a GCMmap2.a Mvm.a GCMmap2.a
> 
> LINK_COMPONENTS = support
diff -r tools-orig/vmjc/Makefile tools/vmjc/Makefile
29c29
< 	     Mvm.a MvmCompiler.a $(GCLIB).a CommonThread.a
---
> 	     Mvm.a MvmCompiler.a $(GCLIB).a Allocator.a CommonThread.a


More information about the vmkit-commits mailing list