On Wed, Aug 17, 2022 at 10:28:29AM +0200, Mikael Morin wrote:
> Tobias approved it already, but I spotted what looks like typos.
> See below.
Thanks for catching that.
> > --- 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.
Yeah. I just copied this part from the 2014 patch and didn't spot that.
> > +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/
Indeed. Also removed the space before libgfortran.a because I'm not sure if
it won't have because of the %s full path in front of that.
This is Darwin only stuff.
I must say I don't know if even this elif ... LQUADMATH part is needed,
maybe replace-outfile will rename even the -lquadmath from the spec file.
Here is an updated version (but nothing relevant to Linux changed, so there
is no point for me to bootstrap/regtest it again):
2022-08-17 Francois-Xavier Coudert
Jakub Jelinek
PR fortran/46539
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/fortran/
* lang.opt (static-libquadmath): New option.
* invoke.texi (-static-libquadmath): Document it.
* options.c (gfc_handle_option): Error out if -static-libquadmath
is passed but we do not support it.
libgfortran/
* acinclude.m4 (LIBQUADSPEC): From $FC -static-libgfortran -###
output determine -Bstatic/-Bdynamic, -bstatic/-bdynamic,
-aarchive_shared/-adefault linker support or Darwin remapping
of -lgfortran to libgfortran.a%s and use that around or instead
of -lquadmath in LIBQUADSPEC.
* configure: Regenerated.
--- gcc/common.opt.jj 2022-06-27 11:18:02.050066582 +0200
+++ gcc/common.opt 2022-08-16 14:51:04.611673800 +0200
@@ -3601,6 +3601,10 @@ static-libphobos
Driver
; Documented for D, but always accepted by driver.
+static-libquadmath
+Driver
+; Documented for Fortran, but always accepted by driver.
+
static-libstdc++
Driver
--- gcc/gcc.cc.jj 2022-08-11 09:57:24.765334380 +0200
+++ gcc/gcc.cc 2022-08-16 14:57:54.708327024 +0200
@@ -4585,12 +4585,14 @@ driver_handle_option (struct gcc_options
case OPT_static_libgcc:
case OPT_shared_libgcc:
case OPT_static_libgfortran:
+case OPT_static_libquadmath:
case OPT_static_libphobos:
case OPT_static_libstdc__:
/* These are always valid, since gcc.cc itself understands the
first two, gfortranspec.cc understands -static-libgfortran,
-d-spec.cc understands -static-libphobos, and g++spec.cc
-understands -static-libstdc++ */
+d-spec.cc understands -static-libphobos, g++spec.cc
+understands -static-libstdc++ and libgfortran.spec handles
+-static-libquadmath. */
validated = true;
break;
--- 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-libquadmath:%:replace-outfile(-lquadmath
libquadmath.a%s)}\
%{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)}\
--- gcc/fortran/lang.opt.jj 2022-02-04 14:36:55.050604670 +0100
+++ gcc/fortran/lang.opt2022-08-16 14:52:52.459267705 +0200
@@ -863,6 +863,10 @@ static-libgfortran
Fortran
Statically link the GNU Fortran helper library (libgfortran).
+static-libquadmath
+Fortran
+Statically link the GCC Quad-Precision Math Library (libquadmath).
+
std=f2003
Fortran
Conform to the ISO Fortran 2003