Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3668629pxb; Mon, 24 Jan 2022 14:56:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/g6BCp3rfjUcVNkltcHlQddn9JK0f/8TnbCsmN4OFD1q2vrTo/cXJX/GKKmOMfwcNIvxh X-Received: by 2002:a63:da4c:: with SMTP id l12mr13427272pgj.326.1643064971044; Mon, 24 Jan 2022 14:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643064971; cv=none; d=google.com; s=arc-20160816; b=dhxrf6zsLznAAj9MErGQRHeWsTa1n4Y5GFFjfPZD4iAk10vfPCRdDyi/HikvHDWaGL vuK2dGjl5HBHR/ie2/fVUN8PWkBgyQFanBilp93gr3Z6GIUJR5QP5oPRcEUdB7Hu9Wj4 ZMcDslm7Yw6xeYc6QKlaKJ+K3eE+pT3OISQ0TFTaD61v6UFCS84kovfFeY5mLzNjJb/H Msr8sFnnufbXtZqtOaCJlzKGsf+xHLmlmwY9WRRIcHdvkJMc9T/4Xk4bJ96S4ux67QaF bQnPPWL8ohw+YfeUE191I744YKSeoVTmfrESPp1CJjqiPQJXsb3QWUPZrefahbpdnf5A aweg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1DGwqu+sL38MnRYoA1057SU2uz12s7H5KFyk79YR4+8=; b=Z5YswLFHhXvfG7q/y/xYRXQG0CehtdZ2dCcuf3S1dD1jktDTIE85vCahPf8W8CDbpS 0IT8Cvf123TjAghg0PK4pZAMZyT4I++8Y/AsFU1kyAOCgzBndDmoWE7QUzXkF9PHPdPb BEGuXCOrhm1cOUOn4FdGakgEkSjH4UNESGxGWw7Z3BZjxXLXw+RaFFFPsg66dT7OWS8F kiuZK2U86u/SrVnDkJlADJgJfHRUuPeSS4Q/0Ul41zguBdvtEtvUdchVPTDK5DvBMAp3 TI+wZWHOceP8GdMqdE8cdeEmybXt9WM8S0nMH04/yZJSHtMuL3oufMU1HmoBfQORWAEV lTVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2YEfBIsJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i190si6365067pge.699.2022.01.24.14.55.59; Mon, 24 Jan 2022 14:56:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2YEfBIsJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1839887AbiAXWwF (ORCPT + 99 others); Mon, 24 Jan 2022 17:52:05 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:52814 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359781AbiAXVnY (ORCPT ); Mon, 24 Jan 2022 16:43:24 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5F0EBB811A2; Mon, 24 Jan 2022 21:43:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 826F0C340E4; Mon, 24 Jan 2022 21:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060598; bh=fhcehs13K324S4NcYX+VvjBRl1SSEGNfMfH7EvgCHdk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2YEfBIsJmChaWyJWJeyJ1/ODb2a+6fEVafLWI/hwXtK/4VTSu0GWl1z5m0DdviLqi oWmlaWBbywz6G26BWgTt2Ox1LgyK/PRwvEu8mDgpaWypcxg95dzNXFWLXanSPmGVou 1N9n7++DJznG9mzeLSC6DQdmWDc5h0wztUiucREI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Clark , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Adrian Bunk , Alexander Shishkin , Branislav Rankov , Diederik de Haas , Jiri Olsa , Mark Rutland , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: [PATCH 5.16 1001/1039] perf tools: Drop requirement for libstdc++.so for libopencsd check Date: Mon, 24 Jan 2022 19:46:30 +0100 Message-Id: <20220124184158.935216954@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Uwe Kleine-König commit ed17b1914978eddb2b01f2d34577f1c82518c650 upstream. It's possible to link against libopencsd_c_api without having libstdc++.so available, only libstdc++.so.6.0.28 (or whatever version is in use) needs to be available. The same holds true for libopencsd.so. When -lstdc++ (or -lopencsd) is explicitly passed to the linker however the .so file must be available. So wrap adding the dependencies into a check for static linking that actually requires adding them all. The same construct is already used for some other tests in the same file to reduce dependencies in the dynamic linking case. Fixes: 573cf5c9a152 ("perf build: Add missing -lstdc++ when linking with libopencsd") Reviewed-by: James Clark Signed-off-by: Uwe Kleine-König Cc: Adrian Bunk Cc: Alexander Shishkin Cc: Branislav Rankov Cc: Diederik de Haas Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/all/20211203210544.1137935-1-uwe@kleine-koenig.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/Makefile.config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -143,7 +143,10 @@ FEATURE_CHECK_LDFLAGS-libcrypto = -lcryp ifdef CSINCLUDES LIBOPENCSD_CFLAGS := -I$(CSINCLUDES) endif -OPENCSDLIBS := -lopencsd_c_api -lopencsd -lstdc++ +OPENCSDLIBS := -lopencsd_c_api +ifeq ($(findstring -static,${LDFLAGS}),-static) + OPENCSDLIBS += -lopencsd -lstdc++ +endif ifdef CSLIBS LIBOPENCSD_LDFLAGS := -L$(CSLIBS) endif