aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-10-19 11:45:54 +0100
committerNick Clifton <nickc@redhat.com>2015-10-19 11:45:54 +0100
commite12fe5554c3b70139f68e33ded9e2a8075b9d484 (patch)
tree0df02cc16811d762b9bf6c99b81dd56e3dfe5660
parent65808c966405fdc5ac770bfede9b3d5e0614dc81 (diff)
downloadgdb-e12fe5554c3b70139f68e33ded9e2a8075b9d484.zip
gdb-e12fe5554c3b70139f68e33ded9e2a8075b9d484.tar.gz
gdb-e12fe5554c3b70139f68e33ded9e2a8075b9d484.tar.bz2
Add a gas configure option to select the default behaviour for the generation of debug sections - compressed or uncompressed.
PR gas/19109 * configure.ac: Add option --enable-compressed-debug-sections. This sets the default behaviour for compressing debug sections. * as.c (flag_compress_debug): Define and initialise to COMPRESS_DEBUG_GABI_ZLIB if DEFAULT_COMPRESS_DEBUG is set. (show_usage): Indicate whether --no-compress-debug-sections or --compress-debug-sections is the default. * config/tc-i386.c (flag_compress_debug): Delete definition. * doc/as.texinfo (--nocompress-debug-sectionas): Update description. * NEWS: Announce the new feature. * config.in: Regenerate. * configure: Regenerate.
-rw-r--r--gas/ChangeLog16
-rw-r--r--gas/NEWS3
-rw-r--r--gas/as.c16
-rw-r--r--gas/config.in3
-rw-r--r--gas/config/tc-i386.c6
-rwxr-xr-xgas/configure25
-rw-r--r--gas/configure.ac16
-rw-r--r--gas/doc/as.texinfo4
8 files changed, 79 insertions, 10 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a21a03b..2662b43 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,19 @@
+2015-10-19 Nick Clifton <nickc@redhat.com>
+
+ PR gas/19109
+ * configure.ac: Add option --enable-compressed-debug-sections.
+ This sets the default behaviour for compressing debug sections.
+ * as.c (flag_compress_debug): Define and initialise to
+ COMPRESS_DEBUG_GABI_ZLIB if DEFAULT_COMPRESS_DEBUG is set.
+ (show_usage): Indicate whether --no-compress-debug-sections
+ or --compress-debug-sections is the default.
+ * config/tc-i386.c (flag_compress_debug): Delete definition.
+ * doc/as.texinfo (--nocompress-debug-sectionas): Update
+ description.
+ * NEWS: Announce the new feature.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+
2015-10-12 Nick Clifton <nickc@redhat.com>
* config/tc-msp430.c (msp430_mcu_names): Rename to
diff --git a/gas/NEWS b/gas/NEWS
index 03cfa64..50b921d 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -1,5 +1,8 @@
-*- text -*-
+* Add a configure option --enable-compressed-debug-sections=[yes|no] to decide
+ whether DWARF debug sections should be compressed by default.
+
* Add support for the ARC EM/HS, and ARC600/700 architectures. Remove
assembler support for Argonaut RISC architectures.
diff --git a/gas/as.c b/gas/as.c
index 6fb28e9..cb9f0d1 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -224,6 +224,11 @@ print_version_id (void)
VERSION, TARGET_ALIAS, BFD_VERSION_STRING);
}
+#ifdef DEFAULT_FLAG_COMPRESS_DEBUG
+enum compressed_debug_section_type flag_compress_debug
+ = COMPRESS_DEBUG_GABI_ZLIB;
+#endif
+
static void
show_usage (FILE * stream)
{
@@ -245,12 +250,21 @@ Options:\n\
fprintf (stream, _("\
--alternate initially turn on alternate macro syntax\n"));
+#ifdef DEFAULT_FLAG_COMPRESS_DEBUG
fprintf (stream, _("\
--compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]\n\
- compress DWARF debug sections using zlib\n"));
+ compress DWARF debug sections using zlib [default]\n"));
fprintf (stream, _("\
--nocompress-debug-sections\n\
don't compress DWARF debug sections\n"));
+#else
+ fprintf (stream, _("\
+ --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]\n\
+ compress DWARF debug sections using zlib\n"));
+ fprintf (stream, _("\
+ --nocompress-debug-sections\n\
+ don't compress DWARF debug sections [default]\n"));
+#endif
fprintf (stream, _("\
-D produce assembler debugging messages\n"));
fprintf (stream, _("\
diff --git a/gas/config.in b/gas/config.in
index e92edb1..35c8202 100644
--- a/gas/config.in
+++ b/gas/config.in
@@ -36,6 +36,9 @@
/* Default emulation. */
#undef DEFAULT_EMULATION
+/* Define if you want compressed debug sections by default. */
+#undef DEFAULT_FLAG_COMPRESS_DEBUG
+
/* Supported emulations. */
#undef EMULATIONS
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 13f1d27..b5c27ee 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -33,12 +33,6 @@
#include "elf/x86-64.h"
#include "opcodes/i386-init.h"
-#ifdef TE_LINUX
-/* Default to compress debug sections for Linux. */
-enum compressed_debug_section_type flag_compress_debug
- = COMPRESS_DEBUG_GABI_ZLIB;
-#endif
-
#ifndef REGISTER_WARNINGS
#define REGISTER_WARNINGS 1
#endif
diff --git a/gas/configure b/gas/configure
index a74604f..83bc95c 100755
--- a/gas/configure
+++ b/gas/configure
@@ -764,6 +764,7 @@ enable_plugins
enable_largefile
enable_targets
enable_checking
+enable_compressed_debug_sections
enable_werror
enable_build_warnings
enable_nls
@@ -1412,6 +1413,7 @@ Optional Features:
--disable-largefile omit support for large files
--enable-targets alternative target configurations besides the primary
--enable-checking enable run-time checks
+ --enable-compressed-debug-sections compress debug sections by default
--enable-werror treat compile warnings as errors
--enable-build-warnings enable build-time compiler warnings
--disable-nls do not use Native Language Support
@@ -10969,7 +10971,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10972 "configure"
+#line 10974 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11075,7 +11077,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11078 "configure"
+#line 11080 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11664,6 +11666,19 @@ $as_echo "#define ENABLE_CHECKING 1" >>confdefs.h
fi
+# PR gas/19109
+# Decide the default method for compressing debug sections.
+ac_default_compressed_debug_sections=unset
+# Provide a configure time option to override our default.
+# Check whether --enable-compressed_debug_sections was given.
+if test "${enable_compressed_debug_sections+set}" = set; then :
+ enableval=$enable_compressed_debug_sections; case "${enableval}" in
+ yes) ac_default_compressed_debug_sections=yes ;;
+ no) ac_default_compressed_debug_sections=no ;;
+ *) ac_default_compressed_debug_sections=unset ;;
+esac
+fi
+
using_cgen=no
@@ -12489,6 +12504,12 @@ _ACEOF
done
+if test x$ac_default_compressed_debug_sections == xyes ; then
+
+$as_echo "#define DEFAULT_FLAG_COMPRESS_DEBUG 1" >>confdefs.h
+
+fi
+
# Turn on all targets if possible
if test ${all_targets} = "yes"; then
case ${target_cpu_type} in
diff --git a/gas/configure.ac b/gas/configure.ac
index aa6bb1d..278b45d 100644
--- a/gas/configure.ac
+++ b/gas/configure.ac
@@ -64,6 +64,18 @@ if test x$ac_checking != x ; then
AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want run-time sanity checks.])
fi
+# PR gas/19109
+# Decide the default method for compressing debug sections.
+ac_default_compressed_debug_sections=unset
+# Provide a configure time option to override our default.
+AC_ARG_ENABLE(compressed_debug_sections,
+[ --enable-compressed-debug-sections compress debug sections by default],
+[case "${enableval}" in
+ yes) ac_default_compressed_debug_sections=yes ;;
+ no) ac_default_compressed_debug_sections=no ;;
+ *) ac_default_compressed_debug_sections=unset ;;
+esac])dnl
+
using_cgen=no
AM_BINUTILS_WARNINGS
@@ -536,6 +548,10 @@ changequote([,])dnl
done
+if test x$ac_default_compressed_debug_sections == xyes ; then
+ AC_DEFINE(DEFAULT_FLAG_COMPRESS_DEBUG, 1, [Define if you want compressed debug sections by default.])
+fi
+
# Turn on all targets if possible
if test ${all_targets} = "yes"; then
case ${target_cpu_type} in
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo
index 4ed29d1..e04281d 100644
--- a/gas/doc/as.texinfo
+++ b/gas/doc/as.texinfo
@@ -656,7 +656,9 @@ sections using zlib. The debug sections are renamed to begin with
@end ifset
@item --nocompress-debug-sections
-Do not compress DWARF debug sections. This is the default.
+Do not compress DWARF debug sections. This is usually the default for all
+targets except the x86/x86_64, but a configure time option can be used to
+override this.
@item -D
Ignored. This option is accepted for script compatibility with calls to