|
|

楼主 |
发表于 2006-9-23 05:40:39
|
显示全部楼层
另外一篇回复。作者:Ken Moffat。
On Fri, Sep 22, 2006 at 04:00:49AM +0800, Jonathan Davis wrote:
> > When a package is building, how does it know where to find the
> > libraries? I haven't been able to find anywhere that manages to
> > explain it very well.
> >
I shall leave that fascinating question for someone who knows the
answer!
> > To get packages to correctly located libraries do I always have to use
> > libdir=/lib64 or alter their makefiles - even if the package does not
> > compile any new libraries?
No, in a "regular" package, libdir will only control where created
libraries get installed. But, I've seen so much weirdness recently
that there is probably a package somewhere which tries to use
--libdir to find its libraries ;)
> >
> > Once compiled, I assume that a binary know what it needs to link to
> > based on what it was compiled with.
ldd to show what it needs.
> > However, I want to make sure that
> > I understand how to properly deal with 64-bit libraries before I get
> > far into BCLFS so that I can avoid having problems like all of my
> > 64-bit programs attempting to link against 32-bit libraries (or vice
> > versa). Thanks for any help that you can give me.
As a general rule, most things creating libraries probably benefit
from --libdir, but by no means all packages will respect it. It
really helps to build on "monolib" (single size, just /lib and /usr/lib)
first, to know which packages install libraries.
On multilib, most of us make mistakes and end up putting 64-bit
libraries in /lib (or occasionally the opposite error). Log what
gets installed (a simple find -newer works for me : doesn't get all
the headers, but it does most of the important things). Sometimes
you will need to check what each package did before moving on.
Libtool archives (.la libraries) are sometimes a problem, mostly it
seems to be 32-bit that wants to link against 64-bit libs, try
LDFLAGS='-L/lib -L/usr/lib' on the configure, after that try
LDEMULATION (see the 32-bit libtool page in your arch's version of
multilib for the value to use).
Beyond that, many aggravations are either package-specific:
the popt in BLFS-svn is using lib64 on some platforms (x86_64, ppc64,
sparc64) regardless of which word size it is building, see the blfs
wiki
openssh often needs kicking into shape, consult the wikis (Jim told
me we have one, but I haven't looked at it yet)
kde built as 64-bit might need --with-qt-libraries=/usr/lib64
--enable-libsuffix=64 --libdir/usr/lib64 (works like that, but the
libsuffix might be auto-detected in current kde, and perhaps it
might even find qt in lib64)
a few things need config updates for x86_64 or ppc64 (mostly, use the
system's config.guess and config.sub; for jpeg search for the
configury patch for multilib
lesstif is troublesome on lib64 - I did it once, but I've resolved
not to bother again :-)
Or else they are arch-specific:
any mozilla code probably needs ac_cv_visibility_pragma=no except on
x86.
gtk on ppc64 needs -mminimal-toc in its CFLAGS (I haven't built any
64-bit gnome code there to see if there is a knock-on effect, or
even if it works).
firefox (32-bit) doesn't work on ppc64 (that might be me, I've given
up trying to debug it, all I know is that firefox-bin returns code 1
after a couple of seconds looking about in the /usr/lib/firefox-1.5.0.x/
directory for libraries before going to ld.so.conf). Maybe the
gecko engine will be useful for yelp and epiphany, that remains to
be seen. Using a separate (newer) nss like the BLFS book shows for
people installing more than one mozilla product is definitely
helpful in getting any of it to build.
quite a few packages still omit -fPIC for x86_64. I think that Mesa
on x86_64 lib64 might be straightforward, unlike x86_64-64 and ppc64
-fPIC is also needed in libmng (sed it into the makefile.linux),
a52dec, has been needed on others in the past. At least with this
the error message is reasonably descriptive.
I haven't touched on the use of the multilib wrapper (mainly
because my current semi-usable build predates it), but you will need
to sort out the things that come in two sizes - freetype and
fontconfig progs, gtk and pango, pkgconfig, perhaps even tiffconf.h
from libtiff (if your two wordsizes disagree about any sizeof
values - they do on ppc64). This is why multilib is such fun!
What you _will_ need to do, if you haven't already, is decide what
you are hoping to achieve. From that you can work out what is going
to be 32-bit, and what 64.
Ken
-- das eine Mal als Tragödie, das andere Mal als Farce |
|