diff mbox series

Improve detection of ld_date.

Message ID d29018e5-bb91-f0a7-ffc2-a29aa6a7e0ec@suse.cz
State New
Headers show
Series Improve detection of ld_date. | expand

Commit Message

Martin Liška Feb. 28, 2020, 4:15 p.m. UTC
Hi.

The patch is about better ld date format detection as
described in the PR in more detail. I'm also changing
'[-]' into '-' which is a simplification.

Ready to be installed after tests?
Thanks,
Martin

gcc/ChangeLog:

2020-02-28  Martin Liska  <mliska@suse.cz>

	PR other/93965
	* configure: Improve detection of ld_date by requiring
	either two dashes or none.
	* configure.ac: Likewise.
---
  gcc/configure    | 2 +-
  gcc/configure.ac | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Jakub Jelinek Feb. 28, 2020, 4:28 p.m. UTC | #1
On Fri, Feb 28, 2020 at 05:15:29PM +0100, Martin Liška wrote:
> Hi.
> 
> The patch is about better ld date format detection as
> described in the PR in more detail. I'm also changing
> '[-]' into '-' which is a simplification.
> 
> Ready to be installed after tests?
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 2020-02-28  Martin Liska  <mliska@suse.cz>
> 
> 	PR other/93965
> 	* configure: Improve detection of ld_date by requiring
> 	either two dashes or none.
> 	* configure.ac: Likewise.

That is not what you did (or at least you should pretend you didn't do it that
way).  Please write it as
	* configure.ac: Improve ...
	* configure: Regenerated.

Ok with that change.

> diff --git a/gcc/configure b/gcc/configure
> index f55cdb8c77f..5381e107bce 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -23384,7 +23384,7 @@ if test $in_tree_ld != yes ; then
>        ld_vers=`echo $ld_ver | sed -n \
>  	  -e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p'`
>      fi
> -    ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
> +    ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)\(-*\)\([01][0-9]\)\2\([0-3][0-9]\).*$,\1\3\4,p'`
>      ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
>      ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
>      ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 0e6e475950d..0d6230e0ca1 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -2804,7 +2804,7 @@ if test $in_tree_ld != yes ; then
>        ld_vers=`echo $ld_ver | sed -n \
>  	  -e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p'`
>      fi
> -    ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
> +    ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)\(-*\)\([01][0-9]\)\2\([0-3][0-9]\).*$,\1\3\4,p'`
>      ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
>      ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
>      ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
> 


	Jakub
Martin Liška Feb. 28, 2020, 4:54 p.m. UTC | #2
On 2/28/20 5:28 PM, Jakub Jelinek wrote:
> That is not what you did (or at least you should pretend you didn't do it that
> way).  Please write it as
> 	* configure.ac: Improve ...
> 	* configure: Regenerated.

Sorry, I didn't pay enough attention to the ChangeLog entry.

> 
> Ok with that change.

Installed. Would it be fine to backport that into release
branches?

Martin
Jakub Jelinek Feb. 28, 2020, 4:58 p.m. UTC | #3
On Fri, Feb 28, 2020 at 05:54:56PM +0100, Martin Liška wrote:
> On 2/28/20 5:28 PM, Jakub Jelinek wrote:
> > That is not what you did (or at least you should pretend you didn't do it that
> > way).  Please write it as
> > 	* configure.ac: Improve ...
> > 	* configure: Regenerated.
> 
> Sorry, I didn't pay enough attention to the ChangeLog entry.
> 
> > 
> > Ok with that change.
> 
> Installed. Would it be fine to backport that into release
> branches?

Yes, but wait after 8.4 is released on the 8 branch.

	Jakub
diff mbox series

Patch

diff --git a/gcc/configure b/gcc/configure
index f55cdb8c77f..5381e107bce 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -23384,7 +23384,7 @@  if test $in_tree_ld != yes ; then
       ld_vers=`echo $ld_ver | sed -n \
 	  -e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p'`
     fi
-    ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
+    ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)\(-*\)\([01][0-9]\)\2\([0-3][0-9]\).*$,\1\3\4,p'`
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
     ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 0e6e475950d..0d6230e0ca1 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2804,7 +2804,7 @@  if test $in_tree_ld != yes ; then
       ld_vers=`echo $ld_ver | sed -n \
 	  -e 's,^.*[	 ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p'`
     fi
-    ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
+    ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)\(-*\)\([01][0-9]\)\2\([0-3][0-9]\).*$,\1\3\4,p'`
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
     ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`