public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/support-gz=zstd)] support -gz=zstd for both linker and assembler
@ 2022-09-22 12:38 Martin Liska
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2022-09-22 12:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0611e86de8c41148a9e2a88acfb73eb35f301142

commit 0611e86de8c41148a9e2a88acfb73eb35f301142
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Sep 22 14:30:44 2022 +0200

    support -gz=zstd for both linker and assembler
    
            PR driver/106897
    
    gcc/ChangeLog:
    
            * common.opt: Add -gz=zstd value.
            * configure.ac: Detect --compress-debug-sections=zstd
            for both linker and assembler.
            * configure: Regenerate.
            * gcc.cc (LINK_COMPRESS_DEBUG_SPEC): Handle -gz=zstd.
            (ASM_COMPRESS_DEBUG_SPEC): Likewise.

Diff:
---
 gcc/common.opt   |  5 ++++-
 gcc/configure    | 10 ++++++++++
 gcc/configure.ac | 10 ++++++++++
 gcc/gcc.cc       | 15 +++++++++++++++
 4 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index 06ef768ab78..68370db816b 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3419,7 +3419,10 @@ EnumValue
 Enum(compressed_debug_sections) String(zlib) Value(1)
 
 EnumValue
-Enum(compressed_debug_sections) String(zlib-gnu) Value(2)
+Enum(compressed_debug_sections) String(zstd) Value(2)
+
+EnumValue
+Enum(compressed_debug_sections) String(zlib-gnu) Value(3)
 
 gz
 Common Driver
diff --git a/gcc/configure b/gcc/configure
index 70a013e9a30..563a696d183 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -29727,6 +29727,12 @@ else
    if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null
    then
      gcc_cv_as_compress_debug=0
+   # Since binutils 2.40, gas supports --compress-debug-sections=zstd.
+   elif $gcc_cv_as --compress-debug-sections=zstd -o conftest.o conftest.s > /dev/null 2>&1
+   then
+     gcc_cv_as_compress_debug=2
+     gcc_cv_as_compress_debug_option="--compress-debug-sections"
+     gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections"
    # Since binutils 2.26, gas supports --compress-debug-sections=zlib,
    # defaulting to the ELF gABI format.
    elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1
@@ -30251,6 +30257,10 @@ $as_echo_n "checking linker for compressed debug sections... " >&6; }
 if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zlib-gabi\>' > /dev/null; then
     gcc_cv_ld_compress_debug=1
     gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+    # Detect zstd debug section compression support
