From: Manfred Schwarb <manfred99@gmx.ch>
To: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>
Subject: statically compile in libquadmath
Date: Thu, 27 Jul 2017 13:24:00 -0000 [thread overview]
Message-ID: <8af40a5b-f8f0-8eae-abb1-5c07bfff5e77@gmx.ch> (raw)
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)
This would couple -static-libgfortran to also compile in libquadmath.
While such a hack is not pretty, it would probably match what most users want,
namely to be able to run gfortran programs on other boxes without installed gfortran compiler
(and therefore most probably also without libquadmath),
or to enable additional compile optimizations to gain optimal performance.
Thoughts?
Cheers,
Manfred
PS1: I don't have any gcc paperwork assignments
PS2: I'm off for holidays the next few days, so response will be delayed
next reply other threads:[~2017-07-27 13:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-27 13:24 Manfred Schwarb [this message]
2017-07-28 9:22 ` Kay Diederichs
2017-08-08 12:10 ` Manfred Schwarb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8af40a5b-f8f0-8eae-abb1-5c07bfff5e77@gmx.ch \
--to=manfred99@gmx.ch \
--cc=fortran@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).