Skip to content

Commit

Permalink
Remove --flat from default dsymutil options (#89358)
Browse files Browse the repository at this point in the history
--flat is a diagnostic-only option and not fully supported. It
can still be specified if necessary through the DsymUtilOptions
property and NativeSymbolExt property, but it will no longer be
the default.
  • Loading branch information
agocke authored Aug 10, 2023
1 parent 3be8fa1 commit 44e63d4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,26 @@
<PropertyGroup>
<_symbolExt Condition="'$(OS)' == 'Windows_NT'">$(NativeSymbolExt)</_symbolExt>
<_symbolExt Condition="'$(OS)' != 'Windows_NT'">$(NativeBinaryExt)$(NativeSymbolExt)</_symbolExt>
</PropertyGroup>
<_symbolSourcePath>$(NativeOutputPath)$(TargetName)$(_symbolExt)</_symbolSourcePath>
<_symbolTargetPath>$(PublishDir)\$(TargetName)$(_symbolExt)</_symbolTargetPath>
<!-- If the symbol is a dsym bundle, it's a folder not a file. -->
<_symbolIsFile Condition="'$(_symbolExt)' == '.dsym'">false</_symbolIsFile>
<_symbolIsFile Condition="'$(_symbolIsFile)' == ''">true</_symbolIsFile>
</PropertyGroup>

<!-- replace native symbol file if it exists -->
<Delete Files="$(PublishDir)\$(TargetName)$(_symbolExt)" />
<Copy SourceFiles="$(NativeOutputPath)$(TargetName)$(_symbolExt)" DestinationFolder="$(PublishDir)"
Condition="Exists('$(NativeOutputPath)$(TargetName)$(_symbolExt)') and '$(CopyOutputSymbolsToPublishDirectory)' == 'true'" />
<ItemGroup>
<_symbolRecursivePath Include="$(NativeOutputPath)$(TargetName)$(_symbolExt)/**/*" />
</ItemGroup>

<!-- replace native symbol file if it exists. On Mac, the symbol path may be a folder-->
<Delete Files="$(_symbolTargetPath)" Condition="'$(_symbolIsFile)' == 'true' and Exists('$(_symbolTargetPath)')" />
<Copy SourceFiles="$(_symbolSourcePath)" DestinationFolder="$(PublishDir)"
Condition="'$(_symbolIsFile)' == 'true' and Exists('$(_symbolSourcePath)')" />

<!-- Copy folder otherwise -->
<RemoveDir Directories="$(_symbolTargetPath)" Condition="'$(_symbolIsFile)' == 'false' and Exists('$(_symbolTargetPath)')" />
<Copy SourceFiles="@(_symbolRecursivePath)" DestinationFolder="$(_symbolTargetPath)/%(RecursiveDir)"
Condition="'$(_symbolIsFile)' == 'false' and Exists('$(_symbolSourcePath)')" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ The .NET Foundation licenses this file to you under the MIT license.
<CppCompilerAndLinker Condition="'$(CppCompilerAndLinker)' == ''">clang</CppCompilerAndLinker>
<CppLinker>$(CppCompilerAndLinker)</CppLinker>
<CppLibCreator>ar</CppLibCreator>
<DsymUtilOptions Condition="'$(_IsApplePlatform)' == 'true'">--flat</DsymUtilOptions>
<_SymbolPrefix Condition="'$(_IsApplePlatform)' == 'true'">_</_SymbolPrefix>
<LinkerFlavor Condition="'$(LinkerFlavor)' == '' and '$(_targetOS)' == 'freebsd'">lld</LinkerFlavor>
<LinkerFlavor Condition="'$(LinkerFlavor)' == '' and '$(_linuxLibcFlavor)' == 'bionic'">lld</LinkerFlavor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' == 'win' and '$(NativeLib)' == 'Static'">.lib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(_targetOS)' != 'win' and '$(NativeLib)' == 'Static'">.a</NativeBinaryExt>

<NativeSymbolExt Condition="'$(_IsApplePlatform)' == 'true'">.dwarf</NativeSymbolExt>
<NativeSymbolExt Condition="'$(_targetOS)' == 'win'">.pdb</NativeSymbolExt>
<NativeSymbolExt Condition="'$(_targetOS)' != 'win' and '$(_IsApplePlatform)' != 'true'">.dbg</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_IsApplePlatform)' == 'true'">.dsym</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == '' and '$(_targetOS)' == 'win'">.pdb</NativeSymbolExt>
<NativeSymbolExt Condition="'$(NativeSymbolExt)' == ''">.dbg</NativeSymbolExt>

<ExportsFileExt Condition="'$(_targetOS)' == 'win'">.def</ExportsFileExt>
<ExportsFileExt Condition="'$(_targetOS)' != 'win'">.exports</ExportsFileExt>
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/tools/aot/crossgen2/crossgen2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
<IlcFrameworkPath>$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)</IlcFrameworkPath>
<IlcFrameworkNativePath>$(MicrosoftNetCoreAppRuntimePackNativeDir)</IlcFrameworkNativePath>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<!-- Use .dwarf files instead of .dsym files since our symbol exporting may not safely handle folders. -->
<NativeSymbolExt>.dwarf</NativeSymbolExt>
<DsymUtilOptions>--flat</DsymUtilOptions>
</PropertyGroup>

<ItemGroup Condition="'$(NativeAotSupported)' == 'true'">
Expand Down
1 change: 0 additions & 1 deletion src/tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@
<CustomNativeMain>true</CustomNativeMain>
<_IsApplePlatform Condition="'$(TargetsAppleMobile)' == 'true'">true</_IsApplePlatform>
<_IsiOSLikePlatform Condition="'$(TargetsAppleMobile)' == 'true'">true</_IsiOSLikePlatform>
<DsymUtilOptions Condition="'$(_IsApplePlatform)' == 'true'">--flat</DsymUtilOptions>
<_SymbolPrefix Condition="'$(_IsApplePlatform)' == 'true'">_</_SymbolPrefix>
</PropertyGroup>

Expand Down

0 comments on commit 44e63d4

Please sign in to comment.