tools: feature/test-libperl.c: Sync PERL_EMBED_CCOPTS with perf
PATCH 1/1 tools: feature/test-libperl.c: Sync PERL_EMBED_CCOPTS with perf
When trying to build perf with a LLVM/Clang toolchain people see errors when testing for libperl feature.
Jiri reports:
Quoted 5 lines
I'm getting some other lto related error:
$ cat test-libperl.make.output clang-13: error: optimization flag '-ffat-lto-objects' is not supported [-Werror,-Wignored-optimization-argument]
The reason is PERL_EMBED_CCOPTS is defined in two places:
tools/build/feature/Makefiletools/perf/Makefile.config
As a result FLAGS_PERL_EMBED is set differently.
For building perf '-ffat-lto-objects' is filtered out:
$ git grep ffat-lto-objects tools/perf/ tools/perf/Makefile.config: PERL_EMBED_CCOPTS := $(filter-out -flto=auto -ffat-lto-objects, $(PERL_EMBED_CCOPTS))
Sync PERL_EMBED_CCOPTS in tools/build/feature/Makefile to fix this.
For a minimal fix for Linux v5.17 this here was preferred by Arnaldo.
Link https://lore.kernel.org/lkml/CA+icZUWHd4VTKNwBtuxt9-fHoiYV+Q7tQ809Cn83k8sbQ_uNHw@mail.gmail.com/ open here
Reported-by Jiri Olsa <[email protected]>
Reported-by Arnaldo Carvalho de Melo <[email protected]>
Suggested-by Arnaldo Carvalho de Melo <[email protected]>
Reviewed-by Nick Desaulniers <[email protected]>
Signed-off-by Sedat Dilek <[email protected]>
---
Changes v1->v2:
- Fix some typos and use lore link as requested by Nick
- Add credits for Nick
tools/build/feature/Makefile | 1 + 1 file changed, 1 insertion(+)
tools/build/feature/Makefile +1 -0
@@ -218,6 +218,7 @@ PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` +PERL_EMBED_CCOPTS := $(filter-out -ffat-lto-objects, $(PERL_EMBED_CCOPTS)) FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) $(OUTPUT)test-libperl.bin:
Signature · 1 line
2.35.1