[PATCH] fortran, v2: Add -static-libquadmath support [PR46539]

Jakub Jelinek jakub@redhat.com
Thu Aug 18 10:41:35 GMT 2022


On Thu, Aug 18, 2022 at 11:35:06AM +0100, Iain Sandoe wrote:
> > --- gcc/fortran/options.cc.jj	2022-01-18 11:58:59.568982256 +0100
> > +++ gcc/fortran/options.cc	2022-08-16 14:56:22.807525218 +0200
> > @@ -692,6 +692,13 @@ gfc_handle_option (size_t scode, const c
> > #endif
> >       break;
> > 
> > +    case OPT_static_libquadmath:
> > +#ifndef HAVE_LD_STATIC_DYNAMIC
> > +      gfc_fatal_error ("%<-static-libquadmath%> is not supported in this "
> > +		       "configuration");
> > +#endif
> 
> I think that this will disable the option on Darwin (where the linker does not
> support Bstatic/dynamic)  - the point of the specs outfile substitution is to work
> for such platforms.  So long as the option is not stripped out by the driver, the
> specs substitution should work (there is a bug in the g++ driver where this is
> not happening properly for -static-libstdc++ - but the gdc driver has it right).

It does the same thing as OPT_static_libgfortran and that option
presumably isn't disabled on Darwin.

My guess is that this is just dead code and could be removed for both
options, I think gfc_handle_option is only in f951 program, and the
-static-lib* options are driver only, not passed to the compiler.

Note, for other options like -static-libstdc++, we also don't reject them
if HAVE_LD_STATIC_DYNAMIC isn't defined.

	Jakub



More information about the Gcc-patches mailing list