public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@linux.ibm.com>
To: Thomas Koenig <tkoenig@netcologne.de>
Cc: Michael Meissner <meissner@linux.ibm.com>,
	Bill Schmidt <wschmidt@linux.ibm.com>,
	"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	Jakub Jelinek <jakub@redhat.com>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	Peter Bergner <bergner@linux.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>,
	gcc mailing list <gcc@gcc.gnu.org>
Subject: Re: [power-iee128] How to specify linker flags
Date: Wed, 5 Jan 2022 16:20:47 -0500	[thread overview]
Message-ID: <YdYLrzsZ4uQLUZP8@toto.the-meissners.org> (raw)
In-Reply-To: <541fa494-ce3c-50f2-367b-f0dd492dcf45@netcologne.de>

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: meissner@linux.ibm.com

      parent reply	other threads:[~2022-01-05 21:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <63b5434e-f8fa-97b3-d357-e25094579b16@netcologne.de>
     [not found] ` <bdc02706-a5ae-1389-906d-50c502b87d5f@linux.ibm.com>
     [not found]   ` <YYA2FMfDR0yehJLA@toto.the-meissners.org>
2022-01-02 22:58     ` Thomas Koenig
2022-01-03 10:19       ` Thomas Koenig
2022-01-03 10:33         ` Jakub Jelinek
2022-01-03 10:34         ` Segher Boessenkool
2022-01-05 21:20       ` Michael Meissner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YdYLrzsZ4uQLUZP8@toto.the-meissners.org \
    --to=meissner@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=segher@kernel.crashing.org \
    --cc=tkoenig@netcologne.de \
    --cc=wschmidt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).