[OS-BUILD PATCH] perf tools: Fix compile error for x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Yang Jihong <yangjihong1@xxxxxxxxxx>

perf tools: Fix compile error for x86

Commit a0a12c3ed057 ("asm goto: eradicate CC_HAS_ASM_GOTO") eradicates
CC_HAS_ASM_GOTO, perf on x86 call asm_volatile_goto when compiling __GEN_RMWcc.
However, asm_volatile_goto is not declared, which causes compilation error:

In file included from /home/linux/tools/include/asm/../../arch/x86/include/asm/atomic.h:7,
                 from /home/linux/tools/include/asm/atomic.h:6,
                 from /home/linux/tools/include/linux/atomic.h:5,
                 from /home/linux/tools/include/linux/refcount.h:41,
                 from /home/linux/tools/lib/perf/include/internal/cpumap.h:5,
                 from /home/linux/tools/perf/util/cpumap.h:7,
                 from /home/linux/tools/perf/util/env.h:7,
                 from /home/linux/tools/perf/util/header.h:12,
                 from pmu-events/pmu-events.c:9:
/home/linux/tools/include/asm/../../arch/x86/include/asm/atomic.h: In function ‘atomic_dec_and_test’:
/home/linux/tools/include/asm/../../arch/x86/include/asm/rmwcc.h:7:2: error: implicit declaration of function ‘asm_volatile_goto’ [-Werror=implicit-function-declaration]
  asm_volatile_goto (fullop "; j" cc " %l[cc_label]"  \
  ^~~~~~~~~~~~~~~~~

Solution:
Define asm_volatile_goto in compiler_types.h if not declared.

Currently, only x86 architecture uses asm_volatile_goto.
Theoretically, this patch affects only the x86 architecture.

Fixes: a0a12c3ed057 ("asm goto: eradicate CC_HAS_ASM_GOTO")
Signed-off-by: Yang Jihong <yangjihong1@xxxxxxxxxx>
Tested-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Tested-by: Ingo Molnar <mingo@xxxxxxxxxx>

diff --git a/tools/include/linux/compiler_types.h b/tools/include/linux/compiler_types.h
index blahblah..blahblah 100644
--- a/tools/include/linux/compiler_types.h
+++ b/tools/include/linux/compiler_types.h
@@ -36,4 +36,8 @@
 #include <linux/compiler-gcc.h>
 #endif
 
+#ifndef asm_volatile_goto
+#define asm_volatile_goto(x...) asm goto(x)
+#endif
+
 #endif /* __LINUX_COMPILER_TYPES_H */

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1992
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux