This project is read-only.

Bartok Compiler

May 27, 2008 at 8:42 PM

Please excuse me my off-topic thread, but I haven't found a better place to ask my question. If you can suggest a better place for this I'd be thankfull.

I am trying to use the Bartok compiler from Singularity to compile MSIL code into native code. I am doing this for testing purposes only.

I made the most simple C# program, just a single class with a empty Main method.

I deleted all references from the Visual Stdio project. The application compiles and runs (obviously it doesn't do much).

I am trying to use the Bartok Compiler on the generated exe file like this:

C:\Users\Empathy\Documents\Visual Studio 2008\Projects\Bartok_Test\Bartok_Test_0\bin\Release>bartok /r:C:\Windows\assembly\GAC_MSIL\System\\System.dll /lib:C:\Windows\assembly\GAC_MSIL /out:test.exe Bartok_Test_0.exe

That is the propper location of the System MSIL assembly. Bartok dies with the following error:

warning: (ARRAY): extra bytes in MetaDataBlob(2a,50,00,01,00)
warning: Making I4 enum assumption for MetaDataTypeReference(System.Diagnostics.
warning: Making I4 enum assumption for MetaDataTypeReference(System.Runtime.Comp
warning: Making I4 enum assumption for MetaDataTypeReference(System.AttributeTar
warning: Making I4 enum assumption for MetaDataTypeReference(System.Runtime.Inte
warning: Making I4 enum assumption for MetaDataTypeReference(System.Runtime.Inte
Error: Internal uncaught System.Exception: Not implemented: 81 for named field/p

   at Bartok.MSIL.MetaDataCustomAttribute.resolveReferences(MetaDataResolver res
olver, MetaDataResolver[] resolvers) in e:\act\bartok\msil\MetaDataCustomAttribu
te.cs:line 120
   at Bartok.MSIL.MetaDataResolver.ResolveMyCustomAttributes(MetaDataResolver[]
resolvers) in e:\act\bartok\msil\MetaDataResolver.cs:line 427
   at Bartok.MSIL.MetaDataResolver.ResolveCustomAttributes(MetaDataResolver[] re
solvers) in e:\act\bartok\msil\MetaDataResolver.cs:line 416
   at Bartok.BartokClass.ConvertMsil2Ir(ArrayList fileNames, ArrayList refFileNa
mes, ArrayList overrideNames, ArrayList overrideDefNames, Boolean fDefineOverrid
e, DateTime startTime, Boolean fLoadDebugInfo, TypeData typeData) in e:\act\bart
ok\Bartok.cs:line 349
   at Bartok.BartokClass.CompileFile(TypeData typeData, ArrayList fileNames, Arr
ayList refFileNames, ArrayList overrideNames, ArrayList overrideDefNames, Boolea
n fDefineOverride, String outputName, DateTime startTime, Boolean fLoadDebugInfo
) in e:\act\bartok\Bartok.cs:line 149
   at Bartok.BartokClass.Main(String[] args) in e:\act\bartok\Bartok.cs:line 115

Any hints about what should I do would be greatly appreciated.

Thanks in advance,

Aram Hăvărneanu.
Sep 8, 2008 at 3:12 PM
Hi,$0$0$0$0this is also interesting for us. $0$0$0$0$0Is it possible to compile small .Net applicatications by ourself to x86 executables?$0$0$0$0$0And is it possible to run this little binaries outside Singularity OS - so will be there a standalone version of the Singularity-Runtime? $0$0$0$0$0Bye,$0$0$0$0$0Tobias Wassermann$0
Sep 16, 2008 at 11:59 PM
Hi empathy - the version of Bartok currently shipping with Singularity does not support some of the features used in the full .NET Framework 2.0, such as generics, and will give mysterious errors like the one above if you reference these assemblies. The version of Bartok that will be available with the Singularity RDK 2.0 has generics support and other new functionality, but compiling your own apps against the full .NET Framework is still not a supported scenario, because the Bartok shipping with Singularity contains a number of modifications specific to Singularity.
Derrick Coetzee
Microsoft Research Operating Systems Group developer        
Sep 22, 2008 at 7:30 AM
Hi Derrick!

Will Bartok be available in the future for the full .NET Framework, so we can natively compile our apps?