monte-language / typhon

A virtual machine for Monte.
Other
67 stars 10 forks source link

Translate with Clang #176

Open MostAwesomeDude opened 7 years ago

MostAwesomeDude commented 7 years ago

Somebody should figure this out at some point.

washort commented 7 years ago

typhonVm.override { stdenv = clangStdenv; }

washort commented 7 years ago

Initial tests unpromising.

[platform:Error] Traceback (most recent call last):
[platform:Error]   File "/tmp/nix-build-typhon-vm.drv-0/typhon/rpython/translator/c/gcc/trackgcroot.py", line 2087, in <module> 
[platform:Error]     tracker.process(f, g, filename=fn)
[platform:Error]   File "/tmp/nix-build-typhon-vm.drv-0/typhon/rpython/translator/c/gcc/trackgcroot.py", line 1978, in process
[platform:Error]     for in_function, lines in parser.find_functions(iterlines):
[platform:Error]   File "/tmp/nix-build-typhon-vm.drv-0/typhon/rpython/translator/c/gcc/trackgcroot.py", line 1528, in find_functions
[platform:Error]     "missed the end of the previous function")
[platform:Error] AssertionError: missed the end of the previous function
[platform:Error] make: *** [Makefile:253: testing_1.gcmap] Error 1
manueljacob commented 7 years ago

The asmgcc gcrootfinder, which was the default until recently, doesn't work with Clang. You need to pass --gcrootfinder=shadowstack as an RPython option. RPython options are passed in here between -mrpython and main.py: https://github.com/monte-language/typhon/blob/9dffc61cccfc1a114d58615f65f696bb69075f32/nix-support/vm.nix#L46