This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR other/79543] Fix GNU ld --version scanning to conform to the GNU Coding Standards
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <cltang at codesourcery dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, <gcc-patches at gcc dot gnu dot org>, Paolo Bonzini <bonzini at gnu dot org>, DJ Delorie <dj at redhat dot com>, Nathanael Nerode <neroden at gcc dot gnu dot org>, Alexandre Oliva <aoliva at redhat dot com>, Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- Date: Tue, 13 Aug 2019 17:16:47 +0000
- Subject: Re: [PR other/79543] Fix GNU ld --version scanning to conform to the GNU Coding Standards
- Ironport-sdr: tvzQUrnTUMIYN8R4L8AYjTkf9kv0m0NbUX4uDjHTcThsHEIH46KU3tuTef2MdUs88PN7ZVpfyn dZ29Xn9LkQ7OkF52SaN8GxnLj3/ogYkzYWKDetjaXj0Th73AeqMzZ99qIh1NEx/wby+ICStvMr r8CpfZGZbaTqfUdWzG5CztEkAAfGvuQzILBWaIQoTBsXKzYyjpqwPXoi+gz7xcwp/SciQiapiV 34dPSCouTy9HUMuEBqw1zm0yAwCMCgakMxwJFN6bjNbBGpyBdHbL1QPV71nZxJRvT2ELThJAhQ Z3U=
- Ironport-sdr: vWuhKBYG1fy7YSb6tt++XUvgcQI9nAxa5By1iBGH2OTNcguNnIdely9Z5zzwwVNAgIy1Z7fWfh 4jhasGWioFGVJqyNAyjSJrvkn4RrLLAKloCKOW0sE34b+iiNDXDYKohuVtBBRBvpUY8XUXw5o8 bqcD5/Q2hitGeVT4buiHbqMnsqTwH6bHMDocrGW5bbiNoVkN3Mf/g5scmEtwWswZSCC+jNsUHB MxQjP8GlH+xml/CEPjhNAFXMJsen9BbGVtC/B+Ajzy3Ij1kkxs5Otu66Pro70WHuuEYy323LmT oeI=
- References: <87po9jhz9e.fsf@euler.schwinge.homeip.net> <alpine.DEB.2.20.1710310008200.30054@digraph.polyomino.org.uk> <1f4fb5d4-a76b-c59d-39fb-c59805590610@mentor.com>
On Thu, 4 Jul 2019, Chung-Lin Tang wrote:
> Bringing back this issue, as this is still bothering our OpenACC toolchains.
>
> If the main variance in format was the 2007 ' ' to '.' change for non-release
> binutils builds, then is the attached patch okay?
>
> What the patch does is to first look for an 8-digit part at the end
> (preceded by either a space or '.'), chop it off if it exists, and then take
> the last
> space-preceded string.
This patch is using \+ with sed, which is a GNU extension rather than part
of POSIX sed. I don't think we require GNU sed to build GCC.
The patch is OK for trunk with \+ changed to \{1,\} throughout (presuming
that does indeed work).
However, I strongly encourage a followup to refactor this code
(*_CHECK_LINKER_FEATURES and *_ENABLE_SYMVERS that use it, not just the
fragment that determines the linker version number), which is evidently
duplicated far too much in different target library directories, into
common macros in a .m4 file in the top-level config/ directory, so it's
more maintainable in future. (Note 1: I don't know what differences there
might be between the versions in different directories; that would need
investigating as part of such a refactoring; differences need not be
deliberate, they could easily have arisen by accident. Note 2: although
libffi is maintained outside of GCC, I think such a refactoring should
still be applied to the libffi directory along with the others; standalone
libffi would simply need its own copy of the relevant .m4 file. Note 3:
it should be possible to do such a refactoring bit by bit if that's more
approachable, rather than necessarily doing a complete refactoring of all
the definitions of all these macros at once.)
> (seeking approval for trunk and all active release branches)
For release branches you should at least wait a few weeks to see if any
issues show up on trunk.
--
Joseph S. Myers
joseph@codesourcery.com