[PATCH 2/2] Disable .gnu_attribute tags in compatibility-ldbl.o

Alan Modra amodra@gmail.com
Wed Sep 28 04:41:00 GMT 2016


On Wed, Sep 28, 2016 at 01:26:12AM +0000, Joseph Myers wrote:
> On Wed, 28 Sep 2016, Alan Modra wrote:
> 
> > compatibility-ldbl.o is compiled with -mlong-double-64.  When
> > long double .gnu_attribute tags are checked by the linker, it
> > complains about the mismatch between this file and others in
> > libstdc++.
> 
> Is that the only file in libstdc++ that involves long double in its 
> interface at all, and so that gets such attributes?

No, some 12 object files do, all marked with 128-bit IBM long double.
eg. c++locale.o, complex_io.o, hash_tr1.o.

> I'd expect libraries such as libstdc++ and libgcc (generally, all compiler 
> and libc libraries) to be set up in such a way that they will work with 
> all long double choices in user code (via mangling and headers mapping 
> access to long double library functions to the right versions for the 
> chosen type) - and so need to be compiled without these attribute tags to 
> avoid the linker complaining when someone links them with user code built 
> with a non-default choice of long double.  Certainly for glibc I'd think 
> using the option globally to build everything is the right choice (well, 
> except for libnldbl.a, where -mlong-double-64 attributes are logically 
> correct).

Yes, and this is why the linker only warns rather than errors on
mismatching .gnu.attributes tags.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Gcc-patches mailing list