Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf python: Ignore unused command line arguments when building with clang

Noticed after switching to python3 by default on some older fedora
releases:

35 38.20 fedora:27 : FAIL clang version 5.0.2 (tags/RELEASE_502/final)
clang-5.0: error: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' [-Werror,-Wunused-command-line-argument]
clang-5.0: error: argument unused during compilation: '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' [-Werror,-Wunused-command-line-argument]
error: command 'clang' failed with exit status 1

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+7 -1
+4
tools/perf/scripts/perl/Perf-Trace-Util/Build
··· 3 3 CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-bad-function-cast -Wno-declaration-after-statement -Wno-switch-enum 4 4 CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef 5 5 CFLAGS_Context.o += -Wno-switch-default -Wno-shadow 6 + 7 + ifeq ($(CC_NO_CLANG), 1) 8 + CFLAGS_Context.o += -Wno-unused-command-line-argument 9 + endif
+3 -1
tools/perf/util/setup.py
··· 48 48 cflags = getenv('CFLAGS', '').split() 49 49 # switch off several checks (need to be at the end of cflags list) 50 50 cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls', '-DPYTHON_PERF' ] 51 - if not cc_is_clang: 51 + if cc_is_clang: 52 + cflags += ["-Wno-unused-command-line-argument" ] 53 + else: 52 54 cflags += ['-Wno-cast-function-type' ] 53 55 54 56 src_perf = getenv('srctree') + '/tools/perf'