From 84c11e41cd1e2daf8593c69d6b57b058b6c75c10 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Tue, 8 Jun 2021 14:29:16 -0400 Subject: [PATCH] Strip libmonosgen linked library (#53240) It seems in the .symbols.nupkg package, instead of a stripped .dylib/so and companion .dwarf/.dbg, we've just been shipping unstripped libs. This commit largely duplicates the functions from eng/native/functions.cmake into an MSbuild proj, as our entire logic is already in MSbuild not CMake. --- src/mono/mono.proj | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index d506e6a692ebe..b115a0ebaf824 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -481,6 +481,41 @@ + + + + linux-x86_64 + darwin-x86_64 + windows-x86_64 + <_MonoRuntimeFilePath>$(MonoObjDir)out\lib\$(MonoFileName) + <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true'">gnu + <_LinuxAbi Condition="'$(TargetsAndroid)' == 'true'">android + <_LinuxFloatAbi Condition="'$(TargetsAndroid)' != 'true'">hf + <_Objcopy>objcopy + <_Objcopy Condition="'$(Platform)' == 'arm'">arm-linux-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy) + <_Objcopy Condition="'$(Platform)' == 'arm64'">aarch64-linux-$(_LinuxAbi)-$(_Objcopy) + <_Objcopy Condition="'$(Platform)' == 'x64'">x86_64-linux-$(_LinuxAbi)-$(_Objcopy) + <_Objcopy Condition="'$(Platform)' == 'x86'">i686-linux-$(_LinuxAbi)-$(_Objcopy) + <_Objcopy Condition="'$(TargetsAndroid)' == 'true'">$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/bin/$(_Objcopy) + + + + + + + + <_Objcopy Condition="'$(_ObjcopyFound)' != '0'">objcopy + + + + + + + + + + + @@ -705,9 +740,17 @@ <_MonoRuntimeComponentsStaticFilePath Include="$([System.IO.Directory]::GetParent($(_MonoRuntimeFilePath)))\libmono-component-*$(StaticLibExt)" Condition="Exists($(_MonoRuntimeFilePath))" /> <_MonoRuntimeComponentsSharedFilePath Include="$([System.IO.Directory]::GetParent($(_MonoRuntimeFilePath)))\libmono-component-*$(SharedLibExt)" Condition="Exists($(_MonoRuntimeFilePath))" /> + <_MonoRuntimeComponentsSharedFilePath Include="$([System.IO.Directory]::GetParent($(_MonoRuntimeFilePath)))\libmono-component-*$(SharedLibExt).dwarf" Condition="Exists('$(_MonoRuntimeFilePath).dwarf')" /> + <_MonoRuntimeComponentsSharedFilePath Include="$([System.IO.Directory]::GetParent($(_MonoRuntimeFilePath)))\libmono-component-*$(SharedLibExt).dbg" Condition="Exists('$(_MonoRuntimeFilePath).dbg')" /> <_MonoRuntimeArtifacts Include="$(_MonoRuntimeFilePath)" Condition="Exists($(_MonoRuntimeFilePath))"> $(RuntimeBinDir)$(MonoFileName) + <_MonoRuntimeArtifacts Include="$(_MonoRuntimeFilePath).dbg" Condition="Exists('$(_MonoRuntimeFilePath).dbg')"> + $(RuntimeBinDir)$(MonoFileName).dbg + + <_MonoRuntimeArtifacts Include="$(_MonoRuntimeFilePath).dwarf" Condition="Exists('$(_MonoRuntimeFilePath).dwarf')"> + $(RuntimeBinDir)$(MonoFileName).dwarf + <_MonoRuntimeArtifacts Include="$(_MonoRuntimeStaticFilePath)" Condition="Exists($(_MonoRuntimeStaticFilePath)) and '$(_MonoRuntimeStaticFilePath)' != '$(_MonoRuntimeFilePath)'"> $(RuntimeBinDir)$(MonoStaticLibFileName)