Giter Club home page Giter Club logo

Comments (7)

JoshuaWierenga avatar JoshuaWierenga commented on July 30, 2024

I have just figured out how to build with the v6 ilc by only using dotnet publish for its access to ilc and then manually calling link.exe with link "obj\x64\Release\net5.0\win-x64\native\EfiSharp.obj" /subsystem:EFI_APPLICATION /entry:EfiMain ..\EfiSharp.Native\x64\release\EFiSharp.Native.lib.
This is to get around ilc v6 introducing its own /subsystem and /entry arguments and also adding in runtime.lib and bootstrapper.lib. It appears I was not the only one to discover this change as at roughly the same time I was trying figuring this out, dotnet/runtimelab#633 was posted.

Ideally, I would be able to use the stock runtime.lib or at least the portable version but current attempts result in quite a few unresolved externals.
cmd_YTvtYNTVFI
I have tried to work around this on the NativeAOT-Test.Corelib-RuntimeFix branch but even fixing all errors just allows the wrong entry point to be used.

from efisharp.

JoshuaWierenga avatar JoshuaWierenga commented on July 30, 2024

Attempting to join both the v6 and runtime changes does resolve the errors in the previous image but leads instead to over a hundred missing external symbols in low level functions.
cmd_mV2qMcCUcf
At least some of the ones in MathHelpers.obj appear due to no c runtime which could be solved with a freestanding one like mlibc but most appear specific to the dotnet.

from efisharp.

MichalStrehovsky avatar MichalStrehovsky commented on July 30, 2024

At least some of the ones in MathHelpers.obj appear due to no c runtime which could be solved with a freestanding one like mlibc but most appear specific to the dotnet.

Yep, this is missing C runtime (GSHandlerCheck, fltused, round, etc.), plus missing Win32 APIs (DuplicateHandle, GetCurrentThread, etc.)

Runtime.lib needs to be ported from Windows to UEFI to be usable.

(Cool project, btw! )

from efisharp.

JoshuaWierenga avatar JoshuaWierenga commented on July 30, 2024

Yep, this is missing C runtime (GSHandlerCheck, fltused, round, etc.), plus missing Win32 APIs (DuplicateHandle, GetCurrentThread, etc.)

Runtime.lib needs to be ported from Windows to UEFI to be usable.

(Cool project, btw! )

I did know about the Runtime.lib issues, I already added part of MathHelpers.cpp so I could cast float to ulong but going much further and adding functions like RhpNewArray proved a bit hard.
Weirdly, at one point I did have libcmt.lib errors so it was being used. I did check and I do not have /NODEFAULTLIB anymore so not sure why it disappeared.

from efisharp.

JoshuaWierenga avatar JoshuaWierenga commented on July 30, 2024

The updated compiler almost deals with all the errors in the first red image, all that is left is the unresolved floating point operations in MathHelpers.obj. The linker says it is the Runtime.lib version however so I worry that once I fix these errors I will get the grey error list again.
image

from efisharp.

JoshuaWierenga avatar JoshuaWierenga commented on July 30, 2024

It turns out I was mistaken and those errors were only shown because I forgot to include my version of MathHelpers.cpp. It would probably a good idea to deal with those functions at some point however as floating point support is still quite limited and even modulus is currently broken.
Also it turns out hyperv is only picky about adding file permissions to images in locations were questionable. Taking full ownership of the project folder before making EfiSharp.vhd means that hyperv will read it without first using icacls to give it access.

from efisharp.

JoshuaWierenga avatar JoshuaWierenga commented on July 30, 2024

I guess the v6 compiler uses exe now, even for efi binaries.
image
Changing its extension to efi does result in a useable image so it is fine either way.

from efisharp.

Related Issues (15)

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.