diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-07-06 03:21:32 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-07-25 10:54:06 -0400 |
commit | 52b5c0d485385d3c767d979496983ca2b6987f5c (patch) | |
tree | 2c67d60162c7d6561783e3a3e78e3132ebbd26ee /tools/lib | |
parent | 043d1a5c14e95212dbf48251051804ede1ed1862 (diff) |
tools lib traceevent: Detect build environment changes
Cross compiling perf requires setting ARCH and CROSS_COMPILE variables,
but libtraceevent couldn't detect the changes so it ends up believing no
recompiling is required. Thus the linker failed like:
LINK perf
../lib/traceevent//libtraceevent.a: member ../lib/traceevent//libtraceevent.a(event-parse.o) in archive is not an object
collect2: ld returned 1 exit status
make: *** [perf] Error 1
This patch fixes this by adding TRACEEVENT-CFLAGS file like
PERF-CFLAGS to track those changes.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1341559297-25725-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/traceevent/Makefile | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile index 46c2f6b7b123..14131cb0522d 100644 --- a/tools/lib/traceevent/Makefile +++ b/tools/lib/traceevent/Makefile | |||
@@ -207,7 +207,7 @@ libtraceevent.so: $(PEVENT_LIB_OBJS) | |||
207 | libtraceevent.a: $(PEVENT_LIB_OBJS) | 207 | libtraceevent.a: $(PEVENT_LIB_OBJS) |
208 | $(Q)$(do_build_static_lib) | 208 | $(Q)$(do_build_static_lib) |
209 | 209 | ||
210 | $(PEVENT_LIB_OBJS): %.o: $(src)/%.c | 210 | $(PEVENT_LIB_OBJS): %.o: $(src)/%.c TRACEEVENT-CFLAGS |
211 | $(Q)$(do_fpic_compile) | 211 | $(Q)$(do_fpic_compile) |
212 | 212 | ||
213 | define make_version.h | 213 | define make_version.h |
@@ -272,6 +272,16 @@ ifneq ($(dep_includes),) | |||
272 | include $(dep_includes) | 272 | include $(dep_includes) |
273 | endif | 273 | endif |
274 | 274 | ||
275 | ### Detect environment changes | ||
276 | TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):$(ARCH):$(CROSS_COMPILE) | ||
277 | |||
278 | TRACEEVENT-CFLAGS: force | ||
279 | @FLAGS='$(TRACK_CFLAGS)'; \ | ||
280 | if test x"$$FLAGS" != x"`cat TRACEEVENT-CFLAGS 2>/dev/null`" ; then \ | ||
281 | echo 1>&2 " * new build flags or cross compiler"; \ | ||
282 | echo "$$FLAGS" >TRACEEVENT-CFLAGS; \ | ||
283 | fi | ||
284 | |||
275 | tags: force | 285 | tags: force |
276 | $(RM) tags | 286 | $(RM) tags |
277 | find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \ | 287 | find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \ |
@@ -297,7 +307,7 @@ install: install_lib | |||
297 | 307 | ||
298 | clean: | 308 | clean: |
299 | $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d | 309 | $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d |
300 | $(RM) tags TAGS | 310 | $(RM) TRACEEVENT-CFLAGS tags TAGS |
301 | 311 | ||
302 | endif # skip-makefile | 312 | endif # skip-makefile |
303 | 313 | ||