This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Future of libquadmath and glibc 2.26 (Re: statically compile in libquadmath)
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Manfred Schwarb <manfred99 at gmx dot ch>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Tue, 8 Aug 2017 15:16:53 +0300
- Subject: Future of libquadmath and glibc 2.26 (Re: statically compile in libquadmath)
- Authentication-results: sourceware.org; auth=none
On Tue, Aug 8, 2017 at 3:10 PM, Manfred Schwarb <manfred99@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