public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libbacktrace: Avoid GNU ld --compress-debug-sections=zlib-gabi
@ 2024-04-23 14:05 Rainer Orth
  2024-04-23 14:18 ` Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Rainer Orth @ 2024-04-23 14:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ian Lance Taylor

[-- Attachment #1: Type: text/plain, Size: 1909 bytes --]

I noticed that libbacktrace make check FAILs on Solaris with the native
ld already when building the tests:

libtool: link: /var/gcc/regression/master/11.4-gcc/build/./gcc/xgcc -B/var/gcc/r
egression/master/11.4-gcc/build/./gcc/ -B/vol/gcc/sparc-sun-solaris2.11/bin/ -B/
vol/gcc/sparc-sun-solaris2.11/lib/ -isystem /vol/gcc/sparc-sun-solaris2.11/inclu
de -isystem /vol/gcc/sparc-sun-solaris2.11/sys-include -fchecking=1 -funwind-tab
les -frandom-seed=ctesta_alloc -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmi
ssing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -
Werror -g -g -O2 -Wl,--compress-debug-sections=zlib-gabi -o ctesta_alloc ctesta_
alloc-btest.o ctesta_alloc-testlib.o  ./.libs/libbacktrace_alloc.a
ld: fatal: unrecognized '--compress-debug-sections' cmp-type: zlib-gabi
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1379: ctesta_alloc] Error 1

Solaris ld only supports --compress-debug-sections=zlib, while GNU ld
allows zlib-gabi as an alias for zlib.  gold is the same, it seems,
while lld doesn't support zlib-gabi at all.

Therefore the patch uses zlib instead.

Tested on i386-pc-solaris2.11 with ld and gld and x86_64-pc-linux-gnu
with gld.

With this patch, libbacktrace make check PASSes on Solaris.
Unfortunately, this is quite easy to miss since the make check output
isn't in DejaGnu summary format, thus not picked up by make
mail-report.log.  I mean to adapt the libgo support to produce that
output format for libbacktrace to fix this.

Ok for trunk?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-04-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libbacktrace:
	* Makefile.am (ctestg_LDFLAGS): Use
	-Wl,--compress-debug-sections=zlib instead of zlib-gabi.
	(ctesta_LDFLAGS): Likewise.
	* Makefile.in: Regenerate.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-libbacktrace-no-zlib-gabi.patch --]
[-- Type: text/x-patch, Size: 2407 bytes --]

# HG changeset patch
# Parent  3f974c85f19c90c967e272a1ca6523b897cc175f
libbacktrace: Avoid GNU ld --compress-debug-sections=zlib-gabi

diff --git a/libbacktrace/Makefile.am b/libbacktrace/Makefile.am
--- a/libbacktrace/Makefile.am
+++ b/libbacktrace/Makefile.am
@@ -497,12 +497,12 @@ if HAVE_COMPRESSED_DEBUG
 
 ctestg_SOURCES = btest.c testlib.c
 ctestg_CFLAGS = $(libbacktrace_TEST_CFLAGS)
-ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu $(libbacktrace_testing_ldflags)
+ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib $(libbacktrace_testing_ldflags)
 ctestg_LDADD = libbacktrace.la
 
 ctesta_SOURCES = btest.c testlib.c
 ctesta_CFLAGS = $(libbacktrace_TEST_CFLAGS)
-ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi $(libbacktrace_testing_ldflags)
+ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib $(libbacktrace_testing_ldflags)
 ctesta_LDADD = libbacktrace.la
 
 BUILDTESTS += ctestg ctesta
diff --git a/libbacktrace/Makefile.in b/libbacktrace/Makefile.in
--- a/libbacktrace/Makefile.in
+++ b/libbacktrace/Makefile.in
@@ -1177,11 +1177,11 @@ libbacktrace_testing_ldflags = -no-insta
 @HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_alloc_LDADD = libbacktrace_alloc.la
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_SOURCES = btest.c testlib.c
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_CFLAGS = $(libbacktrace_TEST_CFLAGS)
-@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu $(libbacktrace_testing_ldflags)
+@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib $(libbacktrace_testing_ldflags)
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_LDADD = libbacktrace.la
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_SOURCES = btest.c testlib.c
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_CFLAGS = $(libbacktrace_TEST_CFLAGS)
-@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi $(libbacktrace_testing_ldflags)
+@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib $(libbacktrace_testing_ldflags)
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDADD = libbacktrace.la
 @HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_SOURCES = btest.c testlib.c
 @HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_CFLAGS = $(libbacktrace_TEST_CFLAGS)

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

end of thread, other threads:[~2024-04-23 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 14:05 [PATCH] libbacktrace: Avoid GNU ld --compress-debug-sections=zlib-gabi Rainer Orth
2024-04-23 14:18 ` Jakub Jelinek
2024-04-23 14:24   ` Jakub Jelinek
2024-04-23 17:04     ` Ian Lance Taylor

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).