From: Masahiro Yamada <masahiroy@kernel.org>
To: x86@kernel.org, Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>, "H . Peter Anvin" <hpa@zytor.com>,
linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Masahiro Yamada <masahiroy@kernel.org>,
Jim Kukunas <james.t.kukunas@linux.intel.com>,
NeilBrown <neilb@suse.de>,
Yuanhan Liu <yuanhan.liu@linux.intel.com>
Subject: [PATCH v2 1/9] lib/raid6/test: fix build on distros whose /bin/sh is not bash
Date: Tue, 24 Mar 2020 09:13:50 +0900 [thread overview]
Message-ID: <20200324001358.4520-2-masahiroy@kernel.org> (raw)
In-Reply-To: <20200324001358.4520-1-masahiroy@kernel.org>
You can test raid6 library code from user-space, like this:
$ cd lib/raid6/test
$ make
The command in $(shell ...) function is evaluated by /bin/sh by default.
(or, you can change the default shell by setting 'SHELL' in Makefile)
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: 4f8c55c5ad49 ("lib/raid6: build proper files on corresponding arch")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Changes in v2:
- New patch
lib/raid6/test/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/raid6/test/Makefile b/lib/raid6/test/Makefile
index 3ab8720aa2f8..b9e6c3648be1 100644
--- a/lib/raid6/test/Makefile
+++ b/lib/raid6/test/Makefile
@@ -35,13 +35,13 @@ endif
ifeq ($(IS_X86),yes)
OBJS += mmx.o sse1.o sse2.o avx2.o recov_ssse3.o recov_avx2.o avx512.o recov_avx512.o
CFLAGS += $(shell echo "pshufb %xmm0, %xmm0" | \
- gcc -c -x assembler - >&/dev/null && \
+ gcc -c -x assembler - >/dev/null 2>&1 && \
rm ./-.o && echo -DCONFIG_AS_SSSE3=1)
CFLAGS += $(shell echo "vpbroadcastb %xmm0, %ymm1" | \
- gcc -c -x assembler - >&/dev/null && \
+ gcc -c -x assembler - >/dev/null 2>&1 && \
rm ./-.o && echo -DCONFIG_AS_AVX2=1)
CFLAGS += $(shell echo "vpmovm2b %k1, %zmm5" | \
- gcc -c -x assembler - >&/dev/null && \
+ gcc -c -x assembler - >/dev/null 2>&1 && \
rm ./-.o && echo -DCONFIG_AS_AVX512=1)
else ifeq ($(HAS_NEON),yes)
OBJS += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
--
2.17.1
next prev parent reply other threads:[~2020-03-24 0:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-24 0:13 [PATCH v2 0/9] x86: remove always-defined CONFIG_AS_* options Masahiro Yamada
2020-03-24 0:13 ` Masahiro Yamada [this message]
2020-03-24 0:22 ` [PATCH v2 1/9] lib/raid6/test: fix build on distros whose /bin/sh is not bash H. Peter Anvin
2020-03-24 0:13 ` [PATCH v2 2/9] x86: remove unneeded defined(__ASSEMBLY__) check from asm/dwarf2.h Masahiro Yamada
2020-03-24 0:13 ` [PATCH v2 3/9] x86: remove always-defined CONFIG_AS_CFI Masahiro Yamada
2020-03-24 0:13 ` [PATCH v2 4/9] x86: remove unneeded (CONFIG_AS_)CFI_SIGNAL_FRAME Masahiro Yamada
2020-03-24 0:13 ` [PATCH v2 5/9] x86: remove always-defined CONFIG_AS_CFI_SECTIONS Masahiro Yamada
2020-03-24 0:13 ` [PATCH v2 6/9] x86: remove always-defined CONFIG_AS_SSSE3 Masahiro Yamada
2020-03-24 0:13 ` [PATCH v2 7/9] x86: remove always-defined CONFIG_AS_AVX Masahiro Yamada
2020-03-24 0:13 ` [PATCH v2 8/9] x86: add comments about the binutils version to support code in as-instr Masahiro Yamada
2020-03-24 0:13 ` [PATCH v2 9/9] x86: replace arch macros from compiler with CONFIG_X86_{32,64} Masahiro Yamada
2020-03-24 0:23 ` H. Peter Anvin
2020-03-24 0:29 ` [PATCH v2 0/9] x86: remove always-defined CONFIG_AS_* options Jason A. Donenfeld
2020-03-24 0:52 ` Masahiro Yamada
2020-03-24 1:29 ` Jason A. Donenfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200324001358.4520-2-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=Jason@zx2c4.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=james.t.kukunas@linux.intel.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=neilb@suse.de \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yuanhan.liu@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.