提交 867c8a45 编写于 作者: K KP Singh 提交者: Caspar Zhang

samples/bpf: Add a workaround for asm_inline

to #29262413

commit 98beb3edeb974e906a81f305d88f7bc96b2ec83e upstream.

This was added in commit eb111869301e ("compiler-types.h: add asm_inline
definition") and breaks samples/bpf as clang does not support asm __inline.

Fixes: eb111869301e ("compiler-types.h: add asm_inline definition")
Co-developed-by: NFlorent Revest <revest@google.com>
Signed-off-by: NFlorent Revest <revest@google.com>
Signed-off-by: NKP Singh <kpsingh@google.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Acked-by: NSong Liu <songliubraving@fb.com>
Acked-by: NAndrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20191002191652.11432-1-kpsingh@chromium.orgSigned-off-by: NDust Li <dust.li@linux.alibaba.com>
Acked-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
上级 3637cf04
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
#ifndef __ASM_GOTO_WORKAROUND_H #ifndef __ASM_GOTO_WORKAROUND_H
#define __ASM_GOTO_WORKAROUND_H #define __ASM_GOTO_WORKAROUND_H
/* this will bring in asm_volatile_goto macro definition /*
* This will bring in asm_volatile_goto and asm_inline macro definitions
* if enabled by compiler and config options. * if enabled by compiler and config options.
*/ */
#include <linux/types.h> #include <linux/types.h>
...@@ -13,5 +14,15 @@ ...@@ -13,5 +14,15 @@
#define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto") #define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto")
#endif #endif
/*
* asm_inline is defined as asm __inline in "include/linux/compiler_types.h"
* if supported by the kernel's CC (i.e CONFIG_CC_HAS_ASM_INLINE) which is not
* supported by CLANG.
*/
#ifdef asm_inline
#undef asm_inline
#define asm_inline asm
#endif
#define volatile(x...) volatile("") #define volatile(x...) volatile("")
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册