]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
build: Check for ld -z compress-sections=zstd on Solaris
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 17 Nov 2025 08:08:03 +0000 (09:08 +0100)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 17 Nov 2025 08:08:03 +0000 (09:08 +0100)
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  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* configure.ac (gcc_cv_ld_compress_debug) <*-*-solaris2*>: Check
for zstd compression support.
* configure: Regenerate.

* doc/invoke.texi (Debugging Options, gz): Document zstd.

gcc/configure
gcc/configure.ac
gcc/doc/invoke.texi

index 0e8a63c34fa7b0b4be7a1d62fcc4f60885489614..dd8e71b12875c710e10ad1b75ea2fff7a208e901 100755 (executable)
@@ -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
index a3243256af09825d42041f7b80e75883940a0c35..74c8f857b7db009f7c18de7cba7bc0ebdd99287d 100644 (file)
@@ -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
index df4331fbad070ca0773f05e45498f942a7fdadcc..6b3ba12e7dd0b145d04e8019a6ba6e869f2ac23d 100644 (file)
@@ -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