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] Use elfdump, readelf in make_sunver.pl


Hi Ralf,

> Bummer that nm makes such problems.  I wonder whether similar problems
> are lurking in libtool already, given that it tries to make do with nm
> (plus some per-system arguments) everywhere except on w32.  Do you have
> a simple test case, or can describe one that I could try to use?

it very much depends on how you parse nm output and if you try to match
all lines or ignore ones you don't.  Problems were e.g. caused by
register symbols being included in Sun (or GNU, I don't really remember)
output on SPARC which make_sunver.pl didn't know about.  The worst
problem lately, though, was the fact that collect2 with -flto tries to
parse nm output, but simply ignores it if it isn't in GNU nm format
(e.g. the default Sun/System V nm output).

>> 2010-11-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>> 
>> 	* make_sunver.pl: Use elfdump -s to extract symbols if possible,
>> 	readelf -s otherwise.
>
> Doesn't this need an update to lib{gfortran,...}/configure.ac and/or
> gcc/doc/install.texi, either testing and/or documenting the requirement
> for either elfdump or readelf?

I don't think so: elfdump is in the base system, and I don't think we
specificially document requirements for ar, nm or ld.  readelf is only
need for cross compilation, and you will always need a cross toolchain
in that case, so there's nothing new either.

>> +# The path to elfdump.
>> +my $elfdump = "/usr/ccs/bin/elfdump";
>
>> +if (-f $elfdump) {
>
> Doesn't this break cross-compilation, potentially using a build tool for
> a target file?

No, make_sunver.pl is only used for *-*-solaris2* targets, and
Solaris/x86 elfdump can deal with Solaris/SPARC objects just fine.

	Rainer

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


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