Re: [PATCH] Fix and simplify (Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran")

2015-08-27 Thread Ian Lance Taylor
"Ulrich Weigand" writes: > Ian Lance Taylor wrote: >> "Ulrich Weigand" writes: >> >> > I've verified that this works on x86_64: the resulting >> > libgfortran.so uses the -fPIC version of the libbacktrace >> > object, while libgfortran.a uses the non-PIC versions. >> > >> > On SPU, libtool will

Re: [PATCH] Fix and simplify (Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran")

2015-08-27 Thread Ulrich Weigand
Ian Lance Taylor wrote: > "Ulrich Weigand" writes: > > > I've verified that this works on x86_64: the resulting > > libgfortran.so uses the -fPIC version of the libbacktrace > > object, while libgfortran.a uses the non-PIC versions. > > > > On SPU, libtool will now automatically only generate the

Re: [PATCH] Fix and simplify (Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran")

2015-08-26 Thread Ian Lance Taylor
"Ulrich Weigand" writes: > I've verified that this works on x86_64: the resulting > libgfortran.so uses the -fPIC version of the libbacktrace > object, while libgfortran.a uses the non-PIC versions. > > On SPU, libtool will now automatically only generate the > non-PIC versions since the target d

[PATCH] Fix and simplify (Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran")

2015-08-26 Thread Ulrich Weigand
Hans-Peter Nilsson wrote: > I don't feel very confused, but I understand you've investigated > things down to a point where we can conclude that libtool can't > do what SPU needs without also at least fiddling with > compilation options. Well, looks like I was confused after all. I missed one ex

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-26 Thread Hans-Peter Nilsson
> From: Ulrich Weigand > Date: Wed, 26 Aug 2015 13:45:35 +0200 > Hans-Peter Nilsson wrote: > > > From: Ulrich Weigand > > > Date: Tue, 25 Aug 2015 19:45:06 +0200 > > > > > However, neither works for the SPU, because in both cases libtool > > > will only do the test whether the target supports t

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-26 Thread Ulrich Weigand
Hans-Peter Nilsson wrote: > > From: Ulrich Weigand > > Date: Tue, 25 Aug 2015 19:45:06 +0200 > > > 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 lib

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-25 Thread Hans-Peter Nilsson
> From: Ulrich Weigand > Date: Tue, 25 Aug 2015 19:45:06 +0200 > Hans-Peter Nilsson wrote: > 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. >

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-25 Thread Ulrich Weigand
Hans-Peter Nilsson wrote: > > From: Ulrich Weigand > > 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 > > st

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-25 Thread Hans-Peter Nilsson
TL;DR: See last... > From: Ulrich Weigand > Date: Tue, 25 Aug 2015 14:59:05 +0200 > However, the compiler actually does accept -fPIC. If the flag is > present, we attempt to generate relocatable code, but only to the > extent the compiler can do that without support for run-time > relocations.

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-25 Thread Ulrich Weigand
Ian Lance Taylor wrote: > Hans-Peter Nilsson writes: > > > * configure.ac: Only compile with -fPIC if the target > > supports it. > > * configure: Regenerate. > > This is OK. I'm now running into the same problem on SPU, but unfortnately this patch still doesn't fix the problem. No

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-24 Thread Ian Lance Taylor
Hans-Peter Nilsson writes: > * configure.ac: Only compile with -fPIC if the target > supports it. > * configure: Regenerate. This is OK. Thanks. Ian

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-24 Thread FX
> You're absolutely right on both accounts. Also, the function > body is supposed to be a function body (...) or else we get a > nested function (i.e. foo inside main). Might as well provide > both empty. Also fixing the ChangeLog entry. Sorry for > goofing. (At least I had a look at config.lo

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-24 Thread Hans-Peter Nilsson
> From: FX > Date: Mon, 24 Aug 2015 18:07:52 +0200 > > PIC_FLAG= > > if test -n "${with_target_subdir}"; then > > - PIC_FLAG=-fPIC > > + AC_TRY_COMPILE([void foo(void){}], [PIC_FLAG=-fPIC]) > > fi > > There's something I don't understand about this > test. Shouldn't AC_TRY_COMPILE take a firs

Re: Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-24 Thread FX
> PIC_FLAG= > if test -n "${with_target_subdir}"; then > - PIC_FLAG=-fPIC > + AC_TRY_COMPILE([void foo(void){}], [PIC_FLAG=-fPIC]) > fi There’s something I don’t understand about this test. Shouldn’t AC_TRY_COMPILE take a first (empty) argument, “includes”? And shouldn’t you first set the -fPI

Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-24 Thread Hans-Peter Nilsson
(Goofed on the CC line, sorry for the dup.) There exists targets that support fortran but error on -fPIC, for example cris-elf, which broke with the libbacktrace thingy. (Emitting an error for -fPIC is a conscious choice; a compilation error is better than e.g. to silently ignoring it.) This fix c

Fix libbacktrace -fPIC breakage from "Use libbacktrace in libgfortran"

2015-08-24 Thread Hans-Peter Nilsson
There exists targets that support fortran but error on -fPIC, for example cris-elf, which broke with the libbacktrace thingy. (Emitting an error for -fPIC is a conscious choice; a compilation error is better than e.g. to silently ignoring it.) This fix causes build to pass the point of error for cr