From patchwork Fri Mar 3 16:17:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 65980 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 64A153858025 for ; Fri, 3 Mar 2023 16:17:45 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 9E2983858291 for ; Fri, 3 Mar 2023 16:17:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E2983858291 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 02CB430067B8; Fri, 3 Mar 2023 17:17:36 +0100 (CET) Received: by r6.localdomain (Postfix, from userid 1000) id 5ED9F340267; Fri, 3 Mar 2023 17:17:36 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [COMMITTED] Fix static build when zstd is enabled for libelf Date: Fri, 3 Mar 2023 17:17:34 +0100 Message-Id: <20230303161734.469458-1-mark@klomp.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-3033.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_BADIPHTTP, KAM_DMARC_STATUS, NORMAL_HTTP_TO_IP, NUMERIC_HTTP_ADDR, RCVD_IN_BARRACUDACENTRAL, 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" When doing a static build (as with --enable-gcov) the build fails because the executables aren't linked with -lzstd. Also the run-debuginfod-query-retry.sh test relies on libdebuginfod.so.1 which isn't there. Fix by adding $(zstd_LIBS) to the static libelf lines and using the debuginfod-find executable itself in the testcase. * src/Makefile.am (libelf): When BUILD_STATIC add $(zstd_LIBS) * tests/Makefile.am (libelf): Likewise. * tests/run-debuginfod-query-retry.sh: Use debuginfod-find instead of libdebuginfod.so.1 Signed-off-by: Mark Wielaard --- src/Makefile.am | 2 +- tests/Makefile.am | 2 +- tests/run-debuginfod-query-retry.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 6cc019da..10d59a48 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -42,7 +42,7 @@ CLEANFILES += make-debug-archive if BUILD_STATIC libasm = ../libasm/libasm.a libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread -libelf = ../libelf/libelf.a -lz +libelf = ../libelf/libelf.a -lz $(zstd_LIBS) else libasm = ../libasm/libasm.so libdw = ../libdw/libdw.so diff --git a/tests/Makefile.am b/tests/Makefile.am index fd58bf84..7e32f117 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -664,7 +664,7 @@ installcheck-local: if BUILD_STATIC libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread -libelf = ../libelf/libelf.a -lz +libelf = ../libelf/libelf.a -lz $(zstd_LIBS) libasm = ../libasm/libasm.a else libdw = ../libdw/libdw.so diff --git a/tests/run-debuginfod-query-retry.sh b/tests/run-debuginfod-query-retry.sh index 2f551ffb..d2cdfd65 100755 --- a/tests/run-debuginfod-query-retry.sh +++ b/tests/run-debuginfod-query-retry.sh @@ -26,7 +26,7 @@ unset VALGRIND_CMD # set up tests for retrying failed queries. retry_attempts=`(testrun env DEBUGINFOD_URLS=http://255.255.255.255/JUNKJUNK DEBUGINFOD_RETRY_LIMIT=10 DEBUGINFOD_VERBOSE=1 DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache \ ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo \ - ${abs_top_builddir}/debuginfod/libdebuginfod.so.1 || true) \ + ${abs_top_builddir}/debuginfod/debuginfod-find || true) \ 2>&1 >/dev/null | grep -c 'Retry failed query'` if [ $retry_attempts -ne 10 ]; then echo "retry mechanism failed."