[PUSHED] Support --compress-debug-sections for ld.mold.

Message ID 6b2dc307-aba9-4dca-90ab-aabd83538601@suse.cz
State Committed
Headers
Series [PUSHED] Support --compress-debug-sections for ld.mold. |

Commit Message

Martin Liška April 21, 2022, 8:18 a.m. UTC
  Pushed to master.

Cheers,
Martin

gcc/ChangeLog:

	* configure.ac: Enable compressed debug sections for mold
	linker.
	* configure: Regenerate.
---
 gcc/configure    | 10 ++++++++--
 gcc/configure.ac | 10 ++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)
  

Comments

Bernhard Reutner-Fischer April 21, 2022, 3:58 p.m. UTC | #1
On 21 April 2022 10:18:48 CEST, "Martin Liška" <mliska@suse.cz> wrote:
>Pushed to master.

>-  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \
>+  if test $ld_is_mold = yes; then
>+    gcc_cv_ld_compress_debug=3
>+    gcc_cv_ld_compress_debug_option="--compress-debug-sections"
>+  elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \

Pre-existing, so just FWIW..

test -a and -o are obsolescent.
See Application Usage in https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

thanks,
  

Patch

diff --git a/gcc/configure b/gcc/configure
index 1c1195e95cb..5ce0557719a 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -30623,7 +30623,10 @@  $as_echo_n "checking linker for compressed debug sections... " >&6; }
 # In binutils 2.26, gld gained support for the ELF gABI format.
 if test $in_tree_ld = yes ; then
   gcc_cv_ld_compress_debug=0
-  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \
+  if test $ld_is_mold = yes; then
+    gcc_cv_ld_compress_debug=3
+    gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+  elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \
      && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then
     gcc_cv_ld_compress_debug=2
     gcc_cv_ld_compress_debug_option="--compress-debug-sections"
@@ -30636,7 +30639,10 @@  if test $in_tree_ld = yes ; then
     gcc_cv_ld_compress_debug=1
   fi
 elif echo "$ld_ver" | grep GNU > /dev/null; then
-  if test "$ld_vers_major" -lt 2 \
+  if test $ld_is_mold = yes; then
+    gcc_cv_ld_compress_debug=3
+    gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+  elif test "$ld_vers_major" -lt 2 \
      || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then
     gcc_cv_ld_compress_debug=0
   elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then
diff --git a/gcc/configure.ac b/gcc/configure.ac
index ea67fb62292..23bee7010a3 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6264,7 +6264,10 @@  AC_MSG_CHECKING(linker for compressed debug sections)
 # In binutils 2.26, gld gained support for the ELF gABI format.
 if test $in_tree_ld = yes ; then
   gcc_cv_ld_compress_debug=0
-  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \
+  if test $ld_is_mold = yes; then
+    gcc_cv_ld_compress_debug=3
+    gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+  elif test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 19 -o "$gcc_cv_gld_major_version" -gt 2 \
      && test $in_tree_ld_is_elf = yes && test $ld_is_gold = yes; then
     gcc_cv_ld_compress_debug=2
     gcc_cv_ld_compress_debug_option="--compress-debug-sections"
@@ -6277,7 +6280,10 @@  if test $in_tree_ld = yes ; then
     gcc_cv_ld_compress_debug=1
   fi
 elif echo "$ld_ver" | grep GNU > /dev/null; then
-  if test "$ld_vers_major" -lt 2 \
+  if test $ld_is_mold = yes; then
+    gcc_cv_ld_compress_debug=3
+    gcc_cv_ld_compress_debug_option="--compress-debug-sections"
+  elif test "$ld_vers_major" -lt 2 \
      || test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 21; then
     gcc_cv_ld_compress_debug=0
   elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 26; then