Skip to content

Commit

Permalink
[release/6.0-rc2] Create and publish missing symbols (#59259)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Jo Shields <[email protected]>
  • Loading branch information
3 people authored Sep 20, 2021
1 parent acbdb74 commit ea504b8
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 7 deletions.
15 changes: 10 additions & 5 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,16 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_compile_options(/EHsc) # set exception handling behavior
add_compile_options(/FC) # use full pathnames in diagnostics
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_options(/Oi) # enable intrinsics
add_compile_options(/GF) # enable string pooling
add_compile_options(/Zi) # enable debugging information
add_compile_options(/GL) # whole program optimization
add_link_options(/LTCG) # link-time code generation
add_compile_options(/Oi) # enable intrinsics
add_compile_options(/GF) # enable string pooling
add_compile_options(/Zi) # enable debugging information
add_compile_options(/GL) # whole program optimization
add_link_options(/LTCG) # link-time code generation
add_link_options(/DEBUG) # enable debugging information
add_link_options(/OPT:REF) # optimize: remove unreferenced functions & data
add_link_options(/OPT:ICF) # optimize: enable COMDAT folding
# the combination of /Zi compiler flag and /DEBUG /OPT:REF /OPT:ICF
# linker flags is needed to create .pdb output on release builds
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(HOST_SOLARIS 1)
Expand Down
12 changes: 10 additions & 2 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
<MonoStaticLibFileName>$(LibPrefix)$(MonoLibName)$(StaticLibExt)</MonoStaticLibFileName>
<MonoFileName Condition="'$(TargetsBrowser)' == 'true'">$(MonoStaticLibFileName)</MonoFileName>
<MonoFileName Condition="'$(MonoFileName)' == ''">$(MonoSharedLibFileName)</MonoFileName>
<MonoAotCrossFileName>mono-aot-cross$(ExeExt)</MonoAotCrossFileName>
<MonoAotCrossPdbFileName>mono-aot-cross.pdb</MonoAotCrossPdbFileName>
<CoreClrTestConfig Condition="'$(CoreClrTestConfig)' == ''">$(Configuration)</CoreClrTestConfig>
<LibrariesTestConfig Condition="'$(LibrariesTestConfig)' == ''">$(Configuration)</LibrariesTestConfig>
<CoreClrTestCoreRoot>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'tests', 'coreclr', '$(TargetOS).$(Platform).$(CoreClrTestConfig)', 'Tests', 'Core_Root'))</CoreClrTestCoreRoot>
Expand Down Expand Up @@ -672,6 +674,8 @@
<MonoAOTCMakeArgs Include="$(_MonoAOTCXXFLAGSOption)" />
<!-- thread suspend -->
<MonoAOTCMakeArgs Include="-DGC_SUSPEND=$(MonoThreadSuspend)" />
<!-- rename exe -->
<MonoAOTCMakeArgs Include="-DMONO_CROSS_COMPILE_EXECUTABLE_NAME=1" />
</ItemGroup>

<PropertyGroup>
Expand Down Expand Up @@ -745,7 +749,8 @@
<_MonoIncludeIcuFiles Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">true</_MonoIncludeIcuFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildMonoAOTCrossCompiler)' == 'true'">
<_MonoAotCrossFilePath>$(MonoObjCrossDir)out\bin\mono-sgen$(ExeExt)</_MonoAotCrossFilePath>
<_MonoAotCrossFilePath>$(MonoObjCrossDir)out\bin\$(MonoAotCrossFileName)</_MonoAotCrossFilePath>
<_MonoAotCrossPdbFilePath>$(MonoObjCrossDir)out\bin\$(MonoAotCrossPdbFileName)</_MonoAotCrossPdbFilePath>
</PropertyGroup>

<!-- Copy Mono runtime files to artifacts directory -->
Expand Down Expand Up @@ -774,7 +779,10 @@
<Destination>$(RuntimeBinDir)%(_MonoRuntimeComponentsSharedFilePath.Filename)%(_MonoRuntimeComponentsSharedFilePath.Extension)</Destination>
</_MonoRuntimeArtifacts>
<_MonoRuntimeArtifacts Include="$(_MonoAotCrossFilePath)">
<Destination>$(RuntimeBinDir)cross\$(PackageRID)\mono-aot-cross$(ExeExt)</Destination>
<Destination>$(RuntimeBinDir)cross\$(PackageRID)\$(MonoAotCrossFileName)</Destination>
</_MonoRuntimeArtifacts>
<_MonoRuntimeArtifacts Include="$(_MonoAotCrossPdbFilePath)" Condition="Exists('$(_MonoAotCrossPdbFilePath)')">
<Destination>$(RuntimeBinDir)cross\$(PackageRID)\$(MonoAotCrossPdbFileName)</Destination>
</_MonoRuntimeArtifacts>
<_MonoRuntimeArtifacts Condition="'$(MonoBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\bin\llc$(ExeExt)">
<Destination>$(RuntimeBinDir)\llc$(ExeExt)</Destination>
Expand Down
6 changes: 6 additions & 0 deletions src/mono/mono/mini/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ if(NOT DISABLE_EXECUTABLES)
set(sgen_sources "${sgen_sources};${PROJECT_BINARY_DIR}/../../NativeVersion.rc")
endif()
add_executable(mono-sgen "${sgen_sources}")
if(MONO_CROSS_COMPILE_EXECUTABLE_NAME)
set_target_properties(mono-sgen PROPERTIES OUTPUT_NAME mono-aot-cross)
endif()
target_link_libraries(mono-sgen PRIVATE monosgen-static ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS})
if(NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS AND NOT DISABLE_LINK_STATIC_COMPONENTS)
# if components are built statically, link them into runtime.
Expand All @@ -492,4 +495,7 @@ if(NOT DISABLE_EXECUTABLES)
set_property(TARGET mono-sgen APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}")
endif()
install(TARGETS mono-sgen RUNTIME)
if(HOST_WIN32)
install(FILES $<TARGET_PDB_FILE:mono-sgen> DESTINATION bin OPTIONAL)
endif()
endif()
1 change: 1 addition & 0 deletions src/tasks/AotCompilerTask/MonoAOTCompiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<_PublishFramework Include="$(TargetFrameworks)" />

<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
</ItemGroup>
</Target>
</Project>
1 change: 1 addition & 0 deletions src/tasks/ILStripTask/ILStrip.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<_PublishFramework Include="$(TargetFrameworks)" />

<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<_PublishFramework Include="$(TargetFrameworks)" />

<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\$(AssemblyName).pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
</ItemGroup>
</Target>

Expand Down
1 change: 1 addition & 0 deletions src/tasks/RuntimeConfigParser/RuntimeConfigParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<_PublishFramework Include="$(TargetFrameworks)" />

<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\*.dll" TargetPath="tasks\%(_PublishFramework.Identity)" />
<FilesToPackage Include="$(OutputPath)%(_PublishFramework.Identity)\*.pdb" TargetPath="tasks\%(_PublishFramework.Identity)" />
</ItemGroup>
</Target>

Expand Down

0 comments on commit ea504b8

Please sign in to comment.