Git Product home page Git Product logo

Comments (5)

luhis avatar luhis commented on August 25, 2024

I see that this issue is still open. Where would you suggest I go reading to get my head around this issue?

from ilpack.

vermorel avatar vermorel commented on August 25, 2024

@luhis Thanks a lot for your feedback. You have the SandboxSubject.csproj in the solution that let you test a target of your choice, for example an executable. Don't hesitate to submit if PR if you can. We don't have resources for this project right now, but any help is highly appreciated.

from ilpack.

jwhitehorn avatar jwhitehorn commented on August 25, 2024

This would be a very useful feature to have.

I just started taking a shot at it, and have made a little progress. Unfortunately the .entrypoint is being added to the constructor, not the actual entrypoint.

.class private auto ansi Program
	extends [System.Private.CoreLib]System.Object
{
	// Methods
	.method public specialname rtspecialname 
		instance void .ctor () cil managed 
	{
		// Method begins at RVA 0x2050
		// Code size 7 (0x7)
		.maxstack 8
		.entrypoint

		IL_0000: ldarg.0
		IL_0001: call instance void [System.Private.CoreLib]System.Object::.ctor()
		IL_0006: ret
	} // end of method Program::.ctor

	.method public static 
		void Main () cil managed 
	{
		// Method begins at RVA 0x2058
		// Code size 11 (0xb)
		.maxstack 8

		IL_0000: ldstr "Hello World!"
		IL_0005: call void [System.Console]System.Console::WriteLine(string)
		IL_000a: ret
	} // end of method Program::Main

} // end of class Program

I suspect this has something to do with @osman-turan 's comment:

"...we need to serialize entry point without serializing any type definition."

I'm afraid I'm not certain what that implies - this is a little new to me. Any clarification or elaboration would be greatly appreciated.

from ilpack.

osman-turan avatar osman-turan commented on August 25, 2024

@jwhitehorn While defining the entry point, we need a method handle. I think you use ctor's handle by mistake (or more likely you use a constant method handle that's coincidently resolved to the ctor handle at the method serializing step due to its serialization order). My initial post describes more about the problem that I described in the code comments. The most important part is:

The main reason was we need to know entry-point method handle ahead of its serialization to able to serialize type as first type in the assembly.

So we need to "reserve" a method handle for entry-point "without" actually serializing the method (otherwise .NET Core will complain). Then we should feed this reserved handle to the entry-point definition. And finally, we can serialize the entry-point method handle with the previously reserved method handle.

I hope, it's a bit more clear now 🙂

from ilpack.

NickStrupat avatar NickStrupat commented on August 25, 2024

Hi folks! Great library.

I'm trying to figure out how to set the entry point of an AssemblyBuilder instance. Is it possible with .NET Core/5+?

from ilpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.