[PR other/79543] Fix GNU ld --version scanning to conform to the GNU Coding Standards
Joseph Myers
joseph@codesourcery.com
Tue Aug 13 17:33:00 GMT 2019
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
More information about the Gcc-patches
mailing list