This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[patch] Eliminate generated source dependency on internals of AWK used
- From: ppluzhnikov at google dot com (Paul Pluzhnikov)
- To: libc-alpha at sourceware dot org
- Cc: ppluzhnikov at google dot com, cgd at google dot com
- Date: Thu, 1 Mar 2012 17:07:59 -0800 (PST)
- Subject: [patch] Eliminate generated source dependency on internals of AWK used
- Authentication-results: mr.google.com; spf=pass (google.com: domain of ppluzhnikov@google.com designates 10.101.11.36 as permitted sender) smtp.mail=ppluzhnikov@google.com; dkim=pass header.i=ppluzhnikov@google.com
Greetings,
Here at Google we like to be able to build bit-identical binaries given
the same sources.
It turns out that the errlist script output depends on internals of AWK
(order of elements in associative array).
Attached patch fixes that.
Thanks,
--
Paul Pluzhnikov
2012-03-01 Chris Demetriou <cgd@google.com>
* sysdeps/gnu/errlist-compat.awk: Don't depend on AWK internals.
diff --git a/sysdeps/gnu/errlist-compat.awk b/sysdeps/gnu/errlist-compat.awk
index 0e97d05..4f70e92 100644
--- a/sysdeps/gnu/errlist-compat.awk
+++ b/sysdeps/gnu/errlist-compat.awk
@@ -84,7 +84,10 @@ END {
printf "#define ERR_MAX %d\n\n", highest;
}
- for (old in compat) {
+ # 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]
new = compat[old];
n = vcount[old];
printf "#if SHLIB_COMPAT (libc, %s, %s)\n", old, new;