public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] tools: feature/test-libperl.c: Sync PERL_EMBED_CCOPTS with perf
@ 2022-03-10  6:19 Sedat Dilek
  2022-03-10 20:59 ` Nick Desaulniers
  2022-03-11 11:56 ` Jiri Olsa
  0 siblings, 2 replies; 6+ messages in thread
From: Sedat Dilek @ 2022-03-10  6:19 UTC (permalink / raw)
  To: Nathan Chancellor, Nick Desaulniers, Arnaldo Carvalho de Melo,
	Ian Rogers, Florian Fainelli, Fangrui Song, Jiri Olsa,
	Michael Petlan, Leo Yan, John Keeping, Sedat Dilek, linux-kernel,
	llvm
  Cc: Jiri Olsa, Arnaldo Carvalho de Melo

When trying to build perf with a LLVM/Clang toolchain people see errors
when testing for libperl feature.

Jiri reports:

> 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/Makefile
tools/perf/Makefile.config

As an 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://marc.info/?t=164646683300002&r=1&w=2
Reported-by: Jiri Olsa <olsajiri@gmail.com>
Reported-by: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Suggested-by: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/build/feature/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 1480910c792e..869073cf8449 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -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:
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-12  1:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-10  6:19 [PATCH] tools: feature/test-libperl.c: Sync PERL_EMBED_CCOPTS with perf Sedat Dilek
2022-03-10 20:59 ` Nick Desaulniers
2022-03-11 11:56 ` Jiri Olsa
2022-03-11 23:30   ` Sedat Dilek
2022-03-11 23:39     ` Sedat Dilek
2022-03-12  1:41       ` Sedat Dilek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox