On 11/2/22 18:29, Joseph Myers wrote:
On Wed, 2 Nov 2022, Christophe Lyon via Gcc-patches wrote:
+# Sanity check: make sure we have as many dirnames as options
+if [ -n "${dirnames}" ]; then
+ options_arr=($options)
This is an sh script; arrays are a bash feature. Building GCC isn't
supposed to need bash (or to rely on $(SHELL) being bash, even when bash
is available - many GNU/Linux systems use dash for /bin/sh), only a POSIX
shell.
That's what I feared, and I did "try to try" to build with dash, but I
realize now that changing SHELL in the generated gcc/Makefile is not
enough since it's defined by the higher level Makefile/config.status.
Indeed rebuilding from scratch with CONFIG_SHELL=/bin/dash fails with my
patch.
We have lived with that behavior for years, so it's not that bad anyway :-)
Thanks,
Christophe