From patchwork Thu Nov 18 21:23:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 47906 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 76BA2385781C for ; Thu, 18 Nov 2021 21:23:58 +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 6E8703858422 for ; Thu, 18 Nov 2021 21:23:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E8703858422 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 reform (deer0x10.wildebeest.org [172.31.17.146]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id A3704302FBAF; Thu, 18 Nov 2021 22:23:48 +0100 (CET) Received: by reform (Postfix, from userid 1000) id 3094C2E812D6; Thu, 18 Nov 2021 22:23:48 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Subject: [PATCH] tests: Add -ldl to dwfl_proc_attach_LDFLAGS Date: Thu, 18 Nov 2021 22:23:41 +0100 Message-Id: <20211118212341.19077-1-mark@klomp.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Cc: Mark Wielaard Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" dwfl-proc-attach uses (overrides) dlopen (so it does nothing). This seems to cause a versioned dlopen symbol to be pulled in when building with LTO. Resulting in a link failure (when dlopen isn't integrated into libc): /usr/bin/ld: dwfl-proc-attach.o (symbol from plugin): undefined reference to symbol 'dlopen@@GLIBC_2.2.5' /usr/bin/ld: /usr/lib64/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status So simply explicitly add -ldl to the LDFLAGS. Signed-off-by: Mark Wielaard --- tests/ChangeLog | 4 ++++ tests/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index a59cdd51..97cb3fa3 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2021-11-18 Mark Wielaard + + * Makefile.am (dwfl_proc_attach_LDFLAGS): Add -ldl. + 2021-11-05 Frank Ch. Eigler PR28430 diff --git a/tests/Makefile.am b/tests/Makefile.am index bfb8b13a..f212f9fb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -717,7 +717,7 @@ strptr_LDADD = $(libelf) newdata_LDADD = $(libelf) elfstrtab_LDADD = $(libelf) dwfl_proc_attach_LDADD = $(libdw) -dwfl_proc_attach_LDFLAGS = -pthread $(AM_LDFLAGS) +dwfl_proc_attach_LDFLAGS = -pthread -ldl $(AM_LDFLAGS) elfshphehdr_LDADD =$(libelf) elfstrmerge_LDADD = $(libdw) $(libelf) dwelfgnucompressed_LDADD = $(libelf) $(libdw)