summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-09-08 11:38:12 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-09-08 11:38:12 (EDT)
commit069f15a410c8995f1c0a858ea292735f30b5b82e (patch)
tree5993440cbd81edfad0c65b295a568eeee6e6bf0d
parentbe1578a806ae2c59ea7dbb8c178e2588d9e4fb15 (diff)
Remove awk portability patches.
glibc/eglibc 2.18 will be a bit harder to build without gawk. So we're just using gawk.
-rw-r--r--patches/03_accept-any-awk.patch57
-rw-r--r--patches/04_add-strtonum-to-conftest.patch127
-rw-r--r--patches/05_fix-bad-regex-in-awk-script.patch45
-rw-r--r--patches/06_fix-use-of-undefined-asort-awk-function.patch95
4 files changed, 0 insertions, 324 deletions
diff --git a/patches/03_accept-any-awk.patch b/patches/03_accept-any-awk.patch
deleted file mode 100644
index 4db1bb1..0000000
--- a/patches/03_accept-any-awk.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From: "P. J. McDermott" <pjm@nac.net>
-Description: Accept any awk implementation
- Use "AC_PROG_AWK" instead of "AC_CHECK_PROG_VER(AWK, gawk, ...)".
-
-diff -Naur src.orig/libc/configure src/libc/configure
---- src.orig/libc/configure 2012-12-02 16:11:45.000000000 -0500
-+++ src/libc/configure 2013-06-20 21:07:27.741343950 -0400
-@@ -5207,7 +5207,7 @@
- SED=: aux_missing="$aux_missing sed"
- fi
-
--for ac_prog in gawk
-+for ac_prog in gawk mawk nawk awk
- do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
- set dummy $ac_prog; ac_word=$2
-@@ -5250,23 +5250,6 @@
- done
-
- if test -z "$AWK"; then
-- ac_verc_fail=yes
--else
-- # Found it, now check the version.
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $AWK" >&5
--$as_echo_n "checking version of $AWK... " >&6; }
-- ac_prog_version=`$AWK --version 2>&1 | sed -n 's/^.*GNU Awk[^0-9]*\([0-9][0-9.]*\).*$/\1/p'`
-- case $ac_prog_version in
-- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-- [3-9].*)
-- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
--
-- esac
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
--$as_echo "$ac_prog_version" >&6; }
--fi
--if test $ac_verc_fail = yes; then
- critic_missing="$critic_missing gawk"
- fi
-
-diff -Naur src.orig/libc/configure.in src/libc/configure.in
---- src.orig/libc/configure.in 2012-12-02 16:11:45.000000000 -0500
-+++ src/libc/configure.in 2013-06-20 21:00:07.913300996 -0400
-@@ -972,9 +972,10 @@
- [GNU sed[^0-9]* \([0-9]*\.[0-9.]*\)],
- [3.0[2-9]*|3.[1-9]*|[4-9]*],
- SED=: aux_missing="$aux_missing sed")
--AC_CHECK_PROG_VER(AWK, gawk, --version,
-- [GNU Awk[^0-9]*\([0-9][0-9.]*\)],
-- [[3-9].*], critic_missing="$critic_missing gawk")
-+AC_PROG_AWK
-+if test -z "$AWK"; then
-+ critic_missing="$critic_missing gawk"
-+fi
-
- AC_CHECK_TOOL(NM, nm, false)
-
diff --git a/patches/04_add-strtonum-to-conftest.patch b/patches/04_add-strtonum-to-conftest.patch
deleted file mode 100644
index 675d7bb..0000000
--- a/patches/04_add-strtonum-to-conftest.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From: "P. J. McDermott" <pjm@nac.net>
-Description: Add strtonum() to generated conftest.awk
- conftest.awk uses the strtonum() function of GNU Awk to check for a linker that
- supports the "-z relro" option.
- .
- This patch adds the pure awk implementation of strtonum() found in
- awklib/eg/lib/strtonum.awk in GNU Awk to enable conftest.awk to run on other
- awk implementations.
-
-diff -Naur src.orig/libc/configure src/libc/configure
---- src.orig/libc/configure 2012-12-02 16:11:45.000000000 -0500
-+++ src/libc/configure 2013-06-20 20:13:34.122952650 -0400
-@@ -6383,14 +6383,52 @@
-
- _ACEOF
- cat > conftest.awk <<\EOF
-+# mystrtonum --- convert string to number
-+# Arnold Robbins, arnold@skeeve.com, Public Domain
-+# February, 2004
-+function mystrtonum(str, ret, chars, n, i, k, c)
-+{
-+ if (str ~ /^0[0-7]*$/) {
-+ # octal
-+ n = length(str)
-+ ret = 0
-+ for (i = 1; i <= n; i++) {
-+ c = substr(str, i, 1)
-+ if ((k = index("01234567", c)) > 0)
-+ k-- # adjust for 1-basing in awk
-+ ret = ret * 8 + k
-+ }
-+ } else if (str ~ /^0[xX][[:xdigit:]]+/) {
-+ # hexadecimal
-+ str = substr(str, 3) # lop off leading 0x
-+ n = length(str)
-+ ret = 0
-+ for (i = 1; i <= n; i++) {
-+ c = substr(str, i, 1)
-+ c = tolower(c)
-+ if ((k = index("0123456789", c)) > 0)
-+ k-- # adjust for 1-basing in awk
-+ else if ((k = index("abcdef", c)) > 0)
-+ k += 9
-+ ret = ret * 16 + k
-+ }
-+ } else if (str ~ \
-+ /^[-+]?([0-9]+([.][0-9]*([Ee][0-9]+)?)?|([.][0-9]+([Ee][-+]?[0-9]+)?))$/) {
-+ # decimal number, possibly floating point
-+ ret = str + 0
-+ } else
-+ ret = "NOT-A-NUMBER"
-+
-+ return ret
-+}
- BEGIN {
- result = "no"
-- commonpagesize = strtonum(commonpagesize)
-+ commonpagesize = mystrtonum(commonpagesize)
- }
- { print "LINE:", $0 > "/dev/stderr" }
- $1 == "GNU_RELRO" {
-- vaddr = strtonum($3)
-- memsz = strtonum($6)
-+ vaddr = mystrtonum($3)
-+ memsz = mystrtonum($6)
- end = vaddr + memsz
- printf "vaddr %#x memsz %#x end %#x commonpagesize %#x\n", \
- vaddr, memsz, end, commonpagesize > "/dev/stderr"
-diff -Naur src.orig/libc/configure.in src/libc/configure.in
---- src.orig/libc/configure.in 2012-12-02 16:11:45.000000000 -0500
-+++ src/libc/configure.in 2013-06-20 20:13:42.351194464 -0400
-@@ -1475,14 +1475,52 @@
- int data[0x10000] = { 1, };
- ]])])
- cat > conftest.awk <<\EOF
-+# mystrtonum --- convert string to number
-+# Arnold Robbins, arnold@skeeve.com, Public Domain
-+# February, 2004
-+function mystrtonum(str, ret, chars, n, i, k, c)
-+{
-+ if (str ~ /^0[0-7]*$/) {
-+ # octal
-+ n = length(str)
-+ ret = 0
-+ for (i = 1; i <= n; i++) {
-+ c = substr(str, i, 1)
-+ if ((k = index("01234567", c)) > 0)
-+ k-- # adjust for 1-basing in awk
-+ ret = ret * 8 + k
-+ }
-+ } else if (str ~ /^0[xX][[:xdigit:]]+/) {
-+ # hexadecimal
-+ str = substr(str, 3) # lop off leading 0x
-+ n = length(str)
-+ ret = 0
-+ for (i = 1; i <= n; i++) {
-+ c = substr(str, i, 1)
-+ c = tolower(c)
-+ if ((k = index("0123456789", c)) > 0)
-+ k-- # adjust for 1-basing in awk
-+ else if ((k = index("abcdef", c)) > 0)
-+ k += 9
-+ ret = ret * 16 + k
-+ }
-+ } else if (str ~ \
-+ /^[-+]?([0-9]+([.][0-9]*([Ee][0-9]+)?)?|([.][0-9]+([Ee][-+]?[0-9]+)?))$/) {
-+ # decimal number, possibly floating point
-+ ret = str + 0
-+ } else
-+ ret = "NOT-A-NUMBER"
-+
-+ return ret
-+}
- BEGIN {
- result = "no"
-- commonpagesize = strtonum(commonpagesize)
-+ commonpagesize = mystrtonum(commonpagesize)
- }
- { print "LINE:", $0 > "/dev/stderr" }
- $1 == "GNU_RELRO" {
-- vaddr = strtonum($3)
-- memsz = strtonum($6)
-+ vaddr = mystrtonum($3)
-+ memsz = mystrtonum($6)
- end = vaddr + memsz
- printf "vaddr %#x memsz %#x end %#x commonpagesize %#x\n", \
- vaddr, memsz, end, commonpagesize > "/dev/stderr"
diff --git a/patches/05_fix-bad-regex-in-awk-script.patch b/patches/05_fix-bad-regex-in-awk-script.patch
deleted file mode 100644
index cf9aeeb..0000000
--- a/patches/05_fix-bad-regex-in-awk-script.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From: "P. J. McDermott" <pjm@nac.net>
-Description: Fix "bad regex" in scripts/gen-sorted.awk
- BusyBox awk parses this:
- .
- sub(/\/[^/]+$/, "", subdir);
- .
- into this (using POSIX.1 terminal symbols):
- .
- BUILTIN_FUNC_NAME: sub
- '(': (
- ERE: \/[^
- .
- and fails because it cannot compile the regular expression "\/[^".
- .
- The slash in the bracket expression must be escaped to be parsed as expected in
- BusyBox awk.
-
-diff -Naur src.orig/libc/scripts/gen-sorted.awk src/libc/scripts/gen-sorted.awk
---- src.orig/libc/scripts/gen-sorted.awk 2006-08-16 21:18:26.000000000 -0400
-+++ src/libc/scripts/gen-sorted.awk 2013-06-21 10:37:33.855053579 -0400
-@@ -16,7 +16,7 @@
- {
- subdir = type = FILENAME;
- sub(/^.*\//, "", type);
-- sub(/\/[^/]+$/, "", subdir);
-+ sub(/\/[^\/]+$/, "", subdir);
- sub(/^.*\//, "", subdir);
- thisdir = "";
- }
-@@ -56,13 +56,13 @@
- # The Subdirs file comes from an add-on that should have the subdirectory.
- dir = FILENAME;
- do
-- sub(/\/[^/]+$/, "", dir);
-+ sub(/\/[^\/]+$/, "", dir);
- while (dir !~ /\/sysdeps$/);
- sub(/\/sysdeps$/, "", dir);
- if (system("test -d " dir "/" thisdir) == 0)
- dir = dir "/" thisdir;
- else {
-- sub(/\/[^/]+$/, "", dir);
-+ sub(/\/[^\/]+$/, "", dir);
- if (system("test -d " dir "/" thisdir) == 0)
- dir = dir "/" thisdir;
- else {
diff --git a/patches/06_fix-use-of-undefined-asort-awk-function.patch b/patches/06_fix-use-of-undefined-asort-awk-function.patch
deleted file mode 100644
index fd53a6d..0000000
--- a/patches/06_fix-use-of-undefined-asort-awk-function.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-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
-+++ src/libc/scripts/option-groups.awk 2013-06-21 11:14:39.304717753 -0400
-@@ -32,10 +32,9 @@
- print ""
-
- # Produce a sorted list of variable names.
-- i=0
-+ n=0
- for (var in vars)
-- names[i++] = var
-- n = asort (names)
-+ names[n++] = var
-
- for (i = 1; i <= n; i++)
- {
-diff -Naur src.orig/libc/sysdeps/gnu/errlist-compat.awk src/libc/sysdeps/gnu/errlist-compat.awk
---- src.orig/libc/sysdeps/gnu/errlist-compat.awk 2012-04-21 13:19:39.000000000 -0400
-+++ src/libc/sysdeps/gnu/errlist-compat.awk 2013-06-21 13:17:44.606655144 -0400
-@@ -84,10 +84,8 @@
- printf "#define ERR_MAX %d\n\n", highest - 1;
- }
-
-- # same regardless of awk's ordering of the associative array.
-- num_compat_elems = asorti(compat, compat_indices)
-- for (i = 1; i <= num_compat_elems; i++) {
-- old = compat_indices[i]
-+ for (compat_index in compat) {
-+ old = compat_index;
- 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\")";
- }