Skip to content

Commit ea504b8

Browse files
github-actions[bot]directhexJo Shields
authored
[release/6.0-rc2] Create and publish missing symbols (#59259)
* Fix symbols for Microsoft.MonoTargets.Sdk * Build and include .pdb file on Windows builds of mono-aot-cross * Only TARGET_PDB_FILE on HOST_WIN32 * Another conditional * Output directly "mono-aot-cross.exe", don't rename "mono-sgen.exe" Co-authored-by: Jo Shields <directhex@apebox.org> Co-authored-by: Jo Shields <joshield@microsoft.com>
1 parent acbdb74 commit ea504b8

7 files changed

Lines changed: 30 additions & 7 deletions

File tree

src/mono/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,16 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
245245
add_compile_options(/EHsc) # set exception handling behavior
246246
add_compile_options(/FC) # use full pathnames in diagnostics
247247
if(CMAKE_BUILD_TYPE STREQUAL "Release")
248-
add_compile_options(/Oi) # enable intrinsics
249-
add_compile_options(/GF) # enable string pooling
250-
add_compile_options(/Zi) # enable debugging information
251-
add_compile_options(/GL) # whole program optimization
252-
add_link_options(/LTCG) # link-time code generation
248+
add_compile_options(/Oi) # enable intrinsics
249+
add_compile_options(/GF) # enable string pooling
250+
add_compile_options(/Zi) # enable debugging information
251+
add_compile_options(/GL) # whole program optimization
252+
add_link_options(/LTCG) # link-time code generation
253+
add_link_options(/DEBUG) # enable debugging information
254+
add_link_options(/OPT:REF) # optimize: remove unreferenced functions & data
255+
add_link_options(/OPT:ICF) # optimize: enable COMDAT folding
256+
# the combination of /Zi compiler flag and /DEBUG /OPT:REF /OPT:ICF
257+
# linker flags is needed to create .pdb output on release builds
253258
endif()
254259
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
255260
set(HOST_SOLARIS 1)

src/mono/mono.proj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
<MonoStaticLibFileName>$(LibPrefix)$(MonoLibName)$(StaticLibExt)</MonoStaticLibFileName>
3737
<MonoFileName Condition="'$(TargetsBrowser)' == 'true'">$(MonoStaticLibFileName)</MonoFileName>
3838
<MonoFileName Condition="'$(MonoFileName)' == ''">$(MonoSharedLibFileName)</MonoFileName>
39+
<MonoAotCrossFileName>mono-aot-cross$(ExeExt)</MonoAotCrossFileName>
40+
<MonoAotCrossPdbFileName>mono-aot-cross.pdb</MonoAotCrossPdbFileName>
3941
<CoreClrTestConfig Condition="'$(CoreClrTestConfig)' == ''">$(Configuration)</CoreClrTestConfig>
4042
<LibrariesTestConfig Condition="'$(LibrariesTestConfig)' == ''">$(Configuration)</LibrariesTestConfig>
4143
<CoreClrTestCoreRoot>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'tests', 'coreclr', '$(TargetOS).$(Platform).$(CoreClrTestConfig)', 'Tests', 'Core_Root'))</CoreClrTestCoreRoot>
@@ -672,6 +674,8 @@
672674
<MonoAOTCMakeArgs Include="$(_MonoAOTCXXFLAGSOption)" />
673675
<!-- thread suspend -->
674676
<MonoAOTCMakeArgs Include="-DGC_SUSPEND=$(MonoThreadSuspend)" />
677+
<!-- rename exe -->
678+
<MonoAOTCMakeArgs Include="-DMONO_CROSS_COMPILE_EXECUTABLE_NAME=1" />
675679
</ItemGroup>
676680

