From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: hans-peter.nilsson@axis.com (Hans-Peter Nilsson)
Cc: ian@airs.com, fxcoudert@gmail.com, gcc-patches@gcc.gnu.org,
ubizjak@gmail.com, fortran@gcc.gnu.org
Subject: Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"
Date: Tue, 25 Aug 2015 17:57:00 -0000 [thread overview]
Message-ID: <20150825174506.DAEEA39FA@oc7340732750.ibm.com> (raw)
In-Reply-To: <201508251658.t7PGwUk5005209@ignucius.se.axis.com> from "Hans-Peter Nilsson" at Aug 25, 2015 06:58:30 PM
Hans-Peter Nilsson wrote:
> > From: Ulrich Weigand <uweigand@de.ibm.com>
> > Date: Tue, 25 Aug 2015 14:59:05 +0200
>
> > The other GCC run-time libraries rely on libtool to figure out
> > that even though -fPIC works, dynamic libraries are still not
> > supported on the platform, and thus compile everything for
> > static linking (i.e. without -fPIC).
>
> That's not what I see, at least not the "figuring out" part.
> (They mostly use libtool as-is; some test tuples, but some test
> version-script support and add it then.)
Well, the "figuring out" is implicit; because libtool knows the
platform does not support dynamic linking, it defaults to
--disable-shared, which means only static libraries are being
built; and the default compile option when building static
libraries does not use -fPIC.
> I'll leave that to you to sort out, but if you chose to use
> $can_build_shared, consider also setting PIC_FLAG to $pic_flag
> (instead of plain -fPIC). In the meantime I'll commit my patch
> as it solves *some* of the breakage; for targets erroring on -fPIC.
>
> ...but reading the libtool documention I think I found a much
> better solution: Let's just add -prefer-pic when compiling
> libbacktrace. It leaves everything to libtool. Can you please
> test this?
Hmm, reading the documentation an even simpler version that has
equivalent effect to yours should be just adding the pic-only
option when calling LT_INIT.
However, neither works for the SPU, because in both cases libtool
will only do the test whether the target supports the -fPIC option.
It will not test whether the target supports dynamic libraries.
[ It will do that test; and default to --disable-shared on SPU.
That is a no-op for libbacktrace however, since it calls LT_INIT
with the disable-shared option anyway. When adding back the -fPIC
flag due to either the pic-only LT_INIT option or the -prefer-pic
libtool command line option, it does not check for that again. ]
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2015-08-25 17:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-14 13:19 [patch,libgfortran,toplevel] Use libbacktrace in libgfortran Uros Bizjak
2015-08-14 14:31 ` FX
2015-08-23 20:14 ` Janne Blomqvist
2015-08-23 20:59 ` FX
2015-08-23 21:27 ` Janne Blomqvist
2015-08-24 7:15 ` FX
2015-08-24 16:00 ` Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran" Hans-Peter Nilsson
2015-08-24 16:08 ` FX
2015-08-24 16:44 ` Hans-Peter Nilsson
2015-08-24 18:42 ` FX
2015-08-25 3:29 ` Ian Lance Taylor
2015-08-25 13:25 ` Ulrich Weigand
2015-08-25 17:09 ` Hans-Peter Nilsson
2015-08-25 17:57 ` Ulrich Weigand [this message]
2015-08-26 0:09 ` Hans-Peter Nilsson
2015-08-26 12:17 ` Ulrich Weigand
2015-08-26 12:34 ` Hans-Peter Nilsson
2015-08-26 15:37 ` [PATCH] Fix and simplify (Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran") Ulrich Weigand
2015-08-27 4:02 ` Ian Lance Taylor
2015-08-27 13:38 ` Ulrich Weigand
2015-08-27 14:02 ` Ian Lance Taylor
2015-08-24 16:04 ` Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran" Hans-Peter Nilsson
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=20150825174506.DAEEA39FA@oc7340732750.ibm.com \
--to=uweigand@de.ibm.com \
--cc=fortran@gcc.gnu.org \
--cc=fxcoudert@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hans-peter.nilsson@axis.com \
--cc=ian@airs.com \
--cc=ubizjak@gmail.com \
/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).