This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Don't use .gnu.linkonce with COMDAT
Daniel Jacobowitz wrote:
On Fri, May 06, 2005 at 06:10:56PM +0100, Julian Brown wrote:
Thirdly, COMDAT groups have proven buggy on various platforms with
various (older) binutils versions. The third part of the patch stops
COMDAT groups from being used altogether when the linker version is less
than 2.16. This is perhaps slightly too pessimistic (i.e., earlier
versions might work OK), but I'm reasonably confident my testing has
shown it to be about right. This is based on a patch from H.J. Lu which
never seems to have been applied:
Though the required version has been bumped by several. This will have
the effect of disabling COMDAT on some setups where it is currently
enabled. I have also renamed the macro HAVE_GAS_COMDAT_GROUP to just
HAVE_COMDAT_GROUP to better indicate that it's not just an assembler
feature that's being relied on.
How does this patch interact with non-GNU linkers? This is one of the
problems with version-number based checks...
Probably not very well. In the patches defence, there are existing
version-number based tests for ld (checking linker for .hidden support)
in configure.ac. I don't know if any non-GNU linkers (which GCC works
with) support COMDAT groups, but I agree that it's a possibility at
least. I'm also not sure if the existing assembler COMDAT test will work
with anything other than GNU as.
Having said that, I think the linker version test will be skipped with a
non-GNU ld and only the gas test used, so it might be OK.
The problem with non-version based tests, AFAICT, is that different
things appear to break on different platforms with older binutils
versions, and I don't know how to check for them all.