-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEfiExe.Build.props
34 lines (31 loc) · 2.63 KB
/
EfiExe.Build.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<Project>
<!--TODO: Figure out why this need to run for all projects including libraries but the constants don't impact corelib? -->
<PropertyGroup Condition="'$(Platform.StartsWith(Windows))'">
<DefineConstants>WINDOWS;$(DefineConstants)</DefineConstants>
<LinkerSubsystem>CONSOLE</LinkerSubsystem>
<EntryPointSymbol>__managed__Main</EntryPointSymbol>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform.StartsWith(Efi))'">
<DefineConstants>EFI;$(DefineConstants)</DefineConstants>
<LinkerSubsystem>EFI_APPLICATION</LinkerSubsystem>
<EntryPointSymbol>EfiMain</EntryPointSymbol>
</PropertyGroup>
<ItemGroup Condition="'$(OutputType)' == 'Exe'">
<!--TODO: Ensure $(DirectoryBuildPropsPath) is always defined and points to {FolderContainigEfiSharp.sln}\Directory.Build.props-->
<ProjectReference Include="$(DirectoryBuildPropsPath)\..\EfiSharp.CoreLib\EFISharp.CoreLib.csproj" />
<ProjectReference Include="$(DirectoryBuildPropsPath)\..\EfiSharp.Console\EfiSharp.Console.csproj" />
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="7.0.0-*" />
<!-- TODO: Move this comment -->
<!-- Ideally the linker would be disabled or modified to give the correct error output for the linker errors but I have no clue how to do that.
This is relevent since when new managed code requires new interop functions like those in StartupCodeHelpers, dotnet publish using the
ilcompiler will cause the linker to output ~50 errors unrelated to the missing interop function(s). Instead, directly calling the linker
produces errors related to the missing functions. Example: https://i.imgur.com/Hl8AIoi.png everything in red is from dotnet publish
and the white lines are from a seperate manual link.exe call.
At minimum, removing the entry argument prevents the dotnet publish linker call from functioning and cuts down the number of errors.
6/2/2021: It turns out that the first set of errors is due to Runtime.lib being included by the compiler, this is not normally a problem since all unused
functions are stripped out by default. In the event of unimplemented functions, the linker shows all examples before Runtime.lib issues are ignored.
When running the linker manually with the getlinkererrors argument, the red errors are left over from when the runtime is not stripped out and adds in libcmt.
lib and the second set of white errors tend to be the actual errors since in that linker call, these extra libaries are not included leaving only actual errors. -->
<LinkerArg Include="$(DirectoryBuildPropsPath)\..\x64\Release\EFiSharp.libc.lib" />
</ItemGroup>
</Project>