[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/46478: www/curl does not compile on Solaris/sparc with compiler not configured with devel/libelf
The following reply was made to PR pkg/46478; it has been noted by GNATS.
From: David Holland <dholland-pbugs%netbsd.org@localhost>
Subject: Re: pkg/46478: www/curl does not compile on Solaris/sparc with
compiler not configured with devel/libelf
Date: Sun, 24 Jun 2012 20:55:35 +0000
On Fri, Jun 01, 2012 at 02:20:06PM +0000, J?rn Clausen wrote:
> I can compile the test from the configure script stand alone without
> problems. If I truss the complete compile run, I see that the system
> libelf is used twice:
> 20943: open("/lib/libelf.so", O_RDONLY) = 4
> 20947: open("/lib/libelf.so.1", O_RDONLY) = 3
> The first process is the assembler (/usr/ccs/bin/as), the second one the
> linker (/usr/ccs/bin/ld). When I repeat this with LD_LIBRARY_PATH set to
> pkgsrc's library directory, this happens:
> 20856: open("/usr/pkgsrc/20120411/lib/libelf.so", O_RDONLY) = 4
> 20860: open("/lib/libelf.so.1", O_RDONLY) = 3
> I.e. the assembler uses pkgsrc's libelf, the linker still the native
> one. Apart from the fact, that ELF should be ELF and the code generated
> with one libelf should probably still be readable by the other, this
> seems to be root of the problem.
The two copies of libelf may not be entirely compatible though. One
would hardly expect them to be, especially since one was shipped by
Sun using who knows what sources of who knows what antiquity.
> Note that the assembler uses the library without version number, the
> linker requests a specific version of the library. Note further, that
> pkgsrc's libelf only provides the suffixes .0 and .0.0.0.
> So, why is this only a problem on sparc but not on i86? It turns out,
> that the assembler on i86 does not read libelf at all, so it can't
> switch between the native and the pkgsrc version.
> One workaround might be to add a symlink libelf.so.1 pointing to
> pkgsrc's version of libelf, so that one is always used. But maybe
> someone has a better idea.
Sun's assembler needs to be using only Sun's libelf. Otherwise the
behavior of the assembler is undefined. It is a bug in the assembler
that it will randomly pick up some other libelf (not even of the right
soname) but that is after all the sort of quality one expects from Sun
The right fix, I think, is to make sure the assembler doesn't see the
pkgsrc libelf. As long as it's being run via the pkgsrc tool wrappers,
it should be possible to arrange this; either making sure
LD_LIBRARY_PATH is set to a known value, or using LD_PRELOAD to load
the correct libelf explicitly, should do the trick. I don't know
offhand how to arrange either of these things, but I'm sure it can be
David A. Holland
Main Index |
Thread Index |