small fix for crosstool with glibc-2.7

View: New views
3 Messages — Rating Filter:   Alert me  

small fix for crosstool with glibc-2.7

by Christian Kujau-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


Re: small fix for crosstool with glibc-2.7

by Dimitry Andric :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christian Kujau wrote:
> awk: scripts/gen-sorted.awk: line 19: syntax error at or near ]
> awk: scripts/gen-sorted.awk: line 19: runaway regular expression /, "",
...

> 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.

This should really be sent upstream, e.g. to the glibc maintainers.
They'll possibly say "we only support GNU awk", but if it's such a
simple patch they might accept it.


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Re: small fix for crosstool with glibc-2.7

by Christian Kujau-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 28 Oct 2007, Dimitry Andric wrote:
> This should really be sent upstream, e.g. to the glibc maintainers.
> They'll possibly say "we only support GNU awk", but if it's such a
> simple patch they might accept it.

Good point, but now I see this has already been reported:
http://sources.redhat.com/bugzilla/show_bug.cgi?id=2856 back in 06/2006.
And I thought it could be included in crosstool as long as it's unfixed
in upstream...

Christian.
--
BOFH excuse #357:

I'd love to help you -- it's just that the Boss won't let me near the computer.

--
For unsubscribe information see http://sourceware.org/lists.html#faq