summaryrefslogtreecommitdiffstats
path: root/patches/08_fix-bad-substitution.patch
blob: 9131a9547807845db6451d877d0eaff282455f74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From: "P. J. McDermott" <pjm@nac.net>
Description: Fix "bad substitution" errors in shell script
 sysdeps/unix/make-syscalls.sh and sysdeps/unix/Makefile use GNU Bash's
 "${parameter/pattern/string}" parameter expansion.  Non-Bash shells (e.g.
 BusyBox ash built with CONFIG_ASH_BASH_COMPAT disabled) don't support this
 syntax:
 .
    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 > /usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/sysd-syscallsT
    sysdeps/unix/make-syscalls.sh: line 273: syntax error: bad substitution
 .
 The following command will search the upstream source for this non-standard
 expansion:
 .
     grep -ERn '\${[a-zA-Z0-9_]+/[^}]*/[^}]*}' tmp/src/libc

diff -Naur src.orig/libc/sysdeps/unix/make-syscalls.sh src/libc/sysdeps/unix/make-syscalls.sh
--- src.orig/libc/sysdeps/unix/make-syscalls.sh	2012-12-02 16:11:45.000000000 -0500
+++ src/libc/sysdeps/unix/make-syscalls.sh	2013-06-25 12:01:55.178740324 -0400
@@ -279,7 +279,7 @@
     # name in the vDSO and KERNEL_X.Y is its symbol version.
     vdso_symbol="${vdso_syscall%@*}"
     vdso_symver="${vdso_syscall#*@}"
-    vdso_symver="${vdso_symver//./_}"
+    vdso_symver=`echo $vdso_symver | sed 's/\./_/g'`
     echo "\
 \$(foreach p,\$(sysd-rules-targets),\$(objpfx)\$(patsubst %,\$p,$file).os): \\
 		\$(..)sysdeps/unix/make-syscalls.sh\
diff -Naur src.orig/libc/sysdeps/unix/Makefile src/libc/sysdeps/unix/Makefile
--- src.orig/libc/sysdeps/unix/Makefile	2012-11-06 12:31:45.000000000 -0500
+++ src/libc/sysdeps/unix/Makefile	2013-06-25 12:59:59.068197711 -0400
@@ -51,12 +51,14 @@
 	 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);" \
 	     ;; \