linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/BUG] perf tools: static build fails
@ 2015-07-28 15:13 Jiri Olsa
  2015-07-28 16:11 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Olsa @ 2015-07-28 15:13 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	linux-kernel, Namhyung Kim

hi,
it's failing on perf-read-vdso32 tool..
attached patch fixes that for me

jirka


---
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 4b58daeff881..a72f790f05e8 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -370,12 +370,12 @@ $(OUTPUT)perf-%: %.o $(PERFLIBS)
 
 ifndef NO_PERF_READ_VDSO32
 $(OUTPUT)perf-read-vdso32: perf-read-vdso.c util/find-vdso-map.c
-	$(QUIET_CC)$(CC) -m32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
+	$(QUIET_CC)$(CC) -m32 $(filter-out -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
 endif
 
 ifndef NO_PERF_READ_VDSOX32
 $(OUTPUT)perf-read-vdsox32: perf-read-vdso.c util/find-vdso-map.c
-	$(QUIET_CC)$(CC) -mx32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
+	$(QUIET_CC)$(CC) -mx32 $(filter-out -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
 endif
 
 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC/BUG] perf tools: static build fails
  2015-07-28 15:13 [RFC/BUG] perf tools: static build fails Jiri Olsa
@ 2015-07-28 16:11 ` Arnaldo Carvalho de Melo
  2015-07-28 21:14   ` Adrian Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-28 16:11 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Adrian Hunter, Peter Zijlstra, Ingo Molnar, linux-kernel,
	Namhyung Kim

Em Tue, Jul 28, 2015 at 05:13:47PM +0200, Jiri Olsa escreveu:
> hi,
> it's failing on perf-read-vdso32 tool..
> attached patch fixes that for me

To build it statically:

  make -C tools/perf O=/tmp/build/perf LDFLAGS=-static install-bin

Adrian, I wonder if building just these utilities non-statically when we
ask for a static build of the main tool is ok, is it?

- Arnaldo


 
> jirka
> 
> 
> ---
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 4b58daeff881..a72f790f05e8 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -370,12 +370,12 @@ $(OUTPUT)perf-%: %.o $(PERFLIBS)
>  
>  ifndef NO_PERF_READ_VDSO32
>  $(OUTPUT)perf-read-vdso32: perf-read-vdso.c util/find-vdso-map.c
> -	$(QUIET_CC)$(CC) -m32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
> +	$(QUIET_CC)$(CC) -m32 $(filter-out -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
>  endif
>  
>  ifndef NO_PERF_READ_VDSOX32
>  $(OUTPUT)perf-read-vdsox32: perf-read-vdso.c util/find-vdso-map.c
> -	$(QUIET_CC)$(CC) -mx32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
> +	$(QUIET_CC)$(CC) -mx32 $(filter-out -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
>  endif
>  
>  $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC/BUG] perf tools: static build fails
  2015-07-28 16:11 ` Arnaldo Carvalho de Melo
@ 2015-07-28 21:14   ` Adrian Hunter
  2015-07-28 21:21     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2015-07-28 21:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Peter Zijlstra, Ingo Molnar, linux-kernel, Namhyung Kim

On 28/07/2015 7:11 p.m., Arnaldo Carvalho de Melo wrote:
> Em Tue, Jul 28, 2015 at 05:13:47PM +0200, Jiri Olsa escreveu:
>> hi,
>> it's failing on perf-read-vdso32 tool..
>> attached patch fixes that for me
>
> To build it statically:
>
>    make -C tools/perf O=/tmp/build/perf LDFLAGS=-static install-bin
>
> Adrian, I wonder if building just these utilities non-statically when we
> ask for a static build of the main tool is ok, is it?

Not really.

Static build works for me, including building perf-read-vdso32 statically,
so I am not sure what the problem is?

>
> - Arnaldo
>
>
>
>> jirka
>>
>>
>> ---
>> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
>> index 4b58daeff881..a72f790f05e8 100644
>> --- a/tools/perf/Makefile.perf
>> +++ b/tools/perf/Makefile.perf
>> @@ -370,12 +370,12 @@ $(OUTPUT)perf-%: %.o $(PERFLIBS)
>>
>>   ifndef NO_PERF_READ_VDSO32
>>   $(OUTPUT)perf-read-vdso32: perf-read-vdso.c util/find-vdso-map.c
>> -	$(QUIET_CC)$(CC) -m32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
>> +	$(QUIET_CC)$(CC) -m32 $(filter-out -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
>>   endif
>>
>>   ifndef NO_PERF_READ_VDSOX32
>>   $(OUTPUT)perf-read-vdsox32: perf-read-vdso.c util/find-vdso-map.c
>> -	$(QUIET_CC)$(CC) -mx32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
>> +	$(QUIET_CC)$(CC) -mx32 $(filter-out -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c
>>   endif
>>
>>   $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC/BUG] perf tools: static build fails
  2015-07-28 21:14   ` Adrian Hunter
@ 2015-07-28 21:21     ` Arnaldo Carvalho de Melo
  2015-07-29  8:30       ` Jiri Olsa
  0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-07-28 21:21 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Jiri Olsa, Peter Zijlstra, Ingo Molnar, linux-kernel,
	Namhyung Kim

Em Wed, Jul 29, 2015 at 12:14:41AM +0300, Adrian Hunter escreveu:
> On 28/07/2015 7:11 p.m., Arnaldo Carvalho de Melo wrote:
> >Em Tue, Jul 28, 2015 at 05:13:47PM +0200, Jiri Olsa escreveu:

> >>it's failing on perf-read-vdso32 tool..  attached patch fixes that
> >>for me

> >To build it statically:

> >   make -C tools/perf O=/tmp/build/perf LDFLAGS=-static install-bin

> >Adrian, I wonder if building just these utilities non-statically when we
> >ask for a static build of the main tool is ok, is it?
 
> Not really.
 
> Static build works for me, including building perf-read-vdso32 statically,
> so I am not sure what the problem is?

The static build stops for me way before getting to these utilities, so
I don't know, I fixed an unrelated problem, but Jiri is the one having
trouble in this one, Jiri, can you post the output of the build when it
fails?

- Arnaldo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC/BUG] perf tools: static build fails
  2015-07-28 21:21     ` Arnaldo Carvalho de Melo
@ 2015-07-29  8:30       ` Jiri Olsa
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Olsa @ 2015-07-29  8:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Adrian Hunter, Peter Zijlstra, Ingo Molnar, linux-kernel,
	Namhyung Kim

On Tue, Jul 28, 2015 at 06:21:38PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Jul 29, 2015 at 12:14:41AM +0300, Adrian Hunter escreveu:
> > On 28/07/2015 7:11 p.m., Arnaldo Carvalho de Melo wrote:
> > >Em Tue, Jul 28, 2015 at 05:13:47PM +0200, Jiri Olsa escreveu:
> 
> > >>it's failing on perf-read-vdso32 tool..  attached patch fixes that
> > >>for me
> 
> > >To build it statically:
> 
> > >   make -C tools/perf O=/tmp/build/perf LDFLAGS=-static install-bin
> 
> > >Adrian, I wonder if building just these utilities non-statically when we
> > >ask for a static build of the main tool is ok, is it?
>  
> > Not really.
>  
> > Static build works for me, including building perf-read-vdso32 statically,
> > so I am not sure what the problem is?

oops, it was the 32bit glibc-static pkg missing.. I'm good now ;-)

> 
> The static build stops for me way before getting to these utilities, so
> I don't know, I fixed an unrelated problem, but Jiri is the one having
> trouble in this one, Jiri, can you post the output of the build when it
> fails?

[jolsa@krava perf]$ make LDFLAGS=-static JOBS=1

SNIP

  GEN      libtraceevent-dynamic-list
  LINK     perf
/home/jolsa/kernel/linux-perf/tools/lib/traceevent/libtraceevent.a(libtraceevent-in.o): In function `load_plugin':
/home/jolsa/kernel/linux-perf/tools/lib/traceevent/event-plugin.c:304: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libperf.a(libperf-in.o): In function `target__parse_uid':
/home/jolsa/kernel/linux-perf/tools/perf/util/target.c:79: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/home/jolsa/kernel/linux-perf/tools/perf/util/target.c:91: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
  CC       perf-read-vdso32
/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Makefile.perf:373: recipe for target 'perf-read-vdso32' failed
make[1]: *** [perf-read-vdso32] Error 1
Makefile:68: recipe for target 'all' failed
make: *** [all] Error 2


jirka

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-29  8:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28 15:13 [RFC/BUG] perf tools: static build fails Jiri Olsa
2015-07-28 16:11 ` Arnaldo Carvalho de Melo
2015-07-28 21:14   ` Adrian Hunter
2015-07-28 21:21     ` Arnaldo Carvalho de Melo
2015-07-29  8:30       ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).