Skip to content

Commit

Permalink
Make it possible to remove DotNetRuntimeDebugHeader (#91775)
Browse files Browse the repository at this point in the history
There's popular demand to be able to remove this export, see these in the past: #79197, dotnet/runtimelab#739

Fixes #90838 by lumping it together with `DebuggerSupport`. It feels like the most natural switch. I didn't go as far as completely removing the data structures because the savings would likely be miniscule (4 kB contribution from the object file per SizeBench).
  • Loading branch information
MichalStrehovsky authored Sep 8, 2023
1 parent 9d62c3c commit 14d14db
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<CustomLinkerArg Include="-o &quot;$(NativeBinary)&quot;" Condition="'$(_targetOS)' != 'win'" />
<CustomLinkerArg Include="/OUT:&quot;$(NativeBinary)&quot;" Condition="'$(_targetOS)' == 'win'" />
<CustomLinkerArg Include="/DEF:&quot;$(ExportsFile)&quot;" Condition="'$(_targetOS)' == 'win' and $(ExportsFile) != ''" />
<CustomLinkerArg Include="/EXPORT:DotNetRuntimeDebugHeader,DATA" Condition="'$(_targetOS)' == 'win' and '$(DebuggerSupport)' != 'false'" />
<CustomLinkerArg Include="/LIBPATH:&quot;%(AdditionalNativeLibraryDirectories.Identity)&quot;" Condition="'$(_targetOS)' == 'win' and '@(AdditionalNativeLibraryDirectories->Count())' &gt; 0" />
<CustomLinkerArg Include="-exported_symbols_list &quot;$(ExportsFile)&quot;" Condition="'$(_IsApplePlatform)' == 'true' and '$(ExportsFile)' != ''" />
<CustomLinkerArg Include="-exported_symbols_list /dev/null" Condition="'$(OutputType)' == 'exe' and '$(_IsApplePlatform)' == 'true' and '$(ExportsFile)' == ''" />
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/nativeaot/Runtime/DebugHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ struct DotNetRuntimeDebugHeader
GlobalValueEntry (* volatile GlobalEntries)[GlobalEntriesArraySize] = nullptr;
};

#ifdef TARGET_WINDOWS
#pragma comment (linker, "/EXPORT:DotNetRuntimeDebugHeader,DATA")
#endif
extern "C" struct DotNetRuntimeDebugHeader DotNetRuntimeDebugHeader;
struct DotNetRuntimeDebugHeader DotNetRuntimeDebugHeader = {};

Expand Down

1 comment on commit 14d14db

@ksharperd
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a plan to backport this to .net 8 release?

Please sign in to comment.