Skip to content

Commit 06bd48b

Browse files
committed
lib/raid6/test: fix build on distros whose /bin/sh is not bash
You can build a user-space test program for the raid6 library code, like this: $ cd lib/raid6/test $ make The command in $(shell ...) function is evaluated by /bin/sh by default. (or, you can specify the shell by passing SHELL=<shell> from command line) Currently '>&/dev/null' is used to sink both stdout and stderr. Because this code is bash-ism, it only works when /bin/sh is a symbolic link to bash (this is the case on RHEL etc.) This does not work on Ubuntu where /bin/sh is a symbolic link to dash. I see lots of /bin/sh: 1: Syntax error: Bad fd number and warning "your version of binutils lacks ... support" Replace it with portable '>/dev/null 2>&1'. Fixes: 4f8c55c ("lib/raid6: build proper files on corresponding arch") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: H. Peter Anvin (Intel) <hpa@zytor.com> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Acked-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
1 parent 7d538b5 commit 06bd48b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎lib/raid6/test/Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ endif
3535
ifeq ($(IS_X86),yes)
3636
OBJS += mmx.o sse1.o sse2.o avx2.o recov_ssse3.o recov_avx2.o avx512.o recov_avx512.o
3737
CFLAGS += $(shell echo "pshufb %xmm0, %xmm0" | \
38-
gcc -c -x assembler - >&/dev/null && \
38+
gcc -c -x assembler - >/dev/null 2>&1 && \
3939
rm ./-.o && echo -DCONFIG_AS_SSSE3=1)
4040
CFLAGS += $(shell echo "vpbroadcastb %xmm0, %ymm1" | \
41-
gcc -c -x assembler - >&/dev/null && \
41+
gcc -c -x assembler - >/dev/null 2>&1 && \
4242
rm ./-.o && echo -DCONFIG_AS_AVX2=1)
4343
CFLAGS += $(shell echo "vpmovm2b %k1, %zmm5" | \
44-
gcc -c -x assembler - >&/dev/null && \
44+
gcc -c -x assembler - >/dev/null 2>&1 && \
4545
rm ./-.o && echo -DCONFIG_AS_AVX512=1)
4646
else ifeq ($(HAS_NEON),yes)
4747
OBJS += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o

0 commit comments

Comments
 (0)