+    if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zstd\>' > /dev/null; then
+      gcc_cv_ld_compress_debug=2
+    fi
 else
   case "${target}" in
     *-*-solaris2*)
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 96e10d7c194..f1dc495e470 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5732,6 +5732,12 @@ gcc_GAS_CHECK_FEATURE([compressed debug sections],
    if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null
    then
      gcc_cv_as_compress_debug=0
+   # Since binutils 2.40, gas supports --compress-debug-sections=zstd.
+   elif $gcc_cv_as --compress-debug-sections=zstd -o conftest.o conftest.s > /dev/null 2>&1
+   then
+     gcc_cv_as_compress_debug=2
+     gcc_cv_as_compress_debug_option="--compress-debug-sections"
+     gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections"
    # Since binutils 2.26, gas supports --compress-debug-sections=zlib,
    # defaulting to the ELF gABI format.
    elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1
@@ -6127,6 +6133,10 @@ AC_MSG_CHECKING(linker for compressed debug sections)
 if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zlib-gabi\>' > /dev/null; then
     gcc_cv_ld_compress_debug=1
     gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+    # Detect zstd debug section compression support
+    if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zstd\>' > /dev/null; then
+      gcc_cv_ld_compress_debug=2
+    fi
 else
 changequote(,)dnl
   case "${target}" in
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 7578988efa9..2ffbbc0bf2a 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -835,6 +835,14 @@ proper position among the other output files.  */
 #define LINK_COMPRESS_DEBUG_SPEC \
 	" %{gz|gz=zlib:"  LD_COMPRESS_DEBUG_OPTION "=zlib}" \
 	" %{gz=none:"	  LD_COMPRESS_DEBUG_OPTION "=none}" \
+	" %{gz*:%e-gz=zstd is not supported in this configuration} " \
+	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
+#elif HAVE_LD_COMPRESS_DEBUG == 2
+/* ELF gABI style and ZSTD.  */
+#define LINK_COMPRESS_DEBUG_SPEC \
+	" %{gz|gz=zlib:"  LD_COMPRESS_DEBUG_OPTION "=zlib}" \
+	" %{gz=none:"	  LD_COMPRESS_DEBUG_OPTION "=none}" \
+	" %{gz=zstd:"	  LD_COMPRESS_DEBUG_OPTION "=zstd}" \
 	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
 #else
 #error Unknown value for HAVE_LD_COMPRESS_DEBUG.
@@ -890,6 +898,13 @@ proper position among the other output files.  */
 	" %{gz|gz=zlib:"  AS_COMPRESS_DEBUG_OPTION "=zlib}" \
 	" %{gz=none:"	  AS_COMPRESS_DEBUG_OPTION "=none}" \
 	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
+#elif HAVE_AS_COMPRESS_DEBUG == 2
+/* ELF gABI style and ZSTD.  */
+#define ASM_COMPRESS_DEBUG_SPEC \
+	" %{gz|gz=zlib:"  AS_COMPRESS_DEBUG_OPTION "=zlib}" \
+	" %{gz=none:"	  AS_COMPRESS_DEBUG_OPTION "=none}" \
+	" %{gz=zstd:"	  AS_COMPRESS_DEBUG_OPTION "=zstd}" \
+	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
 #else
 #error Unknown value for HAVE_AS_COMPRESS_DEBUG.
 #endif

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [gcc(refs/users/marxin/heads/support-gz=zstd)] support -gz=zstd for both linker and assembler
@ 2022-09-22 12:42 Martin Liska
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2022-09-22 12:42 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0dff477e957a16d103d15754fe573d7e592e89dc

commit 0dff477e957a16d103d15754fe573d7e592e89dc
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Sep 22 14:30:44 2022 +0200

    support -gz=zstd for both linker and assembler
    
            PR driver/106897
    
    gcc/ChangeLog:
    
            * common.opt: Add -gz=zstd value.
            * configure.ac: Detect --compress-debug-sections=zstd
            for both linker and assembler.
            * configure: Regenerate.
            * gcc.cc (LINK_COMPRESS_DEBUG_SPEC): Handle -gz=zstd.
            (ASM_COMPRESS_DEBUG_SPEC): Likewise.

Diff:
---
 gcc/common.opt   |  5 ++++-
 gcc/configure    | 10 ++++++++++
 gcc/configure.ac | 10 ++++++++++
 gcc/gcc.cc       | 15 +++++++++++++++
 4 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index 06ef768ab78..68370db816b 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3419,7 +3419,10 @@ EnumValue
 Enum(compressed_debug_sections) String(zlib) Value(1)
 
 EnumValue
-Enum(compressed_debug_sections) String(zlib-gnu) Value(2)
+Enum(compressed_debug_sections) String(zstd) Value(2)
+
+EnumValue
+Enum(compressed_debug_sections) String(zlib-gnu) Value(3)
 
 gz
 Common Driver
diff --git a/gcc/configure b/gcc/configure
index 70a013e9a30..563a696d183 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -29727,6 +29727,12 @@ else
    if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null
    then
      gcc_cv_as_compress_debug=0
+   # Since binutils 2.40, gas supports --compress-debug-sections=zstd.
+   elif $gcc_cv_as --compress-debug-sections=zstd -o conftest.o conftest.s > /dev/null 2>&1
+   then
+     gcc_cv_as_compress_debug=2
+     gcc_cv_as_compress_debug_option="--compress-debug-sections"
+     gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections"
    # Since binutils 2.26, gas supports --compress-debug-sections=zlib,
    # defaulting to the ELF gABI format.
    elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1
@@ -30251,6 +30257,10 @@ $as_echo_n "checking linker for compressed debug sections... " >&6; }
 if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zlib-gabi\>' > /dev/null; then
     gcc_cv_ld_compress_debug=1
     gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+    # Detect zstd debug section compression support
