summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--patches/06_fix-use-of-undefined-asort-awk-function.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/patches/06_fix-use-of-undefined-asort-awk-function.patch b/patches/06_fix-use-of-undefined-asort-awk-function.patch
index 37a6295..fd53a6d 100644
--- a/patches/06_fix-use-of-undefined-asort-awk-function.patch
+++ b/patches/06_fix-use-of-undefined-asort-awk-function.patch
@@ -2,6 +2,24 @@ From: "P. J. McDermott" <pjm@nac.net>
Description: Don't use asort() and asorti() awk functions
BusyBox awk doesn't define them and they aren't necessary for simple array
iteration.
+ .
+ Also, fix some newlines in errlist-compat.awk. POSIX.1-2008 states, "a
+ <newline> shall not occur within a string constant." GNU Awk allows newlines
+ in strings and allows them to be escaped. BusyBox awk also allows newlines in
+ strings, but it ignores any preceeding backslash.
+ .
+ As a result, in BusyBox awk, erroneous newlines are added to errlist-compat.c,
+ including in the string in the link_warning macro. This causes the following
+ warnings and errors:
+ .
+ gcc ../sysdeps/gnu/errlist.c -c [...]
+ In file included from ../sysdeps/gnu/errlist.c:1482:0:
+ /usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/stdio-common/errlist-compat.c:87:28: warning: missing terminating " character [enabled by default]
+ /usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/stdio-common/errlist-compat.c:88:59: warning: missing terminating ' character [enabled by default]
+ /usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/stdio-common/errlist-compat.c:90:25: warning: missing terminating " character [enabled by default]
+ /usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/stdio-common/errlist-compat.c:91:56: warning: missing terminating ' character [enabled by default]
+ /usr/src/eglibc_2.17~r22751+sip1-1/tmp/libcbuild/stdio-common/errlist-compat.c:91:0: error: unterminated argument list invoking macro "link_warning"
+ ../sysdeps/gnu/errlist.c:1483:0: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
diff -Naur src.orig/libc/scripts/option-groups.awk src/libc/scripts/option-groups.awk
--- src.orig/libc/scripts/option-groups.awk 2007-12-13 13:16:57.000000000 -0500
@@ -35,3 +53,43 @@ diff -Naur src.orig/libc/sysdeps/gnu/errlist-compat.awk src/libc/sysdeps/gnu/err
new = compat[old];
n = vcount[old];
printf "#if SHLIB_COMPAT (libc, %s, %s)\n", old, new;
+@@ -113,21 +111,23 @@
+ printf "#endif\n\n";
+ }
+
+- printf "\
+-extern const char *const __sys_errlist_internal[NERR];\n\
+-extern const int __sys_nerr_internal;\n\
+-strong_alias (_sys_errlist_internal, __sys_errlist_internal)\n\
+-strong_alias (_sys_nerr_internal, __sys_nerr_internal)\n\
+-extern const char *const sys_errlist[NERR];\n\
+-versioned_symbol (libc, _sys_errlist_internal, sys_errlist, %s);\n\
+-versioned_symbol (libc, __sys_errlist_internal, _sys_errlist, %s);\n\
+-versioned_symbol (libc, _sys_nerr_internal, sys_nerr, %s);\n\
+-versioned_symbol (libc, __sys_nerr_internal, _sys_nerr, %s);\n", \
+- lastv, lastv, lastv, lastv;
++ printf "extern const char *const __sys_errlist_internal[NERR];\n"
++ printf "extern const int __sys_nerr_internal;\n"
++ printf "strong_alias (_sys_errlist_internal, __sys_errlist_internal)\n"
++ printf "strong_alias (_sys_nerr_internal, __sys_nerr_internal)\n"
++ printf "extern const char *const sys_errlist[NERR];\n"
++ printf "versioned_symbol (libc, _%s_internal, %s, %s);\n", \
++ "sys_errlist", "sys_errlist", lastv;
++ printf "versioned_symbol (libc, _%s_internal, %s, %s);\n", \
++ "_sys_errlist", "_sys_errlist", lastv;
++ printf "versioned_symbol (libc, _%s_internal, %s, %s);\n", \
++ "sys_nerr", "sys_nerr", lastv;
++ printf "versioned_symbol (libc, _%s_internal, %s, %s);\n", \
++ "_sys_nerr", "_sys_nerr", lastv;
+
+- print "\n\
+-link_warning (sys_errlist, \"\
+-`sys_errlist' is deprecated; use `strerror' or `strerror_r' instead\")\n\
+-link_warning (sys_nerr, \"\
+-`sys_nerr' is deprecated; use `strerror' or `strerror_r' instead\")";
++ printf "\n"
++ printf "link_warning (sys_errlist, \"`sys_errlist' "
++ printf "is deprecated; use `strerror' or `strerror_r' instead\")\n"
++ printf "link_warning (sys_nerr, \"`sys_nerr' "
++ printf "is deprecated; use `strerror' or `strerror_r' instead\")";
+ }