public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix awk substr invocation in libgo buildsystem
@ 2021-05-10  9:32 Christoph Höger
  2021-05-13 19:09 ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Höger @ 2021-05-10  9:32 UTC (permalink / raw)
  To: gcc-patches

The awk script used a zero-based index which worked on surprisingly
many plattforms. According to the man page, however, the function
expects one-based indexing.

For reference see this bug in the go git repository:

https://github.com/golang/go/issues/45843

Signed-off-by: Christoph Höger <choeger@umpa-net.de>
---
 ChangeLog             | 4 ++++
 libgo/mklinknames.awk | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2174ab1ea90..495e6f79b76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-10  Christoph Höger  <choeger@umpa-net.de>
+
+	* libgo/mklinknames.awk: Fix awk substr invocation
+
 2021-05-04  Nick Clifton  <nickc@redhat.com>
 
 	* configure.ac (AC_PROG_CC): Replace with AC_PROG_CC_C99.
diff --git a/libgo/mklinknames.awk b/libgo/mklinknames.awk
index 71cb3be7966..0e49c07349e 100644
--- a/libgo/mklinknames.awk
+++ b/libgo/mklinknames.awk
@@ -37,7 +37,7 @@ BEGIN {
     # The goal is to extract "__timegm50".
     if ((def | getline fndef) > 0 && match(fndef, "__asm__\\(\"\\*?")) {
 	asmname = substr(fndef, RSTART + RLENGTH)
-	asmname = substr(asmname, 0, length(asmname) - 2)
+	asmname = substr(asmname, 1, length(asmname) - 2)
 	printf("//go:linkname %s %s\n", gofnname, asmname)
     } else {
 	# Assume the asm name is the same as the declared C name.
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix awk substr invocation in libgo buildsystem
  2021-05-10  9:32 [PATCH] Fix awk substr invocation in libgo buildsystem Christoph Höger
@ 2021-05-13 19:09 ` Jeff Law
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2021-05-13 19:09 UTC (permalink / raw)
  To: Christoph Höger, gcc-patches


On 5/10/2021 3:32 AM, Christoph Höger wrote:
> The awk script used a zero-based index which worked on surprisingly
> many plattforms. According to the man page, however, the function
> expects one-based indexing.
>
> For reference see this bug in the go git repository:
>
> https://github.com/golang/go/issues/45843
>
> Signed-off-by: Christoph Höger <choeger@umpa-net.de>
> ---
>   ChangeLog             | 4 ++++
>   libgo/mklinknames.awk | 2 +-
>   2 files changed, 5 insertions(+), 1 deletion(-)

I believe this file is managed by the upstream golang project. So the 
submission should go to them.  The guidelines from the README file:

Contributing
============

To contribute patches to the files in this directory, please see
http://golang.org/doc/gccgo_contribute.html .

The master copy of these files is hosted at
http://code.google.com/p/gofrontend .  Changes to these files require
signing a Google contributor license agreement.  If you are the
copyright holder, you will need to agree to the individual contributor
license agreement at
http://code.google.com/legal/individual-cla-v1.0.html.  This agreement
can be completed online.

If your organization is the copyright holder, the organization will
need to agree to the corporate contributor license agreement at
http://code.google.com/legal/corporate-cla-v1.0.html.

If the copyright holder for your code has already completed the
agreement in connection with another Google open source project, it
does not need to be completed again.

--


Thanks,

Jeff





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Fix awk substr invocation in libgo buildsystem
@ 2021-05-10 11:48 choeger
  0 siblings, 0 replies; 4+ messages in thread
From: choeger @ 2021-05-10 11:48 UTC (permalink / raw)
  To: gcc-patches

From: Christoph Höger <choeger@umpa-net.de>

The awk script used a zero-based index which worked on surprisingly
many plattforms. According to the man page, however, the function
expects one-based indexing.

For reference see this bug in the go git repository:

https://github.com/golang/go/issues/45843

Signed-off-by: Christoph Höger <choeger@umpa-net.de>
---
 ChangeLog             | 4 ++++
 libgo/mklinknames.awk | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2174ab1ea90..495e6f79b76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-10  Christoph Höger  <choeger@umpa-net.de>
+
+	* libgo/mklinknames.awk: Fix awk substr invocation
+
 2021-05-04  Nick Clifton  <nickc@redhat.com>
 
 	* configure.ac (AC_PROG_CC): Replace with AC_PROG_CC_C99.
diff --git a/libgo/mklinknames.awk b/libgo/mklinknames.awk
index 71cb3be7966..0e49c07349e 100644
--- a/libgo/mklinknames.awk
+++ b/libgo/mklinknames.awk
@@ -37,7 +37,7 @@ BEGIN {
     # The goal is to extract "__timegm50".
     if ((def | getline fndef) > 0 && match(fndef, "__asm__\\(\"\\*?")) {
 	asmname = substr(fndef, RSTART + RLENGTH)
-	asmname = substr(asmname, 0, length(asmname) - 2)
+	asmname = substr(asmname, 1, length(asmname) - 2)
 	printf("//go:linkname %s %s\n", gofnname, asmname)
     } else {
 	# Assume the asm name is the same as the declared C name.
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Fix awk substr invocation in libgo buildsystem
@ 2021-05-10  8:47 Christoph Höger
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Höger @ 2021-05-10  8:47 UTC (permalink / raw)
  To: gcc-patches; +Cc: Christoph Höger

The awk script used a zero-based index which worked on surprisingly
many plattforms. According to the man page, however, the function
expects one-based indexing.

For reference see this bug in the go git repository:

https://github.com/golang/go/issues/45843

Signed-off-by: Christoph Höger <choeger@umpa-net.de>
---
 ChangeLog             | 4 ++++
 libgo/mklinknames.awk | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2174ab1ea90..495e6f79b76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-10  Christoph Höger  <choeger@umpa-net.de>
+
+	* libgo/mklinknames.awk: Fix awk substr invocation
+
 2021-05-04  Nick Clifton  <nickc@redhat.com>
 
 	* configure.ac (AC_PROG_CC): Replace with AC_PROG_CC_C99.
diff --git a/libgo/mklinknames.awk b/libgo/mklinknames.awk
index 71cb3be7966..0e49c07349e 100644
--- a/libgo/mklinknames.awk
+++ b/libgo/mklinknames.awk
@@ -37,7 +37,7 @@ BEGIN {
     # The goal is to extract "__timegm50".
     if ((def | getline fndef) > 0 && match(fndef, "__asm__\\(\"\\*?")) {
 	asmname = substr(fndef, RSTART + RLENGTH)
-	asmname = substr(asmname, 0, length(asmname) - 2)
+	asmname = substr(asmname, 1, length(asmname) - 2)
 	printf("//go:linkname %s %s\n", gofnname, asmname)
     } else {
 	# Assume the asm name is the same as the declared C name.
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-13 19:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10  9:32 [PATCH] Fix awk substr invocation in libgo buildsystem Christoph Höger
2021-05-13 19:09 ` Jeff Law
  -- strict thread matches above, loose matches on Subject: below --
2021-05-10 11:48 choeger
2021-05-10  8:47 Christoph Höger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).