Skip to content

Commit 7b3c70c

Browse files
xen0nliu-song-6
authored andcommitted
raid6: test: only check for Altivec if building on powerpc hosts
Altivec is only available for powerpc hosts, so only check for its availability when the host is powerpc, to avoid error messages being shown on architectures other than x86, arm or powerpc. Signed-off-by: WANG Xuerui <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
1 parent 6601f5e commit 7b3c70c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lib/raid6/test/Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ ifeq ($(ARCH),aarch64)
3535
HAS_NEON = yes
3636
endif
3737

38+
ifeq ($(findstring ppc,$(ARCH)),ppc)
39+
CFLAGS += -I../../../arch/powerpc/include
40+
HAS_ALTIVEC := $(shell printf '$(pound)include <altivec.h>\nvector int a;\n' |\
41+
gcc -c -x c - >/dev/null && rm ./-.o && echo yes)
42+
endif
43+
3844
ifeq ($(IS_X86),yes)
3945
OBJS += mmx.o sse1.o sse2.o avx2.o recov_ssse3.o recov_avx2.o avx512.o recov_avx512.o
4046
CFLAGS += -DCONFIG_X86
@@ -44,15 +50,10 @@ ifeq ($(IS_X86),yes)
4450
else ifeq ($(HAS_NEON),yes)
4551
OBJS += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
4652
CFLAGS += -DCONFIG_KERNEL_MODE_NEON=1
47-
else
48-
HAS_ALTIVEC := $(shell printf '$(pound)include <altivec.h>\nvector int a;\n' |\
49-
gcc -c -x c - >/dev/null && rm ./-.o && echo yes)
50-
ifeq ($(HAS_ALTIVEC),yes)
51-
CFLAGS += -I../../../arch/powerpc/include
52-
CFLAGS += -DCONFIG_ALTIVEC
53-
OBJS += altivec1.o altivec2.o altivec4.o altivec8.o \
54-
vpermxor1.o vpermxor2.o vpermxor4.o vpermxor8.o
55-
endif
53+
else ifeq ($(HAS_ALTIVEC),yes)
54+
CFLAGS += -DCONFIG_ALTIVEC
55+
OBJS += altivec1.o altivec2.o altivec4.o altivec8.o \
56+
vpermxor1.o vpermxor2.o vpermxor4.o vpermxor8.o
5657
endif
5758

5859
.c.o:

0 commit comments

Comments
 (0)