Skip to content

Commit

Permalink
arm: include: asm: unified: mask .syntax unified for clang
Browse files Browse the repository at this point in the history
It allows to build samples/bpf for arm on target board.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
  • Loading branch information
ikhorn committed Aug 13, 2019
1 parent 2c6c6d5 commit aa645cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions arch/arm/include/asm/swab.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ static inline __attribute_const__ __u32 __arch_swahb32(__u32 x)
__asm__ ("rev16 %0, %1" : "=r" (x) : "r" (x));
return x;
}

#ifndef CONFIG_BUILD_CLANG_BPF
#define __arch_swahb32 __arch_swahb32
#define __arch_swab16(x) ((__u16)__arch_swahb32(x))
#endif

static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
{
Expand Down
8 changes: 7 additions & 1 deletion arch/arm/include/asm/unified.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
#if defined(__ASSEMBLY__)
.syntax unified
#else
__asm__(".syntax unified");

#ifdef CONFIG_BUILD_CLANG_BPF
#pragma clang diagnostic ".syntax unified" ignored
#else
__asm__(".syntax unified");
#endif

#endif

#ifdef CONFIG_CPU_V7M
Expand Down
1 change: 1 addition & 0 deletions samples/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ $(obj)/%.o: $(src)/%.c
-D__KERNEL__ -D__BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign \
-D__TARGET_ARCH_$(SRCARCH) -Wno-compare-distinct-pointer-types \
-D__LINUX_ARM_ARCH__=7 \
-DCONFIG_BUILD_CLANG_BPF \
-Wno-gnu-variable-sized-type-not-at-end \
-Wno-address-of-packed-member -Wno-tautological-compare \
-Wno-unknown-warning-option $(CLANG_ARCH_ARGS) \
Expand Down

0 comments on commit aa645cc

Please sign in to comment.