On Tue, Aug 8, 2017 at 3:10 PM, Manfred Schwarb <manfre...@gmx.ch> wrote: > Am 27.07.2017 um 15:24 schrieb Manfred Schwarb: >> Hi, >> >> there is the long standing annoyance that it is very hard to >> statically compile in libquadmath. >> See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539 and >> https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00375.html. >> >> Unfortunately, the patch from FX went nowhere, and the >> second suggestion of Tobias (gfortran -specs=myspecfile) does not work. >> >> There remain two working options: >> 1) compile with gcc: >> # gcc -static-libgcc -Wl,-Bstatic -lgfortran -lquadmath -Wl,-Bdynamic -lm >> 2) modify <prefix>/lib*/libgfortran.spec of the compiler itself >> >> It crossed my mind that one could do the second option in a conditional way: >> >> --- libgfortran.spec.old 2017-05-29 15:55:24.939239222 +0000 >> +++ libgfortran.spec 2017-07-27 12:55:05.006518676 +0000 >> @@ -5,4 +5,4 @@ >> # >> >> %rename lib liborig >> -*lib: %{static-libgfortran:--as-needed} -lquadmath >> %{static-libgfortran:--no-as-needed} -lm %(libgcc) %(liborig) >> +*lib: %{static-libgfortran:--as-needed} %{static-libgfortran:-Bstatic} >> -lquadmath %{static-libgfortran:-Bdynamic} >> %{static-libgfortran:--no-as-needed} -lm %(libgcc) %(liborig) >> > > Well, --as-needed and -Bstatic together makes not really much sense. > And, according to my experiences, somehow --as-needed does not work at all in > this context, > libquadmath will always be linked in, even when there is no use of quad > precision. > > So the following would make more sense: > > --- libgfortran.spec.old 2017-05-29 21:46:01.036867084 +0000 > +++ libgfortran.spec 2017-08-08 12:04:01.500558409 +0000 > @@ -5,4 +5,4 @@ > # > > %rename lib liborig > -*lib: %{static-libgfortran:--as-needed} -lquadmath > %{static-libgfortran:--no-as-needed} -lm %(libgcc) %(liborig) > +*lib: %{static-libgfortran:-Bstatic} -lquadmath > %{static-libgfortran:-Bdynamic} -lm %(libgcc) %(liborig)
On a semi-related note, it seems the recently released glibc 2.26 contains quad math functions. Does that mean we should change to use those in preference to libquadmath when available? I suppose libquadmath cannot be deprecated either, since it's still needed for non-glibc targets. Or to put it another way, what's the point of quad math support in glibc, since libquadmath already exists? -- Janne Blomqvist