summary refs log tree commit diff
path: root/sysdeps/unix/Makefile
diff options
context:
space:
mode:
authorPatrick 'P. J.' McDermott <pj@pehjota.net>2013-09-11 17:53:08 -0400
committerMike Frysinger <vapier@gentoo.org>2013-09-28 23:03:09 -0400
commit0a834ddecbb08b79cbcf7d9460ab3d3d539c9962 (patch)
tree95f9050e7fdcebc7468978139ec2738b834f262b /sysdeps/unix/Makefile
parente74a6fd9067e41bffe12406fc86277132bad5043 (diff)
downloadglibc-0a834ddecbb08b79cbcf7d9460ab3d3d539c9962.tar.gz
glibc-0a834ddecbb08b79cbcf7d9460ab3d3d539c9962.tar.xz
glibc-0a834ddecbb08b79cbcf7d9460ab3d3d539c9962.zip
don't use Bash-specific ${parameter/pattern/string} expansion
sysdeps/unix/make-syscalls.sh and sysdeps/unix/Makefile use GNU Bash's
${parameter/pattern/string} parameter expansion.  Non-Bash shells (e.g.
dash or BusyBox ash when built with CONFIG_ASH_BASH_COMPAT disabled)
don't support this expansion syntax.  So glibc will fail to build when
$(SHELL) expands to a path that isn't provided by Bash.

An example build failure:

    for dir in [...]; do \
      test -f $dir/syscalls.list && \
      { sysdirs='[...]' \
        asm_CPP='gcc -c    -I[...]   -D_LIBC_REENTRANT -include include/libc-symbols.h       -DASSEMBLER  -g -Wa,--noexecstack   -E -x assembler-with-cpp' \
        /bin/sh sysdeps/unix/make-syscalls.sh $dir || exit 1; }; \
      test $dir = sysdeps/unix && break; \
    done > [build-dir]/sysd-syscallsT
    sysdeps/unix/make-syscalls.sh: line 273: syntax error: bad substitution

This patch simply replaces the three instances of the Bash-only syntax
in these files with an echo and sed command substitution.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sysdeps/unix/Makefile')
-rw-r--r--sysdeps/unix/Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
index 375561f0d0..2b607a007a 100644
--- a/sysdeps/unix/Makefile
+++ b/sysdeps/unix/Makefile
@@ -51,12 +51,14 @@ $(objpfx)stub-syscalls.c: $(common-objpfx)sysd-syscalls \
 	 for call in $(unix-stub-syscalls); do \
 	   case $$call in \
 	   *@@*) \
-	     ver=$${call##*@}; call=$${call%%@*}; ver=$${ver//./_}; \
+	     ver=$${call##*@}; call=$${call%%@*}; \
+	     ver=`echo "$ver" | sed 's/\./_/g'`; \
 	     echo "strong_alias (_no_syscall, __$${call}_$${ver})"; \
 	     echo "versioned_symbol (libc, __$${call}_$${ver}, $$call, $$ver);"\
 	     ;; \
 	   *@*) \
-	     ver=$${call##*@}; call=$${call%%@*}; ver=$${ver//./_}; \
+	     ver=$${call##*@}; call=$${call%%@*}; \
+	     ver=`echo "$ver" | sed 's/\./_/g'`; \
 	     echo "strong_alias (_no_syscall, __$${call}_$${ver})"; \
 	     echo "compat_symbol (libc, __$${call}_$${ver}, $$call, $$ver);" \
 	     ;; \