123elf
123elf copied to clipboard
binutils.sh throws an error if path to directory contains a blank
binutils.sh fails, if the path to the directory contains a blank.
Example: Compiling binutils in this directory fails: /home/user/Documents/My Documents/123elf
Compiling binutils in this directory works for me (on the same system, Debian Bullseye 11): /home/user/Documents/123elf
What's the error? This issue can come from unquoted variables, but I don't see any in the script. Unless the problem is in the binutils tarball from GNU which will be hard to track down without a specific error message.
Hmm, that's unfortunate - I just confirmed that binutils can't be built in a directory with a space.
I guess we could mktemp -d -p /tmp
or whatever.
@roboklon Is this using WSL2? Another user told me they had to use the "short path", like cd /mnt/c/Documents/mydocu~1/123elf
, but I didn't understand it was because of the space until your report.
The bug is upstream, in the binutils Makefile. Shell scripts used to configure sub-components use unqoted variables. Example:
.PHONY: configure-zlib maybe-configure-zlib
maybe-configure-zlib:
maybe-configure-zlib: configure-zlib
configure-zlib:
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \
$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib; \
$(HOST_EXPORTS) \
echo Configuring in $(HOST_SUBDIR)/zlib; \
cd "$(HOST_SUBDIR)/zlib" || exit 1; \
case $(srcdir) in \
/* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
*) topdir=`echo $(HOST_SUBDIR)/zlib/ | \
sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
esac; \
module_srcdir=zlib; \
$(SHELL) \
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
--target=${target_alias} \
|| exit 1
You can see e.g. unquoted $(srcdir)
etc.
This bug should be reported (and eventually fixed) upstream, in GNU binutils.