CosmosOS / IL2CPU

IL2CPU is a compiler for .NET IL code to compile to assembly language for direct booting.
BSD 3-Clause "New" or "Revised" License
279 stars 71 forks source link

Yasm error: undefined symbol everywhere when trying to implement some C# code #212

Open valentinbreiz opened 8 months ago

valentinbreiz commented 8 months ago

https://gist.github.com/valentinbreiz/8b099c7acd93783e90d71e644f070519

Builds fine until it goes to YASM part

Edit: After a deeper investigation this method seems to be the problem:

private static int Str_Dump( ILuaState lua )
{
    lua.L_CheckType( 1, LuaType.LUA_TFUNCTION );
    lua.SetTop( 1 );
    var bsb = new ByteStringBuilder();
    LuaWriter writeFunc = 
        delegate(byte[] bytes, int start, int length)
    {
        bsb.Append(bytes, start, length);
        return DumpStatus.OK;
    };
    if( lua.Dump( writeFunc ) != DumpStatus.OK )
        return lua.L_Error( "unable to dump given function" );
    lua.PushString( bsb.ToString() );
    return 1;
}

Specially LuaWriter writeFunc = delegate(byte[] bytes, int start, int length)

zarlo commented 8 months ago

@valentinbreiz as a work around have you tried a inline method