aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-18 07:36:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-18 07:36:42 +0000
commitcadf038430eadbf002f5ff11b6b044ed2065f450 (patch)
tree1507ed1975eb428fdea48c444cdd00a60e9fb124 /configure.in
parent00ba70f7e7c6935a099a9fce3272c0defa64df2d (diff)
downloadruby-cadf038430eadbf002f5ff11b6b044ed2065f450.tar.gz
configure.in: compress debug sections
* configure.in (DLDFLAGS): append --compress-debug-sections=zlib if available, which reduces the size of LIBRUBY_SO by half or more. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 87da5d85f8..8dd3aa9e66 100644
--- a/configure.in
+++ b/configure.in
@@ -912,6 +912,13 @@ if test "$GCC" = yes; then
RUBY_APPEND_OPTION(LDFLAGS, -fstack-protector)
fi
+ RUBY_TRY_LDFLAGS(${linker_flag}--compress-debug-sections=zlib,
+ [compress_debug_sections=yes],
+ [compress_debug_sections=no])
+ if test "x$compress_debug_sections" = xyes; then
+ RUBY_APPEND_OPTION(DLDFLAGS, ${linker_flag}--compress-debug-sections=zlib)
+ fi
+
AS_CASE(["$target_os"],[mingw*], [
# On Windows platforms, system provided headers are VC++
# optimized. That is, C++ habits are often contaminated into
@@ -3893,6 +3900,10 @@ AS_CASE("$enable_shared", [yes], [
[mingw*|cygwin*|mswin*], [
LIBRUBY_RELATIVE=yes
])
+
+ if test "x$compress_debug_sections" = xyes; then
+ RUBY_APPEND_OPTION(LIBRUBY_DLDFLAGS, ${linker_flag}--compress-debug-sections=zlib)
+ fi
], [
LIBRUBYARG_SHARED=