public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Thomas Koenig <tkoenig@netcologne.de>,
	Michael Meissner <meissner@linux.ibm.com>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	Peter Bergner <bergner@linux.ibm.com>,
	Bill Schmidt <wschmidt@linux.ibm.com>,
	gcc-patches@gcc.gnu.org, David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [power-ieee128] libgfortran: -mabi=ieeelongdouble I/O
Date: Mon, 3 Jan 2022 17:26:50 +0100	[thread overview]
Message-ID: <20220103162650.GV2646553@tucnak> (raw)
In-Reply-To: <20220103153621.GL2664@tucnak>

On Mon, Jan 03, 2022 at 04:36:21PM +0100, Jakub Jelinek via Gcc-patches wrote:
> The following patch adds the library side of -mabi=ieeelongdouble
> I/O support.
> 
> There is one issue to be resolved though, for the sake of libgfortran.a
> built on an older powerpc64le-linux system (glibc older than 2.32) and
> then deployed on glibc 2.32 or later, I believe we want to use
> _gfortran_transfer_real128_write etc. APIs so that we force in libquadmath
> in that case.  The following patch does that, but unfortunately it means
> that right now those
>    512: 00000000001a31d0    56 FUNC    GLOBAL DEFAULT   11 _gfortran_transfer_real128@@GFORTRAN_8 	[<localentry>: 8]
>    920: 00000000001a3210    56 FUNC    GLOBAL DEFAULT   11 _gfortran_transfer_real128_write@@GFORTRAN_8 	[<localentry>: 8]
>    487: 00000000001a3290    56 FUNC    GLOBAL DEFAULT   11 _gfortran_transfer_complex128_write@@GFORTRAN_8 	[<localentry>: 8]
>    574: 00000000001a3250    56 FUNC    GLOBAL DEFAULT   11 _gfortran_transfer_complex128@@GFORTRAN_8 	[<localentry>: 8]
> symbols.  But those symbols weren't exported on powerpc64le-linux in
> GCC 8, 9, 10 or 11, so they shouldn't be exported @@GFORTRAN_8, but @@GFORTRAN_12.
> 
> So, either we'd need to add e.g. preprocessing support for gfortran.map

Note, an example of preprocessed version file is e.g. libgomp, in the
Makefile it does:
# -Wc is only a libtool option.
comma = ,
PREPROCESS = $(subst -Wc$(comma), , $(COMPILE)) -E

libgomp.ver: $(top_srcdir)/libgomp.map
	$(EGREP) -v '#(#| |$$)' $< | \
	  $(PREPROCESS) -P -include config.h - > $@ || (rm -f $@ ; exit 1)
and in libgomp.map it has both:
#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
        # If the assembler used lacks the .symver directive or the linker
        # doesn't support GNU symbol versioning, we have the same symbol in
        # two versions, which Sun ld chokes on.
        omp_init_lock;
...
#endif
so we could similarly have something like:
#if !(defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG_DOUBLE__ == 16)
    _gfortran_transfer_complex128;
    _gfortran_transfer_complex128_write;
#endif
...
#if !(defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG_DOUBLE__ == 16)
    _gfortran_transfer_real128;
    _gfortran_transfer_real128_write;
#endif
...
#if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG_DOUBLE__ == 16
  _gfortran_transfer_complex128;
  _gfortran_transfer_complex128_write;
  _gfortran_transfer_real128;
  _gfortran_transfer_real128_write;
#endif

or make that dependent on HAVE_GFC_REAL_17 or whatever else (with suitable
includes that only define macros and not actual C code).

	Jakub


  reply	other threads:[~2022-01-03 16:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 15:36 Jakub Jelinek
2022-01-03 16:26 ` Jakub Jelinek [this message]
2022-01-03 17:03   ` Thomas Koenig
2022-01-03 20:00     ` [power-ieee128] libgfortran, fortran: " Jakub Jelinek
2022-01-03 22:43       ` Thomas Koenig
2022-01-04 11:07         ` [power-ieee128] RFH: LTO broken Jakub Jelinek
2022-01-04 13:41           ` [power-ieee128] libgfortran: -mabi=ieeelongdouble I/O fix Jakub Jelinek
2022-01-04 14:35             ` Thomas Koenig
2022-01-06  2:48           ` [power-ieee128] RFH: LTO broken Michael Meissner
2022-01-06  4:17           ` Michael Meissner
2022-01-06  5:00           ` Michael Meissner
2022-01-06 20:01             ` Thomas Koenig
2022-01-06 20:10               ` Jakub Jelinek
2022-01-07  9:22               ` [power-ieee128] OPEN CONV Jakub Jelinek
2022-01-07 10:26                 ` Thomas Koenig
2022-01-07 19:52                   ` Jakub Jelinek
2022-01-07 21:40                     ` Thomas Koenig
2022-01-07 21:48                       ` Jakub Jelinek
2022-01-08 10:07                         ` Thomas Koenig
2022-01-08 11:00                           ` Jakub Jelinek
2022-01-08 11:10                             ` Jakub Jelinek
2022-01-08 14:02                               ` Jakub Jelinek
2022-01-08 14:13                                 ` Thomas Koenig
2022-01-08 14:18                                   ` Jakub Jelinek
2022-01-08 18:59                                     ` Michael Meissner
2022-01-08 19:15                                       ` David Edelsohn
2022-01-08 19:37                                         ` Michael Meissner
2022-01-07 11:29               ` [power-ieee128] RFH: LTO broken Jakub Jelinek
2022-01-07 13:31                 ` Jakub Jelinek
2022-01-07 14:25                   ` Thomas Koenig
2022-01-07 16:46                     ` Jakub Jelinek
2022-01-07 21:33                       ` Thomas Koenig
2022-01-03 16:48 ` [power-ieee128] libgfortran: -mabi=ieeelongdouble I/O Thomas Koenig

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=20220103162650.GV2646553@tucnak \
    --to=jakub@redhat.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=meissner@linux.ibm.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).