forked from Mirrors/opensbi
grep -e "-mstrict-align\|-mno-unaligned-access" makes use of GNU grep's backslash-escaped alternation operator \| which is available in basic regular expression syntax (BRE) mode. However, in POSIX grep's BRE mode | is an ordinary character which, when backslash-escaped, matches itself. Therefore, the search pattern becomes a plain string '-mstrict-align|-mno-unaligned-access' which obviously never matches the expected error and CC_SUPPORT_STRICT_ALIGN is always set to y. When cross-compiling with LLVM on amd64-unknown-openbsd7.6 host for riscv64-unknown-elf target this results in a compilation error: clang: error: unsupported option '-mno-unaligned-access' for target 'riscv64-unknown-elf' Using multiple -e options for this case maintains consistent behaviour across different grep implementations and fixes the issue. Signed-off-by: Igor Melnikov <imel@purelymail.com> Reviewed-by: Anup Patel <anup@brainfault.org>
25 KiB
25 KiB