aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-03-21 06:30:54 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-05-30 09:12:03 -0400
commit9c12cf95b32a099ac92ef0e9d138acb4bef984be (patch)
treea1ee33ebba9c8871efaae786ea7bd03d7d1274ad
parent0817df08d31cd961be225e601d8ec92acac62027 (diff)
perf tools: Merge all *CFLAGS* make variable into CFLAGS
Merging all *CFLAGS* make variable into CFLAGS to eliminate all special *_CFLAGS_* variables and make the setup clear. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1369398928-9809-19-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/Makefile64
-rw-r--r--tools/perf/config/Makefile104
-rw-r--r--tools/perf/util/setup.py5
3 files changed, 89 insertions, 84 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 74fdd2bd4146..58275f2b566e 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -148,7 +148,7 @@ PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
148PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT) 148PYTHON_EXT_DEPS := util/python-ext-sources util/setup.py $(LIBTRACEEVENT)
149 149
150$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) 150$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS)
151 $(QUIET_GEN)CFLAGS='$(BASIC_CFLAGS)' $(PYTHON_WORD) util/setup.py \ 151 $(QUIET_GEN)CFLAGS='$(CFLAGS)' $(PYTHON_WORD) util/setup.py \
152 --quiet build_ext; \ 152 --quiet build_ext; \
153 mkdir -p $(OUTPUT)python && \ 153 mkdir -p $(OUTPUT)python && \
154 cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/ 154 cp $(PYTHON_EXTBUILD_LIB)perf.so $(OUTPUT)python/
@@ -429,7 +429,7 @@ PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
429-include arch/$(ARCH)/Makefile 429-include arch/$(ARCH)/Makefile
430 430
431ifneq ($(OUTPUT),) 431ifneq ($(OUTPUT),)
432 BASIC_CFLAGS += -I$(OUTPUT) 432 CFLAGS += -I$(OUTPUT)
433endif 433endif
434 434
435ifdef NO_LIBELF 435ifdef NO_LIBELF
@@ -513,8 +513,6 @@ endif
513 513
514LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group 514LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
515 515
516ALL_CFLAGS += $(BASIC_CFLAGS)
517ALL_CFLAGS += $(ARCH_CFLAGS)
518ALL_LDFLAGS += $(BASIC_LDFLAGS) 516ALL_LDFLAGS += $(BASIC_LDFLAGS)
519 517
520export INSTALL SHELL_PATH 518export INSTALL SHELL_PATH
@@ -536,20 +534,20 @@ strip: $(PROGRAMS) $(OUTPUT)perf
536$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS 534$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
537 $(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \ 535 $(QUIET_CC)$(CC) -include $(OUTPUT)PERF-VERSION-FILE \
538 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ 536 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
539 $(ALL_CFLAGS) -c $(filter %.c,$^) -o $@ 537 $(CFLAGS) -c $(filter %.c,$^) -o $@
540 538
541$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) 539$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
542 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \ 540 $(QUIET_LINK)$(CC) $(CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \
543 $(BUILTIN_OBJS) $(LIBS) -o $@ 541 $(BUILTIN_OBJS) $(LIBS) -o $@
544 542
545$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS 543$(OUTPUT)builtin-help.o: builtin-help.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
546 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \ 544 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
547 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ 545 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
548 '-DPERF_MAN_PATH="$(mandir_SQ)"' \ 546 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
549 '-DPERF_INFO_PATH="$(infodir_SQ)"' $< 547 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
550 548
551$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS 549$(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
552 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \ 550 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
553 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ 551 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
554 '-DPERF_MAN_PATH="$(mandir_SQ)"' \ 552 '-DPERF_MAN_PATH="$(mandir_SQ)"' \
555 '-DPERF_INFO_PATH="$(infodir_SQ)"' $< 553 '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
@@ -574,77 +572,77 @@ $(OUTPUT)perf.o perf.spec \
574# over the general rule for .o 572# over the general rule for .o
575 573
576$(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS 574$(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
577 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -w $< 575 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -w $<
578 576
579$(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS 577$(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
580 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $< 578 $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $<
581 579
582$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS 580$(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
583 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< 581 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
584$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS 582$(OUTPUT)%.i: %.c $(OUTPUT)PERF-CFLAGS
585 $(QUIET_CC)$(CC) -o $@ -E $(ALL_CFLAGS) $< 583 $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
586$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS 584$(OUTPUT)%.s: %.c $(OUTPUT)PERF-CFLAGS
587 $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $< 585 $(QUIET_CC)$(CC) -o $@ -S $(CFLAGS) $<
588$(OUTPUT)%.o: %.S 586$(OUTPUT)%.o: %.S
589 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< 587 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $<
590$(OUTPUT)%.s: %.S 588$(OUTPUT)%.s: %.S
591 $(QUIET_CC)$(CC) -o $@ -E $(ALL_CFLAGS) $< 589 $(QUIET_CC)$(CC) -o $@ -E $(CFLAGS) $<
592 590
593$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS 591$(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS
594 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \ 592 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
595 '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \ 593 '-DPERF_EXEC_PATH="$(perfexecdir_SQ)"' \
596 '-DPREFIX="$(prefix_SQ)"' \ 594 '-DPREFIX="$(prefix_SQ)"' \
597 $< 595 $<
598 596
599$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS 597$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
600 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \ 598 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
601 '-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \ 599 '-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
602 $< 600 $<
603 601
604$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS 602$(OUTPUT)tests/python-use.o: tests/python-use.c $(OUTPUT)PERF-CFLAGS
605 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \ 603 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) \
606 -DPYTHONPATH='"$(OUTPUT)python"' \ 604 -DPYTHONPATH='"$(OUTPUT)python"' \
607 -DPYTHON='"$(PYTHON_WORD)"' \ 605 -DPYTHON='"$(PYTHON_WORD)"' \
608 $< 606 $<
609 607
610$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS 608$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
611 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 609 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
612 610
613$(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS 611$(OUTPUT)ui/browser.o: ui/browser.c $(OUTPUT)PERF-CFLAGS
614 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $< 612 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
615 613
616$(OUTPUT)ui/browsers/annotate.o: ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS 614$(OUTPUT)ui/browsers/annotate.o: ui/browsers/annotate.c $(OUTPUT)PERF-CFLAGS
617 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $< 615 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
618 616
619$(OUTPUT)ui/browsers/hists.o: ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS 617$(OUTPUT)ui/browsers/hists.o: ui/browsers/hists.c $(OUTPUT)PERF-CFLAGS
620 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $< 618 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
621 619
622$(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS 620$(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
623 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $< 621 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
624 622
625$(OUTPUT)ui/browsers/scripts.o: ui/browsers/scripts.c $(OUTPUT)PERF-CFLAGS 623$(OUTPUT)ui/browsers/scripts.o: ui/browsers/scripts.c $(OUTPUT)PERF-CFLAGS
626 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $< 624 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -DENABLE_SLFUTURE_CONST $<
627 625
628$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS 626$(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
629 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-unused-parameter -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 627 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-unused-parameter -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
630 628
631$(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS 629$(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS
632 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-redundant-decls $< 630 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) -Wno-redundant-decls $<
633 631
634$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS 632$(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS
635 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $< 633 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
636 634
637$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS 635$(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
638 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $< 636 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
639 637
640$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS 638$(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/trace-event-python.c $(OUTPUT)PERF-CFLAGS
641 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $< 639 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
642 640
643$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS 641$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
644 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $< 642 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
645 643
646$(OUTPUT)perf-%: %.o $(PERFLIBS) 644$(OUTPUT)perf-%: %.o $(PERFLIBS)
647 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) 645 $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
648 646
649$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) 647$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
650$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) 648$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
@@ -731,7 +729,7 @@ cscope:
731 $(FIND) . -name '*.[hcS]' -print | xargs cscope -b 729 $(FIND) . -name '*.[hcS]' -print | xargs cscope -b
732 730
733### Detect prefix changes 731### Detect prefix changes
734TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ 732TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\
735 $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) 733 $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
736 734
737$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS 735$(OUTPUT)PERF-CFLAGS: .FORCE-PERF-CFLAGS
@@ -752,7 +750,7 @@ check: $(OUTPUT)common-cmds.h
752 then \ 750 then \
753 for i in *.c */*.c; \ 751 for i in *.c */*.c; \
754 do \ 752 do \
755 sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \ 753 sparse $(CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
756 done; \ 754 done; \
757 else \ 755 else \
758 exit 1; \ 756 exit 1; \
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 506c47976861..a53d2b37831a 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -6,6 +6,7 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
6 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ 6 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
7 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ ) 7 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
8NO_PERF_REGS := 1 8NO_PERF_REGS := 1
9CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS)
9 10
10# Additional ARCH settings for x86 11# Additional ARCH settings for x86
11ifeq ($(ARCH),i386) 12ifeq ($(ARCH),i386)
@@ -17,12 +18,12 @@ endif
17ifeq ($(ARCH),x86_64) 18ifeq ($(ARCH),x86_64)
18 override ARCH := x86 19 override ARCH := x86
19 IS_X86_64 := 0 20 IS_X86_64 := 0
20 ifeq (, $(findstring m32,$(EXTRA_CFLAGS))) 21 ifeq (, $(findstring m32,$(CFLAGS)))
21 IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1) 22 IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
22 endif 23 endif
23 ifeq (${IS_X86_64}, 1) 24 ifeq (${IS_X86_64}, 1)
24 RAW_ARCH := x86_64 25 RAW_ARCH := x86_64
25 ARCH_CFLAGS := -DARCH_X86_64 26 CFLAGS += -DARCH_X86_64
26 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S 27 ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
27 endif 28 endif
28 NO_PERF_REGS := 0 29 NO_PERF_REGS := 0
@@ -30,7 +31,7 @@ ifeq ($(ARCH),x86_64)
30endif 31endif
31 32
32ifeq ($(NO_PERF_REGS),0) 33ifeq ($(NO_PERF_REGS),0)
33 BASIC_CFLAGS += -DHAVE_PERF_REGS 34 CFLAGS += -DHAVE_PERF_REGS
34endif 35endif
35 36
36-include config/feature-tests.mak 37-include config/feature-tests.mak
@@ -45,46 +46,52 @@ endif
45 46
46# Treat warnings as errors unless directed not to 47# Treat warnings as errors unless directed not to
47ifneq ($(WERROR),0) 48ifneq ($(WERROR),0)
48 CFLAGS_WERROR := -Werror 49 CFLAGS += -Werror
49endif 50endif
50 51
51ifeq ("$(origin DEBUG)", "command line") 52ifeq ("$(origin DEBUG)", "command line")
52 PERF_DEBUG = $(DEBUG) 53 PERF_DEBUG = $(DEBUG)
53endif 54endif
54ifndef PERF_DEBUG 55ifndef PERF_DEBUG
55 CFLAGS_OPTIMIZE = -O6 56 CFLAGS += -O6
56endif 57endif
57 58
58ifdef PARSER_DEBUG 59ifdef PARSER_DEBUG
59 PARSER_DEBUG_BISON := -t 60 PARSER_DEBUG_BISON := -t
60 PARSER_DEBUG_FLEX := -d 61 PARSER_DEBUG_FLEX := -d
61 PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG 62 CFLAGS += -DPARSER_DEBUG
62endif 63endif
63 64
64CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS) 65CFLAGS += \
66 -fno-omit-frame-pointer \
67 -ggdb3 \
68 -funwind-tables \
69 -Wall \
70 -Wextra \
71 -std=gnu99
72
65EXTLIBS = -lpthread -lrt -lelf -lm 73EXTLIBS = -lpthread -lrt -lelf -lm
66ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
67ALL_LDFLAGS = $(LDFLAGS) 74ALL_LDFLAGS = $(LDFLAGS)
68 75
69ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y) 76ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y)
70 CFLAGS := $(CFLAGS) -fstack-protector-all 77 CFLAGS += -fstack-protector-all
71endif 78endif
72 79
73ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y) 80ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y)
74 CFLAGS := $(CFLAGS) -Wstack-protector 81 CFLAGS += -Wstack-protector
75endif 82endif
76 83
77ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y) 84ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y)
78 CFLAGS := $(CFLAGS) -Wvolatile-register-var 85 CFLAGS += -Wvolatile-register-var
79endif 86endif
80 87
81ifndef PERF_DEBUG 88ifndef PERF_DEBUG
82 ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y) 89 ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y)
83 CFLAGS := $(CFLAGS) -D_FORTIFY_SOURCE=2 90 CFLAGS += -D_FORTIFY_SOURCE=2
84 endif 91 endif
85endif 92endif
86 93
87BASIC_CFLAGS += \ 94CFLAGS += \
88 -Iutil/include \ 95 -Iutil/include \
89 -Iarch/$(ARCH)/include \ 96 -Iarch/$(ARCH)/include \
90 $(if $(objtree),-I$(objtree)/arch/$(ARCH)/include/generated/uapi) \ 97 $(if $(objtree),-I$(objtree)/arch/$(ARCH)/include/generated/uapi) \
@@ -106,7 +113,6 @@ ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
106 BIONIC := 1 113 BIONIC := 1
107 EXTLIBS := $(filter-out -lrt,$(EXTLIBS)) 114 EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
108 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS)) 115 EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
109 BASIC_CFLAGS += -I.
110endif 116endif
111 117
112ifdef NO_LIBELF 118ifdef NO_LIBELF
@@ -114,9 +120,9 @@ ifdef NO_LIBELF
114 NO_DEMANGLE := 1 120 NO_DEMANGLE := 1
115 NO_LIBUNWIND := 1 121 NO_LIBUNWIND := 1
116else 122else
117FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) 123FLAGS_LIBELF=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
118ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y) 124ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
119 FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS) 125 FLAGS_GLIBC=$(CFLAGS) $(ALL_LDFLAGS)
120 ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y) 126 ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
121 LIBC_SUPPORT := 1 127 LIBC_SUPPORT := 1
122 endif 128 endif
@@ -140,7 +146,7 @@ else
140 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib 146 LIBDW_LDFLAGS := -L$(LIBDW_DIR)/lib
141 endif 147 endif
142 148
143 FLAGS_DWARF=$(ALL_CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) 149 FLAGS_DWARF=$(CFLAGS) $(LIBDW_CFLAGS) -ldw -lelf $(LIBDW_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
144 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y) 150 ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
145 msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev); 151 msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
146 NO_DWARF := 1 152 NO_DWARF := 1
@@ -149,10 +155,10 @@ endif # SOURCE_LIBELF
149endif # NO_LIBELF 155endif # NO_LIBELF
150 156
151ifndef NO_LIBELF 157ifndef NO_LIBELF
152BASIC_CFLAGS += -DLIBELF_SUPPORT 158CFLAGS += -DLIBELF_SUPPORT
153FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) 159FLAGS_LIBELF=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
154ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y) 160ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
155 BASIC_CFLAGS += -DLIBELF_MMAP 161 CFLAGS += -DLIBELF_MMAP
156endif 162endif
157 163
158# include ARCH specific config 164# include ARCH specific config
@@ -163,7 +169,7 @@ ifeq ($(origin PERF_HAVE_DWARF_REGS), undefined)
163 msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled); 169 msg := $(warning DWARF register mappings have not been defined for architecture $(ARCH), DWARF support disabled);
164 NO_DWARF := 1 170 NO_DWARF := 1
165else 171else
166 BASIC_CFLAGS := -DDWARF_SUPPORT $(LIBDW_CFLAGS) $(BASIC_CFLAGS) 172 CFLAGS += -DDWARF_SUPPORT $(LIBDW_CFLAGS)
167 BASIC_LDFLAGS := $(LIBDW_LDFLAGS) $(BASIC_LDFLAGS) 173 BASIC_LDFLAGS := $(LIBDW_LDFLAGS) $(BASIC_LDFLAGS)
168 EXTLIBS += -lelf -ldw 174 EXTLIBS += -lelf -ldw
169endif # PERF_HAVE_DWARF_REGS 175endif # PERF_HAVE_DWARF_REGS
@@ -184,7 +190,7 @@ ifdef LIBUNWIND_DIR
184 LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib 190 LIBUNWIND_LDFLAGS := -L$(LIBUNWIND_DIR)/lib
185endif 191endif
186 192
187FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(ALL_CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS) 193FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
188ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y) 194ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
189 msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99); 195 msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
190 NO_LIBUNWIND := 1 196 NO_LIBUNWIND := 1
@@ -192,19 +198,19 @@ endif # Libunwind support
192endif # NO_LIBUNWIND 198endif # NO_LIBUNWIND
193 199
194ifndef NO_LIBUNWIND 200ifndef NO_LIBUNWIND
195 BASIC_CFLAGS += -DLIBUNWIND_SUPPORT 201 CFLAGS += -DLIBUNWIND_SUPPORT
196 EXTLIBS += $(LIBUNWIND_LIBS) 202 EXTLIBS += $(LIBUNWIND_LIBS)
197 BASIC_CFLAGS := $(LIBUNWIND_CFLAGS) $(BASIC_CFLAGS) 203 CFLAGS += $(LIBUNWIND_CFLAGS)
198 BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS) 204 BASIC_LDFLAGS := $(LIBUNWIND_LDFLAGS) $(BASIC_LDFLAGS)
199endif # NO_LIBUNWIND 205endif # NO_LIBUNWIND
200 206
201ifndef NO_LIBAUDIT 207ifndef NO_LIBAUDIT
202 FLAGS_LIBAUDIT = $(ALL_CFLAGS) $(ALL_LDFLAGS) -laudit 208 FLAGS_LIBAUDIT = $(CFLAGS) $(ALL_LDFLAGS) -laudit
203 ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y) 209 ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y)
204 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); 210 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
205 NO_LIBAUDIT := 1 211 NO_LIBAUDIT := 1
206 else 212 else
207 BASIC_CFLAGS += -DLIBAUDIT_SUPPORT 213 CFLAGS += -DLIBAUDIT_SUPPORT
208 EXTLIBS += -laudit 214 EXTLIBS += -laudit
209 endif 215 endif
210endif 216endif
@@ -214,29 +220,29 @@ ifdef NO_NEWT
214endif 220endif
215 221
216ifndef NO_SLANG 222ifndef NO_SLANG
217 FLAGS_SLANG=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang 223 FLAGS_SLANG=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang
218 ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y) 224 ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y)
219 msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev); 225 msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
220 NO_SLANG := 1 226 NO_SLANG := 1
221 else 227 else
222 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h 228 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
223 BASIC_CFLAGS += -I/usr/include/slang 229 CFLAGS += -I/usr/include/slang
224 BASIC_CFLAGS += -DSLANG_SUPPORT 230 CFLAGS += -DSLANG_SUPPORT
225 EXTLIBS += -lslang 231 EXTLIBS += -lslang
226 endif 232 endif
227endif 233endif
228 234
229ifndef NO_GTK2 235ifndef NO_GTK2
230 FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null) 236 FLAGS_GTK2=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
231 ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y) 237 ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y)
232 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev); 238 msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
233 NO_GTK2 := 1 239 NO_GTK2 := 1
234 else 240 else
235 ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y) 241 ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y)
236 BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR 242 CFLAGS += -DHAVE_GTK_INFO_BAR
237 endif 243 endif
238 BASIC_CFLAGS += -DGTK2_SUPPORT 244 CFLAGS += -DGTK2_SUPPORT
239 BASIC_CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null) 245 CFLAGS += $(shell pkg-config --cflags gtk+-2.0 2>/dev/null)
240 EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null) 246 EXTLIBS += $(shell pkg-config --libs gtk+-2.0 2>/dev/null)
241 endif 247 endif
242endif 248endif
@@ -245,7 +251,7 @@ grep-libs = $(filter -l%,$(1))
245strip-libs = $(filter-out -l%,$(1)) 251strip-libs = $(filter-out -l%,$(1))
246 252
247ifdef NO_LIBPERL 253ifdef NO_LIBPERL
248 BASIC_CFLAGS += -DNO_LIBPERL 254 CFLAGS += -DNO_LIBPERL
249else 255else
250 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) 256 PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
251 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) 257 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
@@ -254,7 +260,7 @@ else
254 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) 260 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
255 261
256 ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y) 262 ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y)
257 BASIC_CFLAGS += -DNO_LIBPERL 263 CFLAGS += -DNO_LIBPERL
258 NO_LIBPERL := 1 264 NO_LIBPERL := 1
259 else 265 else
260 ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS) 266 ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
@@ -264,7 +270,7 @@ endif
264 270
265disable-python = $(eval $(disable-python_code)) 271disable-python = $(eval $(disable-python_code))
266define disable-python_code 272define disable-python_code
267 BASIC_CFLAGS += -DNO_LIBPYTHON 273 CFLAGS += -DNO_LIBPYTHON
268 $(if $(1),$(warning No $(1) was found)) 274 $(if $(1),$(warning No $(1) was found))
269 $(warning Python support will not be built) 275 $(warning Python support will not be built)
270 NO_LIBPYTHON := 1 276 NO_LIBPYTHON := 1
@@ -326,13 +332,13 @@ else
326endif 332endif
327 333
328ifdef NO_DEMANGLE 334ifdef NO_DEMANGLE
329 BASIC_CFLAGS += -DNO_DEMANGLE 335 CFLAGS += -DNO_DEMANGLE
330else 336else
331 ifdef HAVE_CPLUS_DEMANGLE 337 ifdef HAVE_CPLUS_DEMANGLE
332 EXTLIBS += -liberty 338 EXTLIBS += -liberty
333 BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE 339 CFLAGS += -DHAVE_CPLUS_DEMANGLE
334 else 340 else
335 FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd 341 FLAGS_BFD=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
336 has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd) 342 has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd)
337 ifeq ($(has_bfd),y) 343 ifeq ($(has_bfd),y)
338 EXTLIBS += -lbfd 344 EXTLIBS += -lbfd
@@ -347,14 +353,14 @@ else
347 ifeq ($(has_bfd_iberty_z),y) 353 ifeq ($(has_bfd_iberty_z),y)
348 EXTLIBS += -lbfd -liberty -lz 354 EXTLIBS += -lbfd -liberty -lz
349 else 355 else
350 FLAGS_CPLUS_DEMANGLE=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -liberty 356 FLAGS_CPLUS_DEMANGLE=$(CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -liberty
351 has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle) 357 has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle)
352 ifeq ($(has_cplus_demangle),y) 358 ifeq ($(has_cplus_demangle),y)
353 EXTLIBS += -liberty 359 EXTLIBS += -liberty
354 BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE 360 CFLAGS += -DHAVE_CPLUS_DEMANGLE
355 else 361 else
356 msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling) 362 msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
357 BASIC_CFLAGS += -DNO_DEMANGLE 363 CFLAGS += -DNO_DEMANGLE
358 endif 364 endif
359 endif 365 endif
360 endif 366 endif
@@ -364,29 +370,29 @@ endif
364 370
365ifndef NO_STRLCPY 371ifndef NO_STRLCPY
366 ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y) 372 ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y)
367 BASIC_CFLAGS += -DHAVE_STRLCPY 373 CFLAGS += -DHAVE_STRLCPY
368 endif 374 endif
369endif 375endif
370 376
371ifndef NO_ON_EXIT 377ifndef NO_ON_EXIT
372 ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT),y) 378 ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT),y)
373 BASIC_CFLAGS += -DHAVE_ON_EXIT 379 CFLAGS += -DHAVE_ON_EXIT
374 endif 380 endif
375endif 381endif
376 382
377ifndef NO_BACKTRACE 383ifndef NO_BACKTRACE
378 ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT),y) 384 ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT),y)
379 BASIC_CFLAGS += -DBACKTRACE_SUPPORT 385 CFLAGS += -DBACKTRACE_SUPPORT
380 endif 386 endif
381endif 387endif
382 388
383ifndef NO_LIBNUMA 389ifndef NO_LIBNUMA
384 FLAGS_LIBNUMA = $(ALL_CFLAGS) $(ALL_LDFLAGS) -lnuma 390 FLAGS_LIBNUMA = $(CFLAGS) $(ALL_LDFLAGS) -lnuma
385 ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y) 391 ifneq ($(call try-cc,$(SOURCE_LIBNUMA),$(FLAGS_LIBNUMA),libnuma),y)
386 msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev); 392 msg := $(warning No numa.h found, disables 'perf bench numa mem' benchmark, please install numa-libs-devel or libnuma-dev);
387 NO_LIBNUMA := 1 393 NO_LIBNUMA := 1
388 else 394 else
389 BASIC_CFLAGS += -DLIBNUMA_SUPPORT 395 CFLAGS += -DLIBNUMA_SUPPORT
390 EXTLIBS += -lnuma 396 EXTLIBS += -lnuma
391 endif 397 endif
392endif 398endif
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index 6b0ed322907e..58ea5ca6c255 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -18,8 +18,9 @@ class install_lib(_install_lib):
18 self.build_dir = build_lib 18 self.build_dir = build_lib
19 19
20 20
21cflags = ['-fno-strict-aliasing', '-Wno-write-strings'] 21cflags = getenv('CFLAGS', '').split()
22cflags += getenv('CFLAGS', '').split() 22# switch off several checks (need to be at the end of cflags list)
23cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter' ]
23 24
24build_lib = getenv('PYTHON_EXTBUILD_LIB') 25build_lib = getenv('PYTHON_EXTBUILD_LIB')
25build_tmp = getenv('PYTHON_EXTBUILD_TMP') 26build_tmp = getenv('PYTHON_EXTBUILD_TMP')