public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <morin-mikael@orange.fr>
To: Jakub Jelinek <jakub@redhat.com>,
	gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org
Subject: Re: [PATCH] fortran: Add -static-libquadmath support [PR46539]
Date: Wed, 17 Aug 2022 10:28:29 +0200	[thread overview]
Message-ID: <a989bd65-b2f7-c683-5313-f40ac9d000f2@orange.fr> (raw)
In-Reply-To: <YvuqJyvOMhN1QSy2@tucnak>

Hello,

Tobias approved it already, but I spotted what looks like typos.
See below.

Mikael

> gcc/
> 	* common.opt (static-libquadmath): New option.
> 	* gcc.c (driver_handle_option): Always accept -static-libquadmath.
> 	* config/darwin.h (LINK_SPEC): Handle -static-libquadmath.

(...)

> --- gcc/config/darwin.h.jj	2022-08-16 14:51:14.529544492 +0200
> +++ gcc/config/darwin.h	2022-08-16 14:53:54.402460097 +0200
> @@ -443,6 +443,7 @@ extern GTY(()) int darwin_ms_struct;
>                        %:replace-outfile(-lobjc libobjc-gnu.a%s); \
>                       :%:replace-outfile(-lobjc -lobjc-gnu )}}\
>      %{static|static-libgcc|static-libgfortran:%:replace-outfile(-lgfortran libgfortran.a%s)}\
> +   %{static|static-libgcc|static-libgfortran:%:replace-outfile(-lquadmath libquadmath.a%s)}\

s/static-libgfortran/static-libquadmath/ I guess?  Otherwise I don’t 
understand the corresponding ChangeLog description.

>      %{static|static-libgcc|static-libphobos:%:replace-outfile(-lgphobos libgphobos.a%s)}\
>      %{static|static-libgcc|static-libstdc++|static-libgfortran:%:replace-outfile(-lgomp libgomp.a%s)}\
>      %{static|static-libgcc|static-libstdc++:%:replace-outfile(-lstdc++ libstdc++.a%s)}\

(...)

> --- libgfortran/acinclude.m4.jj	2022-06-29 17:05:45.478790781 +0200
> +++ libgfortran/acinclude.m4	2022-08-16 16:06:50.047814043 +0200
> @@ -356,18 +356,39 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
>         ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag
>       ])
>   
> +    dnl Determine -Bstatic ... -Bdynamic etc. support from gfortran -### stderr.
> +    touch conftest1.$ac_objext conftest2.$ac_objext
> +    LQUADMATH=-lquadmath
> +    $FC -static-libgfortran -### -o conftest \
> +	conftest1.$ac_objext -lgfortran conftest2.$ac_objext 2>&1 >/dev/null \
> +	| grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd
> +    if grep "conftest1.$ac_objext.* -Bstatic -lgfortran -Bdynamic .*conftest2.$ac_objext" \
> +       conftest.cmd >/dev/null 2>&1; then
> +      LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}"
> +    elif grep "conftest1.$ac_objext.* -bstatic -lgfortran -bdynamic .*conftest2.$ac_objext" \
> +         conftest.cmd >/dev/null 2>&1; then
> +      LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}"
> +    elif grep "conftest1.$ac_objext.* -aarchive_shared -lgfortran -adefault .*conftest2.$ac_objext" \
> +         conftest.cmd >/dev/null 2>&1; then
> +      LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}"
> +    elif grep "conftest1.$ac_objext.* ligfortran.a .*conftest2.$ac_objext" \

s/ligfortran.a/libgfortran.a/

> +         conftest.cmd >/dev/null 2>&1; then
> +      LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}"
> +    fi
> +    rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd
> +
>       dnl For static libgfortran linkage, depend on libquadmath only if needed.
>       dnl If using *f128 APIs from libc/libm, depend on libquadmath only if needed
>       dnl even for dynamic libgfortran linkage, and don't link libgfortran against
>       dnl -lquadmath.
>       if test "x$libgfor_cv_have_as_needed" = xyes; then
>         if test "x$USE_IEC_60559" = xyes; then
> -	LIBQUADSPEC="$libgfor_cv_as_needed_option -lquadmath $libgfor_cv_no_as_needed_option"
> +	LIBQUADSPEC="$libgfor_cv_as_needed_option $LQUADMATH $libgfor_cv_no_as_needed_option"
>         else
> -	LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}"
> +	LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} $LQUADMATH %{static-libgfortran:$libgfor_cv_no_as_needed_option}"
>         fi
>       else
> -      LIBQUADSPEC="-lquadmath"
> +      LIBQUADSPEC="$LQUADMATH"
>       fi
>       if test "x$USE_IEC_60559" != xyes; then
>         if test -f ../libquadmath/libquadmath.la; then


  parent reply	other threads:[~2022-08-17  8:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 14:31 Jakub Jelinek
2022-08-17  7:19 ` Jakub Jelinek
2022-08-17  7:55 ` Tobias Burnus
2022-08-17  8:28 ` Mikael Morin [this message]
2022-08-17 11:05   ` [PATCH] fortran, v2: " Jakub Jelinek
2022-08-18 10:35     ` Iain Sandoe
2022-08-18 10:41       ` Jakub Jelinek

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=a989bd65-b2f7-c683-5313-f40ac9d000f2@orange.fr \
    --to=morin-mikael@orange.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).