From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755039AbcIAUzW (ORCPT ); Thu, 1 Sep 2016 16:55:22 -0400 Received: from smtprelay.synopsys.com ([198.182.47.9]:52590 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbcIAUzL (ORCPT ); Thu, 1 Sep 2016 16:55:11 -0400 Subject: Re: [PATCH] perf tools: Fix static building To: Jiri Olsa , Alexey Brodkin References: <1471887222-26270-1-git-send-email-abrodkin@synopsys.com> <20160831072128.GB4740@krava> CC: , , Arnaldo Carvalho de Melo , Vineet Gupta , Wang Nan , Jiri Olsa , He Kuang , Masami Hiramatsu , Namhyung Kim , Peter Zijlstra , Zefan Li , Newsgroups: gmane.linux.kernel,gmane.linux.kernel.arc From: Vineet Gupta Message-ID: <8deeb70b-6fe8-32c5-9f6f-65b2d6bd70eb@synopsys.com> Date: Thu, 1 Sep 2016 11:28:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160831072128.GB4740@krava> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.9.130.78] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/31/2016 12:21 AM, Jiri Olsa wrote: > On Mon, Aug 22, 2016 at 08:33:42PM +0300, Alexey Brodkin wrote: >> With commit e3d09ec8126f ("tools lib traceevent: Export dynamic symbols >> used by traceevent plugins") we started to add "--dynamic-list" in >> LDFLAGS. One side-effect of that was inability to build really >> statically-linked perf. > > IIRC --dynamic-list forces perf to exports some symbols to > be used by plugins.. don't see this breaking static build > > also it's working properly for me: > > [jolsa@krava perf]$ make LDFLAGS=-static > ... > [jolsa@krava perf]$ ldd ./perf > not a dynamic executable > > unless I miss what you mean by 'really statically-linked' ;-) Right - so I tried this as well and indeed I can confirm that it builds for me as static. Atleast the build system doesn;t need changing as -sattic being propagated to fianl link cmd. There seems to be some weirdness with ARC tools: file reports | ELF 32-bit LSB executable, *unknown arch 0xc3* version 1 (SYSV), | dynamically linked, interpreter *empty*, for GNU/Linux 3.9.0, not stripped That is clearly wrong ! And the static binary as expected doesn't seem to run on target - exits with -EACCESS. -Vineet