Hi Tobias,

>> 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.)
>
> the patch went in shortly after Paolo's approval, followed recently by
> another one to fix major fallout.  The latter prompted me to wait until
> I tackle this one...
>
>>> 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
>
> Still the effect is the same: both binaries depend on libquadmath.so.
> TBH, I don't know why the use of --as-needed/-z ignore should depend on
> -static-libgfortran at all.
>
>> I don't know whether one could do better.
>
> If there are no scenarios where this machinery avoids the libquadmath.so
> dependency completely, I don't really see a good use for.
>
>> +      # Test for native Solaris options first.
>>
>> Is there a reason that you first test the Solaris's options?
>
> Yes: Solaris ld from Solaris 11 onwards (sometimes backported to Solaris
> 10) has gained support for gld options for compatibility.  --as-needed
> isn't among the supported ones yet, but there's an open bug for that.
>
> I think it's better to stay with the native options if possible, so I
> prefer the Solaris ones over the GNU compatiblity ones.
>
>> +      # 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.)
>
> I know.
>
>>> Ok for mainline if testing passes?
>>
>> Looks fine to me - I don't know whether a build maintainer has still a
>> comment.
>
> Testing has passed successfully now on both targets.

how should we proceed with this patch now, given the questions above?
Install as is, although it doesn't seem really beneficial, or drop it?

Thanks.
        Rainer


>>> 2013-05-14  Rainer Orth  <r...@cebitec.uni-bielefeld.de>
>>>
>>>     * acinclude.m4 (libgfor_cv_have_as_needed): Check for -z ignore, too.
>>>     * configure: Regenerate.

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to