+    if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zstd\>' > /dev/null; then
+      gcc_cv_ld_compress_debug=2
+    fi
 else
   case "${target}" in
     *-*-solaris2*)
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 96e10d7c194..f1dc495e470 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5732,6 +5732,12 @@ gcc_GAS_CHECK_FEATURE([compressed debug sections],
    if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null
    then
      gcc_cv_as_compress_debug=0
+   # Since binutils 2.40, gas supports --compress-debug-sections=zstd.
+   elif $gcc_cv_as --compress-debug-sections=zstd -o conftest.o conftest.s > /dev/null 2>&1
+   then
+     gcc_cv_as_compress_debug=2
+     gcc_cv_as_compress_debug_option="--compress-debug-sections"
+     gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections"
    # Since binutils 2.26, gas supports --compress-debug-sections=zlib,
    # defaulting to the ELF gABI format.
    elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1
@@ -6127,6 +6133,10 @@ AC_MSG_CHECKING(linker for compressed debug sections)
 if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zlib-gabi\>' > /dev/null; then
     gcc_cv_ld_compress_debug=1
     gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+    # Detect zstd debug section compression support
+    if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zstd\>' > /dev/null; then
+      gcc_cv_ld_compress_debug=2
+    fi
 else
 changequote(,)dnl
   case "${target}" in
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 7578988efa9..2ffbbc0bf2a 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -835,6 +835,14 @@ proper position among the other output files.  */
 #define LINK_COMPRESS_DEBUG_SPEC \
 	" %{gz|gz=zlib:"  LD_COMPRESS_DEBUG_OPTION "=zlib}" \
 	" %{gz=none:"	  LD_COMPRESS_DEBUG_OPTION "=none}" \
+	" %{gz*:%e-gz=zstd is not supported in this configuration} " \
+	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
+#elif HAVE_LD_COMPRESS_DEBUG == 2
+/* ELF gABI style and ZSTD.  */
+#define LINK_COMPRESS_DEBUG_SPEC \
+	" %{gz|gz=zlib:"  LD_COMPRESS_DEBUG_OPTION "=zlib}" \
+	" %{gz=none:"	  LD_COMPRESS_DEBUG_OPTION "=none}" \
+	" %{gz=zstd:"	  LD_COMPRESS_DEBUG_OPTION "=zstd}" \
 	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
 #else
 #error Unknown value for HAVE_LD_COMPRESS_DEBUG.
@@ -890,6 +898,13 @@ proper position among the other output files.  */
 	" %{gz|gz=zlib:"  AS_COMPRESS_DEBUG_OPTION "=zlib}" \
 	" %{gz=none:"	  AS_COMPRESS_DEBUG_OPTION "=none}" \
 	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
+#elif HAVE_AS_COMPRESS_DEBUG == 2
+/* ELF gABI style and ZSTD.  */
+#define ASM_COMPRESS_DEBUG_SPEC \
+	" %{gz|gz=zlib:"  AS_COMPRESS_DEBUG_OPTION "=zlib}" \
+	" %{gz=none:"	  AS_COMPRESS_DEBUG_OPTION "=none}" \
+	" %{gz=zstd:"	  AS_COMPRESS_DEBUG_OPTION "=zstd}" \
+	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
 #else
 #error Unknown value for HAVE_AS_COMPRESS_DEBUG.
 #endif

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [gcc(refs/users/marxin/heads/support-gz=zstd)] support -gz=zstd for both linker and assembler
@ 2022-09-22 12:46 Martin Liska
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2022-09-22 12:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c407cf1b1ece5165510e4de848cd56a224e98974

commit c407cf1b1ece5165510e4de848cd56a224e98974
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Sep 22 14:30:44 2022 +0200

    support -gz=zstd for both linker and assembler
    
            PR driver/106897
    
    gcc/ChangeLog:
    
            * common.opt: Add -gz=zstd value.
            * configure.ac: Detect --compress-debug-sections=zstd
            for both linker and assembler.
            * configure: Regenerate.
            * gcc.cc (LINK_COMPRESS_DEBUG_SPEC): Handle -gz=zstd.
            (ASM_COMPRESS_DEBUG_SPEC): Likewise.

Diff:
---
 gcc/common.opt   |  5 ++++-
 gcc/configure    | 11 +++++++++--
 gcc/configure.ac | 11 +++++++++--
 gcc/gcc.cc       | 15 +++++++++++++++
 4 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index 06ef768ab78..68370db816b 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -3419,7 +3419,10 @@ EnumValue
 Enum(compressed_debug_sections) String(zlib) Value(1)
 
 EnumValue
-Enum(compressed_debug_sections) String(zlib-gnu) Value(2)
+Enum(compressed_debug_sections) String(zstd) Value(2)
+
+EnumValue
+Enum(compressed_debug_sections) String(zlib-gnu) Value(3)
 
 gz
 Common Driver
diff --git a/gcc/configure b/gcc/configure
index 70a013e9a30..ce4e1859e1f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -29727,13 +29727,16 @@ else
    if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null
    then
      gcc_cv_as_compress_debug=0
-   # Since binutils 2.26, gas supports --compress-debug-sections=zlib,
-   # defaulting to the ELF gABI format.
    elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1
    then
      gcc_cv_as_compress_debug=1
      gcc_cv_as_compress_debug_option="--compress-debug-sections"
      gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections"
+     # Since binutils 2.40, gas supports --compress-debug-sections=zstd.
+     if $gcc_cv_as --compress-debug-sections=zstd -o conftest.o conftest.s > /dev/null 2>&1
+     then
+       gcc_cv_as_compress_debug=2
+     fi
    else
      gcc_cv_as_compress_debug=0
    fi
@@ -30251,6 +30254,10 @@ $as_echo_n "checking linker for compressed debug sections... " >&6; }
 if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zlib-gabi\>' > /dev/null; then
     gcc_cv_ld_compress_debug=1
     gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+    # Detect zstd debug section compression support
