Strip binaries more aggressively (#41039)
authorJan Vorlicek <janvorli@microsoft.com>
Wed, 2 Sep 2020 09:21:09 +0000 (11:21 +0200)
committerGitHub <noreply@github.com>
Wed, 2 Sep 2020 09:21:09 +0000 (11:21 +0200)
commite510e767e4861be955cefdc7187ddd875d1e6a9e
tree7c51325ce2789e2e537ddba5b4064fb699b5c3d8
parenta664bbc7b6b42a88bf3597834f620a41be8fcee5
Strip binaries more aggressively (#41039)

* Strip binaries more aggressively

We are currently stripping only debug symbols, but there are also other
symbols that can be stripped without affecting debuggability or anything
else. We were stripping the binaries in corefx that way in the past,
but some time ago we have unified the stripping between the former
three repos and started to strip just the debugging symbols.

This change strips all unneeded symbols, which results in significant
reduction of the binaries sizes. For example, libcoreclr.so went down
from 8732272 to 7027024 or libSystem.Security.Cryptography.Native.OpenSsl.so
went down from 163376 to 120952.

* Fix FreeBSD

* Fix FreeBSD and OSX

We use nm command to extract g_dacTable symbol value from libcoreclr
for the DAC purposes. On OSX, there are no dynamic symbols, on
FreeBSD, the stripping strips all regular symbols and leaves
dynamic ones only. So the nm needs to get a -D argument for
non OSX.
eng/native/functions.cmake
src/coreclr/src/debug/daccess/CMakeLists.txt
src/coreclr/src/pal/tools/gen-dactable-rva.sh