small fix for crosstool with glibc-2.7
Christian Kujau
lists@nerdbynature.de
Sat Oct 27 22:59:00 GMT 2007
Hi,
I tried to build with the latest (gcc, glibc, binutilts) releases and came
accross (when building for x86_64 on i386):
------
gcc-4.2.2-glibc-2.7/glibc-2.7# mawk -f scripts/gen-sorted.awk -v [......]
awk: scripts/gen-sorted.awk: line 19: regular expression compile failed
(bad class -- [], [^] or [)
/[^
awk: scripts/gen-sorted.awk: line 19: syntax error at or near ]
awk: scripts/gen-sorted.awk: line 19: runaway regular expression /, "", subd ...
------
On my system only mawk (from debian/unstable, version 1.3.3-11) was
installed (I could see in the buildlogs, that "mawk" was called, not
"awk", which was symlinked to "mawk" at this time). Installing "gawk"
(also debian/unstable, version 3.1.5.dfsg-4) made the command succeed.
However, I wondered why awk broke and modified scripts/gen-sorted.awk so
that both mawk and gawk were able to do the job:
-----------------------
--- glibc-2.7/scripts/gen-sorted.awk.orig 2007-10-28 00:01:20.000000000 +0200
+++ glibc-2.7/scripts/gen-sorted.awk 2007-10-28 00:02:33.000000000 +0200
@@ -16,7 +16,7 @@ NF == 0 { next }
{
subdir = type = FILENAME;
sub(/^.*\//, "", type);
- sub(/\/[^/]+$/, "", subdir);
+ sub(/\/[^\/]+$/, "", subdir);
sub(/^.*\//, "", subdir);
thisdir = "";
}
@@ -56,13 +56,13 @@ type == "Subdirs" && thisdir {
# 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 {
-----------------------
Christian
--
BOFH excuse #234:
Someone is broadcasting pygmy packets and the router doesn't know how to deal with them.
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list