This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: static linking of gfortran libraries
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Kay Diederichs <kay dot diederichs at uni-konstanz dot de>
- Cc: Fortran List <fortran at gcc dot gnu dot org>
- Date: Mon, 18 Jan 2016 10:51:42 +0200
- Subject: Re: static linking of gfortran libraries
- Authentication-results: sourceware.org; auth=none
- References: <n7i7di$r0h$1 at ger dot gmane dot org>
On Mon, Jan 18, 2016 at 10:23 AM, Kay Diederichs
<kay.diederichs@uni-konstanz.de> wrote:
> Dear all,
>
> on CentOS 6 one could use -static-libgcc -static-libgfortran to obtain a
> binary which would run on other computers which don't have gfortran
> installed.
>
> On CentOS 7 one can install the libgfortran-static and
> libquadmath-static RPMs but the resulting binary _still_ requires
> /lib64/libquadmath.so as revealed by ldd. gfortran does not recognize an
> option like -static-libquadmath . libquadmath is required even for tiny
> programs which do not use high precision data types.
>
> Heavy use of Google did not bring any result. I tried with linker
> options -Wl,-Bstatic and so on, but without changes.
> So, can anyone tell me how to compile/link with gfortran a binary which
> does not have a requirement for libquadmath?
You might want to backport the patch for PR 50201,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50201, or file a bug
report to RedHat and hope that they will do it.
> If this is not possible, why are there libgfortran-static and
> libquadmath-static RPMs ?
That's something you have to ask RedHat. I guess they haven't tested
it and the bug has gone unnoticed.
--
Janne Blomqvist