mailing list of musl libc
 help / color / Atom feed
* PATCH: Fix cfi awk scripts for gawk 5 warning
@ 2020-01-08 19:48 Will Dietz
  2020-01-08 20:06 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Will Dietz @ 2020-01-08 19:48 UTC (permalink / raw)
  To: musl

[-- Attachment #1.1: Type: text/plain, Size: 739 bytes --]

When `awk` is gawk 5.0.1, the cfi awk scripts print a warning
due to unnecessarily escaping '@' character (see attached patch).

Warning message example:

awk: ./tools/add-cfi.x86_64.awk:79: warning: regexp escape sequence `\@' is not a known regexp operator

Trivial patch addressing this is attached.

Unsure which awk implementations are relevant,
tested with gawk 4.2.1, gawk 5.0.1, and mawk 1.3.4.
Also tested with busybox 1.31.1, didn't check config options used (if that matters).

For all, `.cfi_startproc` seems to be inserted appropriately on example used for testing
(src/math/x86_64/lrintf.s) and no warnings were printed.

Minor issue, but seems might as well fix if there aren't awk's requiring escaping '@'.

Thanks!

~Will

[-- Attachment #1.2: 0001-tools-add-cfi.-i386-x86_64-.awk-fix-for-gawk-5.patch --]
[-- Type: text/plain, Size: 1234 bytes --]

From 004799af62609eab3261ea9a75794dd7281ce02e Mon Sep 17 00:00:00 2001
From: Will Dietz <w@wdtz.org>
Date: Wed, 8 Jan 2020 13:20:44 -0600
Subject: [PATCH] tools/add-cfi.{i386,x86_64}.awk: fix for gawk 5, '\@' -> '@'

---
 tools/add-cfi.i386.awk   | 2 +-
 tools/add-cfi.x86_64.awk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/add-cfi.i386.awk b/tools/add-cfi.i386.awk
index 9162e309..d05037de 100644
--- a/tools/add-cfi.i386.awk
+++ b/tools/add-cfi.i386.awk
@@ -81,7 +81,7 @@ function adjust_sp_offset(delta) {
     in_function = 0
   }
 }
-/^\.type [a-zA-Z0-9_]+,\@function/ {
+/^\.type [a-zA-Z0-9_]+,@function/ {
   functions[substr($2, 1, length($2)-10)] = 1
 }
 # not interested in assembler directives beyond this, just pass them through
diff --git a/tools/add-cfi.x86_64.awk b/tools/add-cfi.x86_64.awk
index bbc90daa..7e1513d6 100644
--- a/tools/add-cfi.x86_64.awk
+++ b/tools/add-cfi.x86_64.awk
@@ -76,7 +76,7 @@ function adjust_sp_offset(delta) {
     in_function = 0
   }
 }
-/^\.type [a-zA-Z0-9_]+,\@function/ {
+/^\.type [a-zA-Z0-9_]+,@function/ {
   functions[substr($2, 1, length($2)-10)] = 1
 }
 # not interested in assembler directives beyond this, just pass them through
-- 
2.25.0-rc1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: PATCH: Fix cfi awk scripts for gawk 5 warning
  2020-01-08 19:48 PATCH: Fix cfi awk scripts for gawk 5 warning Will Dietz
@ 2020-01-08 20:06 ` Rich Felker
  2020-01-20 21:00   ` [musl] " Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2020-01-08 20:06 UTC (permalink / raw)
  To: musl

On Wed, Jan 08, 2020 at 01:48:09PM -0600, Will Dietz wrote:
> When `awk` is gawk 5.0.1, the cfi awk scripts print a warning
> due to unnecessarily escaping '@' character (see attached patch).
> 
> Warning message example:
> 
> awk: ./tools/add-cfi.x86_64.awk:79: warning: regexp escape sequence `\@' is not a known regexp operator
> 
> Trivial patch addressing this is attached.
> 
> Unsure which awk implementations are relevant,
> tested with gawk 4.2.1, gawk 5.0.1, and mawk 1.3.4.
> Also tested with busybox 1.31.1, didn't check config options used (if that matters).
> 
> For all, `.cfi_startproc` seems to be inserted appropriately on example used for testing
> (src/math/x86_64/lrintf.s) and no warnings were printed.
> 
> Minor issue, but seems might as well fix if there aren't awk's requiring escaping '@'.
> 
> Thanks!
> 
> ~Will

> From 004799af62609eab3261ea9a75794dd7281ce02e Mon Sep 17 00:00:00 2001
> From: Will Dietz <w@wdtz.org>
> Date: Wed, 8 Jan 2020 13:20:44 -0600
> Subject: [PATCH] tools/add-cfi.{i386,x86_64}.awk: fix for gawk 5, '\@' -> '@'
> 
> ---
>  tools/add-cfi.i386.awk   | 2 +-
>  tools/add-cfi.x86_64.awk | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/add-cfi.i386.awk b/tools/add-cfi.i386.awk
> index 9162e309..d05037de 100644
> --- a/tools/add-cfi.i386.awk
> +++ b/tools/add-cfi.i386.awk
> @@ -81,7 +81,7 @@ function adjust_sp_offset(delta) {
>      in_function = 0
>    }
>  }
> -/^\.type [a-zA-Z0-9_]+,\@function/ {
> +/^\.type [a-zA-Z0-9_]+,@function/ {
>    functions[substr($2, 1, length($2)-10)] = 1
>  }
>  # not interested in assembler directives beyond this, just pass them through
> diff --git a/tools/add-cfi.x86_64.awk b/tools/add-cfi.x86_64.awk
> index bbc90daa..7e1513d6 100644
> --- a/tools/add-cfi.x86_64.awk
> +++ b/tools/add-cfi.x86_64.awk
> @@ -76,7 +76,7 @@ function adjust_sp_offset(delta) {
>      in_function = 0
>    }
>  }
> -/^\.type [a-zA-Z0-9_]+,\@function/ {
> +/^\.type [a-zA-Z0-9_]+,@function/ {
>    functions[substr($2, 1, length($2)-10)] = 1
>  }
>  # not interested in assembler directives beyond this, just pass them through
> -- 
> 2.25.0-rc1
> 

I think this should be okay, but I'll probably wait until after
release to commit just in case.

At some point it may make sense to remove these entirely, if we can
get rid of most of the external asm files.

Rich


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

* Re: [musl] PATCH: Fix cfi awk scripts for gawk 5 warning
  2020-01-08 20:06 ` Rich Felker
@ 2020-01-20 21:00   ` " Rich Felker
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Felker @ 2020-01-20 21:00 UTC (permalink / raw)
  To: musl

On Wed, Jan 08, 2020 at 03:06:40PM -0500, Rich Felker wrote:
> On Wed, Jan 08, 2020 at 01:48:09PM -0600, Will Dietz wrote:
> > When `awk` is gawk 5.0.1, the cfi awk scripts print a warning
> > due to unnecessarily escaping '@' character (see attached patch).
> > 
> > Warning message example:
> > 
> > awk: ./tools/add-cfi.x86_64.awk:79: warning: regexp escape sequence `\@' is not a known regexp operator
> > 
> > Trivial patch addressing this is attached.
> > 
> > Unsure which awk implementations are relevant,
> > tested with gawk 4.2.1, gawk 5.0.1, and mawk 1.3.4.
> > Also tested with busybox 1.31.1, didn't check config options used (if that matters).
> > 
> > For all, `.cfi_startproc` seems to be inserted appropriately on example used for testing
> > (src/math/x86_64/lrintf.s) and no warnings were printed.
> > 
> > Minor issue, but seems might as well fix if there aren't awk's requiring escaping '@'.
> > 
> > Thanks!
> > 
> > ~Will
> 
> > From 004799af62609eab3261ea9a75794dd7281ce02e Mon Sep 17 00:00:00 2001
> > From: Will Dietz <w@wdtz.org>
> > Date: Wed, 8 Jan 2020 13:20:44 -0600
> > Subject: [PATCH] tools/add-cfi.{i386,x86_64}.awk: fix for gawk 5, '\@' -> '@'
> > 
> > ---
> >  tools/add-cfi.i386.awk   | 2 +-
> >  tools/add-cfi.x86_64.awk | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/add-cfi.i386.awk b/tools/add-cfi.i386.awk
> > index 9162e309..d05037de 100644
> > --- a/tools/add-cfi.i386.awk
> > +++ b/tools/add-cfi.i386.awk
> > @@ -81,7 +81,7 @@ function adjust_sp_offset(delta) {
> >      in_function = 0
> >    }
> >  }
> > -/^\.type [a-zA-Z0-9_]+,\@function/ {
> > +/^\.type [a-zA-Z0-9_]+,@function/ {
> >    functions[substr($2, 1, length($2)-10)] = 1
> >  }
> >  # not interested in assembler directives beyond this, just pass them through
> > diff --git a/tools/add-cfi.x86_64.awk b/tools/add-cfi.x86_64.awk
> > index bbc90daa..7e1513d6 100644
> > --- a/tools/add-cfi.x86_64.awk
> > +++ b/tools/add-cfi.x86_64.awk
> > @@ -76,7 +76,7 @@ function adjust_sp_offset(delta) {
> >      in_function = 0
> >    }
> >  }
> > -/^\.type [a-zA-Z0-9_]+,\@function/ {
> > +/^\.type [a-zA-Z0-9_]+,@function/ {
> >    functions[substr($2, 1, length($2)-10)] = 1
> >  }
> >  # not interested in assembler directives beyond this, just pass them through
> > -- 
> > 2.25.0-rc1
> > 
> 
> I think this should be okay, but I'll probably wait until after
> release to commit just in case.
> 
> At some point it may make sense to remove these entirely, if we can
> get rid of most of the external asm files.

Others have reported hitting this, and I think it looks fine. I'm
testing with Busybox awk and as long as it works (I expect it to) I'll
include it in this release.

Rich

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 19:48 PATCH: Fix cfi awk scripts for gawk 5 warning Will Dietz
2020-01-08 20:06 ` Rich Felker
2020-01-20 21:00   ` [musl] " Rich Felker

mailing list of musl libc

Archives are clonable: git clone --mirror http://inbox.vuxu.org/musl

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git