From patchwork Tue Apr 23 14:05:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 88918 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B3D8A384AB5B for ; Tue, 23 Apr 2024 14:05:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 242E73858C42 for ; Tue, 23 Apr 2024 14:05:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 242E73858C42 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 242E73858C42 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713881124; cv=none; b=Uct4h1hILyz2yNKeATmwsg38oeiJzWhaLgfPpwRIJTpKl0H0wJae1jBHQ6Y0YH2pufC87txtA6FwEeJvld/szPyv25zPITxD1HF5SpgMLaFwNx9+75UGyVw6/E+4PkcP22p9V634rD91C8Bx13Dn2LQaaOkOuWTL50PGXYbu9H4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713881124; c=relaxed/simple; bh=li4Q5bhkSCgUpfrhbPycJbl6x651LLKhohYoXOA7hw0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fFC2ecxoYNTSYJDJS61jS5HBPEiK2aDR9gK8qEhGm+vd/VavjusnRhH+NPPNoMGZPawuVdCLxAh9gxpbrc8YvSktAd/X0PyuhYp1hmuk8GMnRJzgC6a40ZtdCPfLJK5qLLA6+n2ItmuTSNhNVNplA7tiuwL5bYVSofFgZ/ji+ao= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 4ED41B19CA; Tue, 23 Apr 2024 16:05:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:date:date:subject:subject :from:from:received:received; s=20200306; t=1713881108; bh=li4Q5 bhkSCgUpfrhbPycJbl6x651LLKhohYoXOA7hw0=; b=Jpw1JCb365JFFvmsyC75s y9SnCWVEHWvq10sUDPNxo5wqFa7+onQR5xMF+5rYay4/1YoxCHepqSqJbrBRvodL DMlCLq+2/VhzsYuUbpTrUKxsThlFjKbzpGucocrwW3O4/6uOdo4LmIawP+k8kLsD xvnO4Hr1nMPpGMwqWrorX3fFnUZO6kMeT6m86BRrKDRQiGFCFICZ4jm5R3ag+RjO Sy7mX0j+pxo/W7ycYShobri1Cw+xhuXIuxa8p794iuPn+h5wyaYNYRE68UF8VwGy vLAeOVNnUEH8ozTMcbF7AODJdMzsq23RJuZWasQr3swPuTFi6p8xqPTO+ILjpqOf Q== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id iWrkcAYjBi_E; Tue, 23 Apr 2024 16:05:08 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p50855b96.dip0.t-ipconnect.de [80.133.91.150]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id DAA6DB1CAD; Tue, 23 Apr 2024 16:05:07 +0200 (CEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Ian Lance Taylor Subject: [PATCH] libbacktrace: Avoid GNU ld --compress-debug-sections=zlib-gabi Date: Tue, 23 Apr 2024 16:05:07 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 X-Spam-Status: No, score=-3789.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org 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 # 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)