From: Ian Rogers Date: Mon, 24 Jul 2023 20:12:47 +0000 (-0700) Subject: perf build: Add LTO build option X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c126ac4a2003fff398311739514f173944a5ceab;p=linux.git perf build: Add LTO build option Add an LTO build option, that sets the appropriate CFLAGS and CXXFLAGS values. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: Fangrui Song Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Tom Rix Cc: Xing Zhengjun Cc: Yang Jihong Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Link: https://lore.kernel.org/r/20230724201247.748146-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index c5db0de498687..a9cfe83638a93 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -256,6 +256,11 @@ ifdef PARSER_DEBUG $(call detected_var,PARSER_DEBUG_FLEX) endif +ifdef LTO + CORE_CFLAGS += -flto + CXXFLAGS += -flto +endif + # Try different combinations to accommodate systems that only have # python[2][3]-config in weird combinations in the following order of # priority from lowest to highest: