Closed ayesaac closed 1 year ago
Use the build.cmd workflow: https://github.com/MichalStrehovsky/zerosharp/blob/master/efi-no-runtime/build.cmd
The project files are a giant hack and cause more trouble than they're worth.
build.cmd will not try to pull in Runtime.WorkstationGC.lib and you get a much better error reporting.
Alternatively, give bflat a try: https://github.com/bflattened/bflat
Am trying out bflat, much preferring this setup, cheers!
Getting
exports and import libraries are not supported with /SUBSYSTEM:EFI_APPLICATION
when attempting to invoke a method/prop on an interface. As with, say, allocation (new object()
), it's almost certainly that there's some missing code (eg an export forRhpNewFast
) I need to add, and the compiler is trying to pull it in from the runtime because it's not present, but unlike w/ allocation, I can't for the life of me figure out what I need to add.Partly the question is what I might be missing, but equally, is there any good way of telling what the compiler is actually trying to pull in? Changing the verbosity on the
dotnet publish
doesn't seem to yield any useful information.For context:
I can compile:
Presumably as the interface is just being optimized away.
But
or
Results in the compilation error.
I also get
Because those are all explicitly defined, but I'm working under the assumption those will go away if I add whatever it is it's trying to import.
Pretty sure it's down to the method invocation, as I can, for example, create an array of
IFoo
s,Unsafe.As<IFoo, IntPtr>
, and print out the pointers.Cheers!