https://gcc.gnu.org/g:9fa1c81f51a91c3fa309a7e2810976ef29b4c810

commit r16-5328-g9fa1c81f51a91c3fa309a7e2810976ef29b4c810
Author: Rainer Orth <[email protected]>
Date:   Mon Nov 17 09:08:03 2025 +0100

    build: Check for ld -z compress-sections=zstd on Solaris
    
    The Solaris 11.4 ld recently gained support for zstd compression.  This
    patch adds a configure check for it.
    
    I also noticed that we don't currently document -gz=zstd, so this patch
    adds that, too.
    
    Tested on i386-pc-solaris2.11 (with pre-zstd and post-zstd ld) and
    x86_64-pc-linux-gnu.
    
    2025-11-14  Rainer Orth  <[email protected]>
    
            gcc:
            * configure.ac (gcc_cv_ld_compress_debug) <*-*-solaris2*>: Check
            for zstd compression support.
            * configure: Regenerate.
    
            * doc/invoke.texi (Debugging Options, gz): Document zstd.

Diff:
---
 gcc/configure       | 5 +++++
 gcc/configure.ac    | 5 +++++
 gcc/doc/invoke.texi | 3 ++-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/gcc/configure b/gcc/configure
index 0e8a63c34fa7..dd8e71b12875 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -33103,6 +33103,11 @@ else
       # Introduced in Solaris 11.2.
       gcc_cv_ld_compress_debug=1
       gcc_cv_ld_compress_debug_option="-z compress-sections"
+      # Detect zstd debug section compression support.  Introduced in
+      # Solaris 11.4 SRU 90.
+      if $gcc_cv_ld --help 2>&1 | grep -- '-z compress-sections.*\<zstd\>' > 
/dev/null; then
+       gcc_cv_ld_compress_debug=2
+      fi
       ;;
     *)
       # Assume linkers other than GNU ld don't support compessed debug
diff --git a/gcc/configure.ac b/gcc/configure.ac
index a3243256af09..74c8f857b7db 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6375,6 +6375,11 @@ changequote(,)dnl
       # Introduced in Solaris 11.2.
       gcc_cv_ld_compress_debug=1
       gcc_cv_ld_compress_debug_option="-z compress-sections"
+      # Detect zstd debug section compression support.  Introduced in
+      # Solaris 11.4 SRU 90.
+      if $gcc_cv_ld --help 2>&1 | grep -- '-z compress-sections.*\<zstd\>' > 
/dev/null; then
+       gcc_cv_ld_compress_debug=2
+      fi
       ;;
     *)
       # Assume linkers other than GNU ld don't support compessed debug
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index df4331fbad07..6b3ba12e7dd0 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -13089,7 +13089,8 @@ location views are enabled.
 Produce compressed debug sections in DWARF format, if that is supported.
 If @var{type} is not given, the default type depends on the capabilities
 of the assembler and linker used.  @var{type} may be one of
-@samp{none} (don't compress debug sections), or @samp{zlib} (use zlib
+@samp{none} (don't compress debug sections), @samp{zlib} (use zlib
+compression in ELF gABI format), or  @samp{zstd} (use zstd
 compression in ELF gABI format).  If the linker doesn't support writing
 compressed debug sections, the option is rejected.  Otherwise, if the
 assembler does not support them, @option{-gz} is silently ignored when

Reply via email to