mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-14 22:44:27 +08:00
41caff459a
These make the feature check fail when using clang, so remove them just like is done in tools/perf/Makefile.config to build perf itself. Adding -Wno-compound-token-split-by-macro to tools/perf/Makefile.config when building with clang is also necessary to avoid these warnings turned into errors (-Werror): CC /tmp/build/perf/util/scripting-engines/trace-event-perl.o In file included from util/scripting-engines/trace-event-perl.c:35: In file included from /usr/lib64/perl5/CORE/perl.h:4085: In file included from /usr/lib64/perl5/CORE/hv.h:659: In file included from /usr/lib64/perl5/CORE/hv_func.h:34: In file included from /usr/lib64/perl5/CORE/sbox32_hash.h:4: /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib64/perl5/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32' #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START { \ ^~~~~~~~~~ /usr/lib64/perl5/CORE/perl.h:737:29: note: expanded from macro 'STMT_START' # define STMT_START (void)( /* gcc supports "({ STATEMENTS; })" */ ^ /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: note: '{' token is here ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib64/perl5/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32' #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START { \ ^ /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib64/perl5/CORE/zaphod32_hash.h:87:41: note: expanded from macro 'ZAPHOD32_SCRAMBLE32' v ^= (v>>23); \ ^ /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: note: ')' token is here ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib64/perl5/CORE/zaphod32_hash.h:88:3: note: expanded from macro 'ZAPHOD32_SCRAMBLE32' } STMT_END ^~~~~~~~ /usr/lib64/perl5/CORE/perl.h:738:21: note: expanded from macro 'STMT_END' # define STMT_END ) ^ Please refer to the discussion on the Link: tag below, where Nathan clarifies the situation: <quote> acme> And then get to the problems at the end of this message, which seem acme> similar to the problem described here: acme> acme> From Nathan Chancellor <> acme> Subject [PATCH] mwifiex: Remove unnecessary braces from HostCmd_SET_SEQ_NO_BSS_INFO acme> acme> https://lkml.org/lkml/2020/9/1/135 acme> acme> So perhaps in this case its better to disable that acme> -Werror,-Wcompound-token-split-by-macro when building with clang? Yes, I think that is probably the best solution. As far as I can tell, at least in this file and context, the warning appears harmless, as the "create a GNU C statement expression from two different macros" is very much intentional, based on the presence of PERL_USE_GCC_BRACE_GROUPS. The warning is fixed in upstream Perl by just avoiding creating GNU C statement expressions using STMT_START and STMT_END: https://github.com/Perl/perl5/issues/18780 https://github.com/Perl/perl5/pull/18984 If I am reading the source code correctly, an alternative to disabling the warning would be specifying -DPERL_GCC_BRACE_GROUPS_FORBIDDEN but it seems like that might end up impacting more than just this site, according to the issue discussion above. </quote> Based-on-a-patch-by: Sedat Dilek <sedat.dilek@gmail.com> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # Debian/Selfmade LLVM-14 (x86-64) Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Fangrui Song <maskray@google.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Keeping <john@metanate.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Link: http://lore.kernel.org/lkml/YkxWcYzph5pC1EK8@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> |
||
---|---|---|
.. | ||
.gitignore | ||
Makefile | ||
test-all.c | ||
test-backtrace.c | ||
test-bionic.c | ||
test-bpf.c | ||
test-clang-bpf-co-re.c | ||
test-clang.cpp | ||
test-compile.c | ||
test-cplus-demangle.c | ||
test-cxx.cpp | ||
test-disassembler-four-args.c | ||
test-dwarf_getlocations.c | ||
test-dwarf.c | ||
test-eventfd.c | ||
test-file-handle.c | ||
test-fortify-source.c | ||
test-get_cpuid.c | ||
test-get_current_dir_name.c | ||
test-gettid.c | ||
test-glibc.c | ||
test-gtk2-infobar.c | ||
test-gtk2.c | ||
test-hello.c | ||
test-jvmti-cmlr.c | ||
test-jvmti.c | ||
test-libaio.c | ||
test-libaudit.c | ||
test-libbabeltrace.c | ||
test-libbfd-buildid.c | ||
test-libbfd.c | ||
test-libbpf.c | ||
test-libcap.c | ||
test-libcrypto.c | ||
test-libdebuginfod.c | ||
test-libdw-dwarf-unwind.c | ||
test-libelf-gelf_getnote.c | ||
test-libelf-getphdrnum.c | ||
test-libelf-getshdrstrndx.c | ||
test-libelf.c | ||
test-libnuma.c | ||
test-libopencsd.c | ||
test-libperl.c | ||
test-libpfm4.c | ||
test-libpython.c | ||
test-libslang-include-subdir.c | ||
test-libslang.c | ||
test-libtraceevent.c | ||
test-libtracefs.c | ||
test-libunwind-aarch64.c | ||
test-libunwind-arm.c | ||
test-libunwind-debug-frame-aarch64.c | ||
test-libunwind-debug-frame-arm.c | ||
test-libunwind-debug-frame.c | ||
test-libunwind-x86_64.c | ||
test-libunwind-x86.c | ||
test-libunwind.c | ||
test-libzstd.c | ||
test-llvm-version.cpp | ||
test-llvm.cpp | ||
test-lzma.c | ||
test-numa_num_possible_cpus.c | ||
test-pthread-attr-setaffinity-np.c | ||
test-pthread-barrier.c | ||
test-reallocarray.c | ||
test-sched_getcpu.c | ||
test-sdt.c | ||
test-setns.c | ||
test-stackprotector-all.c | ||
test-timerfd.c | ||
test-zlib.c |