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: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: <cltang at codesourcery dot com>, 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 19:33:16 +0200
- Subject: Re: [PR other/79543] Fix GNU ld --version scanning to conform to the GNU Coding Standards
- References: <87po9jhz9e.fsf@euler.schwinge.homeip.net> <alpine.DEB.2.20.1710310008200.30054@digraph.polyomino.org.uk> <1f4fb5d4-a76b-c59d-39fb-c59805590610@mentor.com> <alpine.DEB.2.21.1908131707130.25014@digraph.polyomino.org.uk>
Hi Joseph,
> 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.)
as it happens, I've been working on exactly this. I'd noticed that
*_CHECK_LINKER_FEATURES enabled --gc-sections only with gld although
recent Solaris ld supports it as well. What's worse, even with gld the
option is detected and used only for some of the libraries due to
inconsistencies between the different versions of the macro.
I'd meant to unify *_ENABLE_SYMVERS for a long time and this seemed the
perfect opportunity to do so, among others because several libs require
it from *_CHECK_LINKER_FEATURES to get the linker version info ;-(
On top of that, there are many different copies of the code that handles
--enable-version-specific-runtime-libs, sets toolexeclibdir and
--enable-generated-files-in-srcdir, as well as several instances of
*_CHECK_ATTRIBUTE_ALIAS, *_CHECK_ATTRIBUTE_DLLEXPORT, and
*_CHECK_ATTRIBUTE_VISIBILITY, and probably more that I've missed so
far. Overall, we've created an incredible mess here, and I'm probably
partially responsible at least for the *_ENABLE_SYMVERS part.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University