From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbdDLJ6d (ORCPT ); Wed, 12 Apr 2017 05:58:33 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:51024 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbdDLJ6b (ORCPT ); Wed, 12 Apr 2017 05:58:31 -0400 From: Alexey Brodkin To: "jolsa@kernel.org" CC: "acme@redhat.com" , "a.p.zijlstra@chello.nl" , "linux-kernel@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" Subject: perf jvmti: unconditionally links against -lelf Thread-Topic: perf jvmti: unconditionally links against -lelf Thread-Index: AQHSs3NUYBsj93KHk0qNlBBHzU/dYg== Date: Wed, 12 Apr 2017 09:58:26 +0000 Message-ID: <1491991105.4510.25.camel@synopsys.com> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.225.15.124] Content-Type: text/plain; charset="utf-8" Content-ID: <83FE6306D7D571449D17A1CA950FF2D1@internal.synopsys.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v3C9wiIK024266 Hi Jiri, Just tried to cross-compile perf with pretty bare-minimal toolchain which has no libelf installed for the target (for the record I used SNPS ARC pre-built arc-2016.09 tools) like that: --------------->8------------ make NO_LIBELF=1 --------------->8------------ And got the following build failure: --------------->8------------   LINK     libperf-jvmti.so .../2016.09-uclibc-archs/bin/../lib/gcc/arc-snps-linux-uclibc/6.2.1/../../../../arc-snps-linux-uclibc/bin/ld: cannot find -lelf --------------->8------------ First I was surprised because I intentionally disabled usage of libelf but after some grepping figured out jvmti is linked against libelf regardless any settings, see: --------------->8------------ $(OUTPUT)$(LIBJVMTI): $(LIBJVMTI_IN)        $(QUIET_LINK)$(CC) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $< -lelf -lrt endif --------------->8------------ This comes from commit d4dfdf00d43e ("perf jvmti: Plug compilation into perf build"). I'm not really sure what could be the best solution to the problem I see. If libelf is a real must for jvmti then probably we may force set NO_JVMTI=1 if NO_LIBELF=1 is passed on the command line. At least the following builds perf for me without issues: --------------->8------------ make NO_LIBELF=1 NO_JVMTI=1 --------------->8------------ Regards, Alexey