This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libgfortran, build] Use -z ignore instead of --as-needed on Solaris


Rainer Orth wrote:
As requested by Tobias, this patch supports -z ignore with Solaris ld
instead of GNU ld's --as-needed.

For reference, my request was motivated by http://gcc.gnu.org/ml/gcc-patches/2013-04/msg00425.html
(The patch has been approved, but it does not seem to be in, yet.)

i386-pc-solaris2.10 and x86_64-unknown-linux-gnu bootstraps are still
running.  In both cases, the correct options were detected and written
into libgfortran.spec.  AFAICS the -static-libgfortran option isn't
exercised anywhere in the testsuite, so I've both relinked one of the
gfortran.dg testcases and a trivial FORTRAN hello world program with
-static-libgfortran.  -z ignore/--as-needed is passed correctly in both
cases, but while libgfortran is now linked statically, libquadmath.so is
still dragged in due to references to at least quadmath_snprintf.  I
thus can't tell if this --as-needed/-z ignore stuff ever does any good.

Well, it kind of works - but seemingly not fully. If I use:
   print *, "Hello World"; end
with -static-libgfortran, I get ("nm a.out"):
                 w quadmath_snprintf@@QUADMATH_1.0

While using a quad-precision variable, e.g.,
   print *, 123.4_16; end
gives
                 U quadmath_snprintf@@QUADMATH_1.0

I don't know whether one could do better.

 * * *

+      # Test for native Solaris options first.

Is there a reason that you first test the Solaris's options?



+      # No whitespace after -z to pass it through -Wl.

(By the way, you can use "-Wl,-z,ignore" if you want to have the space. For the purpose of this patch, the space doesn't matter.)

Ok for mainline if testing passes?

Looks fine to me - I don't know whether a build maintainer has still a comment.

Tobias

2013-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* acinclude.m4 (libgfor_cv_have_as_needed): Check for -z ignore, too.
	* configure: Regenerate.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]