From 67620bc504d8b655839b33d0c6db8e3f27df646f Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Thu, 24 Jun 2010 20:44:11 +0000 Subject: Add an exported symbol list to liblzma_decompress to allow dead-code stripping to be even more effective. This reduces the size of liblzma_decompress.dylib by 16kB, and reduces the size of differential updater disk images by 8kB. BUG=47199 TEST=none Review URL: http://codereview.chromium.org/2860019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50765 0039d316-1c4b-4281-b951-d872f2087c98 --- .../mac/third_party/xz/lzma_decompress.export | 21 +++++++++++++++++++++ chrome/installer/mac/third_party/xz/xz.gyp | 10 +++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 chrome/installer/mac/third_party/xz/lzma_decompress.export diff --git a/chrome/installer/mac/third_party/xz/lzma_decompress.export b/chrome/installer/mac/third_party/xz/lzma_decompress.export new file mode 100644 index 0000000..87b51d7 --- /dev/null +++ b/chrome/installer/mac/third_party/xz/lzma_decompress.export @@ -0,0 +1,21 @@ +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This is a list of symbols to export from liblzma_decompress.dylib. It is not +# a complete list of symbols ordinarily exported by liblzma for decompression. +# It's limited to the set of symbols actually needed by targets that depend +# on liblzma_decompress in Chromium. Currently, this only includes xzdec and +# goobspatch. +# +# Trimming the set of exported symbols reduces the number of "roots" used for +# dead-code stripping. With fewer roots considered "live," more code may wind +# up "dead," which can reduce the size of the library. +# +# This approach reduces the size of liblzma_decompress by 16kB. + +_lzma_code +_lzma_end +_lzma_physmem +_lzma_stream_decoder +_lzma_version_string diff --git a/chrome/installer/mac/third_party/xz/xz.gyp b/chrome/installer/mac/third_party/xz/xz.gyp index 37816af..c71cfa5 100644 --- a/chrome/installer/mac/third_party/xz/xz.gyp +++ b/chrome/installer/mac/third_party/xz/xz.gyp @@ -12,7 +12,7 @@ 'check_crc32': 1, 'check_crc64': 0, 'check_sha256': 0, - 'coder_lzma1': 1, + 'coder_lzma1': 0, 'coder_lzma2': 1, 'coder_delta': 0, 'coder_bcj_arm': 0, @@ -288,8 +288,16 @@ # is distributed in Google Chrome update disk images and is used by more # than one tool. 'type': 'shared_library', + 'xcode_settings': { + # The library will reside in the same directory as executables linked + # against it. 'DYLIB_INSTALL_NAME_BASE': '@loader_path', + + # Trim the list of exported symbols to just those needed by + # dependents. This limits the set of "roots" seen during dead-code + # stripping and reduces the size of the library. + 'EXPORTED_SYMBOLS_FILE': 'lzma_decompress.export', }, 'defines': [ -- cgit v1.1