On Sun, Jan 02, 2022 at 11:58:29PM +0100, Thomas Koenig wrote:
> Hi Michael,
> 
> > If you are building libraries that contain modules with multiple long double
> > types, you must use the '-mno-gnu-attribute'.  We also use the '-Wno-psabi'
> > option, which silences the warning that you are switching long double types 
> > (if
> > glibc is not 2.34 or newer).  We may need to tweak -Wno-psabi for use with
> > Fortran.
> 
> I am now at the point where the object files are also compiled correctly
> for the gfortran specifics:
> 
> 0000000000000000 <_gfortran_specific__abs_r17>:
>    0:   09 00 43 f4     lxv     vs34,0(r3)
>    4:   48 16 40 fc     xsabsqp v2,v2
>    8:   20 00 80 4e     blr
> 
> However, the linker complains, as you said it would, about the different
> formats:
> 
> /opt/at15.0/bin/ld: .libs/maxloc0_4_r16.o uses IBM long double,
> .libs/_abs_r17.o uses IEEE long double
> /opt/at15.0/bin/ld: failed to merge target specific data of file
> .libs/_abs_r17.o
> 
> I know next to nothing about libtool, so I do not know how to
> add the flags so the linker can find them.
> 
> Any pointers?
> 
> (I have not yet committed the changes because I do not want to
> commit something that does not compile.  If anybody wants to
> take a look, it's on the ieee128 virtual machine under
> /home/tkoenig/ieee ).

I'm just getting back into things after being off-line for the winter holidays.
As others have said, you need to use the GCC option -mno-gnu-attributes on any
module that handles one of the long double types if you are building libraries
that can handle both.

Note, for C/C++ languages, you should add -Wno-psabi to the options as well as
-mabi={ieee,ibm}longdouble.  This suppresses the warning that says you are
changing the long double type.  If you have configred GCC against GLIBC 2.32 or
newer, then you don't need the -Wno-psabi option.  Unfortunately, you can't use
-Wno-psabi on languages like Fortran.

-- 
Michael Meissner, IBM
PO Box 98, Ayer, Massachusetts, USA, 01432
email: meiss...@linux.ibm.com

Reply via email to