From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752832AbdDLKUA (ORCPT ); Wed, 12 Apr 2017 06:20:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32856 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751218AbdDLKT6 (ORCPT ); Wed, 12 Apr 2017 06:19:58 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8B2DB61D03 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8B2DB61D03 Date: Wed, 12 Apr 2017 12:19:53 +0200 From: Jiri Olsa To: Alexey Brodkin Cc: "jolsa@kernel.org" , "acme@redhat.com" , "a.p.zijlstra@chello.nl" , "linux-kernel@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" , David Carrillo-Cisneros Subject: Re: perf jvmti: unconditionally links against -lelf Message-ID: <20170412101953.GB14409@krava> References: <1491991105.4510.25.camel@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1491991105.4510.25.camel@synopsys.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 12 Apr 2017 10:19:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 12, 2017 at 09:58:26AM +0000, Alexey Brodkin wrote: > 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------------ hi, incidently, David just posted patch for this ;-) http://marc.info/?l=linux-kernel&m=149197980107421&w=2 should be merged soon jirka