On Tue, Apr 23, 2024 at 04:05:07PM +0200, Rainer Orth wrote:
> 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.

Then you have two tests (ctestg and ctesta) doing exactly the same thing,
that can't be right.
I guess it might be fine to use zlib when it is an alias to zlib-gabi,
but zlib-gnu shouldn't be replaced.

I must say I don't really understand the patch though, because configury
checks
AC_CACHE_CHECK([whether --compress-debug-sections is supported],
[libgo_cv_ld_compress],
[LDFLAGS_hold=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--compress-debug-sections=zlib-gnu"
AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
[libgo_cv_ld_compress=yes],
[libgo_cv_ld_compress=no])
LDFLAGS=$LDFLAGS_hold])
AM_CONDITIONAL(HAVE_COMPRESSED_DEBUG, test "$libgo_cv_ld_compress" = yes)

So, if Solaris doesn't support --compress-debug-sections=zlib-gnu, it
shouldn't be tested.  Or does it support zlib-gnu and zlib?

        Jakub

Reply via email to