+    if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zstd\>' > /dev/null; then
+      gcc_cv_ld_compress_debug=2
+    fi
 else
   case "${target}" in
     *-*-solaris2*)
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 96e10d7c194..b6bafa8b7d6 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -5732,13 +5732,16 @@ gcc_GAS_CHECK_FEATURE([compressed debug sections],
    if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null
    then
      gcc_cv_as_compress_debug=0
-   # Since binutils 2.26, gas supports --compress-debug-sections=zlib,
-   # defaulting to the ELF gABI format.
    elif $gcc_cv_as --compress-debug-sections=zlib -o conftest.o conftest.s > /dev/null 2>&1
    then
      gcc_cv_as_compress_debug=1
      gcc_cv_as_compress_debug_option="--compress-debug-sections"
      gcc_cv_as_no_compress_debug_option="--nocompress-debug-sections"
+     # Since binutils 2.40, gas supports --compress-debug-sections=zstd.
+     if $gcc_cv_as --compress-debug-sections=zstd -o conftest.o conftest.s > /dev/null 2>&1
+     then
+       gcc_cv_as_compress_debug=2
+     fi
    else
      gcc_cv_as_compress_debug=0
    fi])
@@ -6127,6 +6130,10 @@ AC_MSG_CHECKING(linker for compressed debug sections)
 if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zlib-gabi\>' > /dev/null; then
     gcc_cv_ld_compress_debug=1
     gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+    # Detect zstd debug section compression support
+    if $gcc_cv_ld --help 2>&1 | grep -- '--compress-debug-sections.*\<zstd\>' > /dev/null; then
+      gcc_cv_ld_compress_debug=2
+    fi
 else
 changequote(,)dnl
   case "${target}" in
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 7578988efa9..2ffbbc0bf2a 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -835,6 +835,14 @@ proper position among the other output files.  */
 #define LINK_COMPRESS_DEBUG_SPEC \
 	" %{gz|gz=zlib:"  LD_COMPRESS_DEBUG_OPTION "=zlib}" \
 	" %{gz=none:"	  LD_COMPRESS_DEBUG_OPTION "=none}" \
+	" %{gz*:%e-gz=zstd is not supported in this configuration} " \
+	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
+#elif HAVE_LD_COMPRESS_DEBUG == 2
+/* ELF gABI style and ZSTD.  */
+#define LINK_COMPRESS_DEBUG_SPEC \
+	" %{gz|gz=zlib:"  LD_COMPRESS_DEBUG_OPTION "=zlib}" \
+	" %{gz=none:"	  LD_COMPRESS_DEBUG_OPTION "=none}" \
+	" %{gz=zstd:"	  LD_COMPRESS_DEBUG_OPTION "=zstd}" \
 	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
 #else
 #error Unknown value for HAVE_LD_COMPRESS_DEBUG.
@@ -890,6 +898,13 @@ proper position among the other output files.  */
 	" %{gz|gz=zlib:"  AS_COMPRESS_DEBUG_OPTION "=zlib}" \
 	" %{gz=none:"	  AS_COMPRESS_DEBUG_OPTION "=none}" \
 	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
+#elif HAVE_AS_COMPRESS_DEBUG == 2
+/* ELF gABI style and ZSTD.  */
+#define ASM_COMPRESS_DEBUG_SPEC \
+	" %{gz|gz=zlib:"  AS_COMPRESS_DEBUG_OPTION "=zlib}" \
+	" %{gz=none:"	  AS_COMPRESS_DEBUG_OPTION "=none}" \
+	" %{gz=zstd:"	  AS_COMPRESS_DEBUG_OPTION "=zstd}" \
+	" %{gz=zlib-gnu:}" /* Ignore silently zlib-gnu option value.  */
 #else
 #error Unknown value for HAVE_AS_COMPRESS_DEBUG.
 #endif

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-22 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 12:38 [gcc(refs/users/marxin/heads/support-gz=zstd)] support -gz=zstd for both linker and assembler Martin Liska
2022-09-22 12:42 Martin Liska
2022-09-22 12:46 Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).