This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [build] Support libgo on Solaris 2


On 01/13/2011 06:24 PM, Rainer Orth wrote:
The following works for me, also cross-checked with -Bnosuchoption (to
avoid triggering on the -Bunknown:-)

ld_err=`$gcc_cv_ld -Bsymbolic 2>&1`
if echo $ld_err | grep -i  illegal>  /dev/null \
    || echo $ld_err | grep -i unknown>  /dev/null \
    || echo $ld_err | grep -i unrecognized>  /dev/null; then
   :
else
   gcc_cv_ld_static_dynamic=yes
fi

> Subject to what the build maintainers think, of course.
I've CCed Paolo for comments.

I don't think this is how you build a feature test. What if another OS says that -Bsymbolic is "invalid", or has a -B option that takes an arbitrary argument (like -I for the GNU linker)?


The way to build a proper feature test would be to compile a sample dynamic library that uses printf, link it with -Bsymbolic, compile another program that overrides printf and links with the dynamic library, run the program, and check that the overridden printf is not used.

I think that in this case a case statement is better.

Paolo


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