677681
<PropertyGroup>
@@ -745,7 +749,8 @@
745749
<_MonoIncludeIcuFiles Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">true</_MonoIncludeIcuFiles>
746750
</PropertyGroup>
747751
<PropertyGroup Condition="'$(BuildMonoAOTCrossCompiler)' == 'true'">
748-
<_MonoAotCrossFilePath>$(MonoObjCrossDir)out\bin\mono-sgen$(ExeExt)</_MonoAotCrossFilePath>
752+
<_MonoAotCrossFilePath>$(MonoObjCrossDir)out\bin\$(MonoAotCrossFileName)</_MonoAotCrossFilePath>
753+
<_MonoAotCrossPdbFilePath>$(MonoObjCrossDir)out\bin\$(MonoAotCrossPdbFileName)</_MonoAotCrossPdbFilePath>
749754
</PropertyGroup>
750755

751756
<!-- Copy Mono runtime files to artifacts directory -->
@@ -774,7 +779,10 @@
774779
<Destination>$(RuntimeBinDir)%(_MonoRuntimeComponentsSharedFilePath.Filename)%(_MonoRuntimeComponentsSharedFilePath.Extension)</Destination>
775780
</_MonoRuntimeArtifacts>
776781
<_MonoRuntimeArtifacts Include="$(_MonoAotCrossFilePath)">
777-
<Destination>$(RuntimeBinDir)cross\$(PackageRID)\mono-aot-cross$(ExeExt)</Destination>
782+
<Destination>$(RuntimeBinDir)cross\$(PackageRID)\$(MonoAotCrossFileName)</Destination>
783+
</_MonoRuntimeArtifacts>
784+
<_MonoRuntimeArtifacts Include="$(_MonoAotCrossPdbFilePath)" Condition="Exists('$(_MonoAotCrossPdbFilePath)')">
785+
<Destination>$(RuntimeBinDir)cross\$(PackageRID)\$(MonoAotCrossPdbFileName)</Destination>
778786
</_MonoRuntimeArtifacts>
779787
<_MonoRuntimeArtifacts Condition="'$(MonoBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\bin\llc$(ExeExt)">
780788
<Destination>$(RuntimeBinDir)\llc$(ExeExt)</Destination>

src/mono/mono/mini/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ if(NOT DISABLE_EXECUTABLES)
473473
set(sgen_sources "${sgen_sources};${PROJECT_BINARY_DIR}/../../NativeVersion.rc")
474474
endif()
475475
add_executable(mono-sgen "${sgen_sources}")
476+
if(MONO_CROSS_COMPILE_EXECUTABLE_NAME)
477+
set_target_properties(mono-sgen PROPERTIES OUTPUT_NAME mono-aot-cross)
478+
endif()
476479
target_link_libraries(mono-sgen PRIVATE monosgen-static ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS})
477480
if(NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS AND NOT DISABLE_LINK_STATIC_COMPONENTS)
478481
# if components are built statically, link them into runtime.
@@ -492,4 +495,7 @@ if(NOT DISABLE_EXECUTABLES)
492495
set_property(TARGET mono-sgen APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}")
493496
endif()
494497
install(TARGETS mono-sgen RUNTIME)
498+
if(HOST_WIN32)
499+
install(FILES $<TARGET_PDB_FILE:mono-sgen> DESTINATION bin OPTIONAL)
500+
endif()
495501
endif()

src/tasks/AotCompilerTask/MonoAOTCompiler.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<_PublishFramework Include="$(TargetFrameworks)" />
3737

3838
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
39+
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
3940
</ItemGroup>
4041
</Target>
4142
</Project>

src/tasks/ILStripTask/ILStrip.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<_PublishFramework Include="$(TargetFrameworks)" />
2828

2929
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
30+
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
3031
</ItemGroup>
3132
</Target>
3233
</Project>

src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<_PublishFramework Include="$(TargetFrameworks)" />
3333

3434
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
35+
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
3536
</ItemGroup>
3637
</Target>
3738

src/tasks/RuntimeConfigParser/RuntimeConfigParser.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<_PublishFramework Include="$(TargetFrameworks)" />
3434

3535
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\*.dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
36+
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\*.pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
3637
</ItemGroup>
3738
</Target>
3839

0 commit comments

Comments
 (0)