From 9e2ff2bf7c6ceb2aa90d05dc45b3a4354e48707a Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 21 Jun 2013 08:15:50 -0400 Subject: Add patches to configure the libc with any awk. --- (limited to 'patches') diff --git a/patches/03_accept-any-awk.patch b/patches/03_accept-any-awk.patch new file mode 100644 index 0000000..3b96b5c --- /dev/null +++ b/patches/03_accept-any-awk.patch @@ -0,0 +1,57 @@ +From: "P. J. McDermott" +Description: Accept any awk implementation + Use "AC_PROG_GREP" 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 +@@ -982,9 +982,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 new file mode 100644 index 0000000..fcdcd58 --- /dev/null +++ b/patches/04_add-strtonum-to-conftest.patch @@ -0,0 +1,127 @@ +From: "P. J. McDermott" +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 +@@ -6373,14 +6373,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 +@@ -1474,14 +1474,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" -- cgit v0.9.1