Re: [PATCH v2 3/9] perf build: Test correct path of perf in build-test

From: Arnaldo Carvalho de Melo
Date: Thu Jan 14 2016 - 11:02:16 EST


Em Thu, Jan 14, 2016 at 12:44:36PM -0300, Arnaldo Carvalho de Melo escreveu:
> If I try it manually, in the source tree:
>
> [acme@felicio linux]$ cd tools/perf
> [acme@felicio perf]$ make LDFLAGS=-static
> BUILD: Doing 'make -j4' parallel build
> GEN libtraceevent-dynamic-list
> LINK libperf-gtk.so
> /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: relocation R_X86_64_32 against `__TMC_END__' can not be used when making a shared object; recompile with -fPIC
> /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginT.o: could not read symbols: Bad value
> collect2: error: ld returned 1 exit status
> make[1]: *** [libperf-gtk.so] Error 1
> make: *** [all] Error 2
> [acme@felicio perf]$
>
> And if I do a make clean and try again, it works:

[acme@felicio linux]$ git log --oneline -5
be874d2f8baa perf build: Test correct path of perf in build-test
dab97c905927 perf build: Pass O option to Makefile.perf in build-test
7d66631ea112 perf build: Set parallel making options build-test
69d5f8e92f05 perf symbols: Fix reading of build-id from vDSO
8bf78e69a277 perf kvm record/report: 'unprocessable sample' error while
recording/reporting guest data
[acme@felicio linux]$

So, with that hunch, I tried with the patch below and it finishes a
'make -C tools/perf build-test' run with no find .cmd errors not
'make_static' failures, investigating what is the problem with the
'clean' target when it gets a O= passed...

[acme@felicio linux]$ git diff
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index e74c86b00c31..baf8f0099507 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -266,7 +266,8 @@ endif

MAKEFLAGS := --no-print-directory

-clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_O) clean >/dev/null)
+#clean := @(cd $(PERF); make -s -f $(MK) O=$(PERF_O) clean >/dev/null)
+clean := @(cd $(PERF); make -s -f $(MK) clean >/dev/null)

$(run):
$(call clean)
[acme@felicio linux]$