Re: [PATCH] perf tools: Fix static building

2016-08-31 Thread Jiri Olsa
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' ;-)

Maybe different features enabled/build environment could you
please send the .config-detected along with the build error?

thanks,
jirka

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] perf tools: Fix static building

2016-08-31 Thread Jiri Olsa
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.
> 
> I.e. even if "LDFLAGS=-static" were passed on perf building command-line
> it had no effect and perf was built dynamically.
> 
> This change disables setup of "--dynamic-list" if LDFLAGS contains
> "-static" option.
> 
> Signed-off-by: Alexey Brodkin 
> Cc: Arnaldo Carvalho de Melo 
> Cc: Vineet Gupta 
> Cc: Wang Nan 
> Cc: Jiri Olsa 
> Cc: He Kuang 
> Cc: Masami Hiramatsu 
> Cc: Namhyung Kim 
> Cc: Peter Zijlstra 
> Cc: Zefan Li 
> Cc: pi3or...@163.com
> ---
>  tools/perf/Makefile.perf | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 2d908750..e9acc7c 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -236,7 +236,9 @@ LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
>  export LIBTRACEEVENT
>  
>  LIBTRACEEVENT_DYNAMIC_LIST = $(TE_PATH)libtraceevent-dynamic-list
> +ifeq ($(filter -static,$(LDFLAGS)),)
>  LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS = -Xlinker 
> --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST)
> +endif

hum, e3d09ec8126f changelog mentioned python feature adding this by default

but not sure python could be added within static build

jirka

>  
>  LIBAPI = $(API_PATH)libapi.a
>  export LIBAPI
> -- 
> 2.7.4
> 

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: perf jvmti: unconditionally links against -lelf

2017-04-12 Thread Jiri Olsa
On Wed, Apr 12, 2017 at 09:58:26AM +, 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

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc