[libgo PATCH 0/1] mksyscalls.awk: make split ERE more portable

2 views
Skip to first unread message

Bernhard Reutner-Fischer

unread,
Aug 1, 2013, 8:36:27 AM8/1/13
to gcc-p...@gcc.gnu.org, Bernhard Reutner-Fischer, Ian Lance Taylor, gofront...@googlegroups.com
Hi,

When using busybox' awk to bootstrap, libgo's syscalls are generated
incorrectly.

I'm attaching the split() used by busybox' awk including output before
and after the patch for reference.

Please install / ok to install?

Bernhard Reutner-Fischer (1):
mksyscalls.awk: make split ERE more portable

libgo/go/syscall/mksyscall.awk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--
1.7.10.4
regexec.c

Bernhard Reutner-Fischer

unread,
Aug 1, 2013, 8:36:28 AM8/1/13
to gcc-p...@gcc.gnu.org, Bernhard Reutner-Fischer, Ian Lance Taylor, gofront...@googlegroups.com
awk's split() ERE was splitting on (essentially) .
Double checked with mawk 1.3.3, GNU Awk 4.0.1, busybox awk
that they still produce identical output.

libgo/ChangeLog (???)

2013-08-01 Bernhard Reutner-Fischer <al...@gcc.gnu.org>

* go/syscall/mksyscall.awk (split): Fix ere argument.

Signed-off-by: Bernhard Reutner-Fischer <rep.d...@gmail.com>
---
libgo/go/syscall/mksyscall.awk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgo/go/syscall/mksyscall.awk b/libgo/go/syscall/mksyscall.awk
index 74f0e28..829b6fe 100644
--- a/libgo/go/syscall/mksyscall.awk
+++ b/libgo/go/syscall/mksyscall.awk
@@ -53,7 +53,7 @@ BEGIN {
}

# Sets a[1] = //sysnb, a[2] == function name.
- split(line, a, "[ (]*")
+ split(line, a, "[ (]")
gofnname = a[2]

off = match(line, "\\([^()]*\\)")
@@ -78,7 +78,7 @@ BEGIN {
next
}

- split(line, a, "[ (]*")
+ split(line, a, "[ (]")
cfnname = substr(a[1], 3, length(a[1]) - 2)

off = match(line, "\\([^()]*\\)")
--
1.7.10.4

Ian Lance Taylor

unread,
Aug 2, 2013, 6:32:53 PM8/2/13
to Bernhard Reutner-Fischer, gcc-patches, gofront...@googlegroups.com
On Thu, Aug 1, 2013 at 5:36 AM, Bernhard Reutner-Fischer
<rep.d...@gmail.com> wrote:
>
> When using busybox' awk to bootstrap, libgo's syscalls are generated
> incorrectly.
>
> I'm attaching the split() used by busybox' awk including output before
> and after the patch for reference.
>
> Please install / ok to install?

I installed a slightly different version, that retains the desired
semantics (skip arbitrary amounts of whitespace). This should avoid
confusing the busybox awk by matching the null string. Committed to
mainline and 4.8 branch.

Thanks for reporting the issue.

Ian
foo.patch
Reply all
Reply to author
Forward
0 new messages