From: Tony Houghton on
I'm trying to compile a 32-bit Firefox (Deer Park 1.5) on AMD64 Ubuntu.
I've got as far as experimentally running the configure script to see
what else I need 32-bit versions of besides ia32-libs-dev etc. I'm using
CFLAGS=-m32 and an identical CXXFLAGS. I'm also passing
--build=i686-linux --target=i686-linux to configure because that's what
the glibc deb does when building the 32-bit version on AMD64. Firefox's
configure fails with:

....
checking for cairo >= 0.3.0... yes
checking CAIRO_CFLAGS... -I/usr/include/cairo
checking CAIRO_LIBS... -lcairo
configure: error: Could not find the following X libraries: -lX11 -lXext -lXt

Those 3 libraries are present in /usr/lib32, which is represented in
/etc/ld.so.conf. However, there are no links with just an .so suffix ie:

/usr/lib32/libX11.so.6 -> libX11.so.6.2.0
/usr/lib32/libX11.so.6.2.0

but no /usr/lib32/libX11.so

Would that be the cause of the problem, and why doesn't ldconfig create
the links if they're needed? I've also tried adding "-L/usr/lib32" to
C(XX)FLAGS but that didn't help either.

--
The address in the Reply-To is genuine and should not be edited.
See <http://www.realh.co.uk/contact.html> for more reliable contact addresses.
From: Paul F. Johnson on
Tony Houghton wrote:

> Those 3 libraries are present in /usr/lib32, which is represented in
> /etc/ld.so.conf. However, there are no links with just an .so suffix ie:
>
> /usr/lib32/libX11.so.6 -> libX11.so.6.2.0
> /usr/lib32/libX11.so.6.2.0
>
> but no /usr/lib32/libX11.so
>
> Would that be the cause of the problem, and why doesn't ldconfig create
> the links if they're needed? I've also tried adding "-L/usr/lib32" to
> C(XX)FLAGS but that didn't help either.

The way I would do it is to explicitly say where the libs are
(--LIBDIR=/usr/lib32 or whatever) and ensure that you actually have the 32
bit libs installed (and not just symlinks which may or may not go to the 64
bit versions).

It's caught me a number of times.

If all else files though, have a look at using mock which is capable of
compiling for any target platform (assuming the libs exist!)

TTFN

Paul

From: Tony Houghton on
This message has got quite an important bit at the bottom, so anybody
who knows a thing or two about shared libraries please don't skip it
when it appears to be going nowhere in the first few paragraphs!

In <s6rFf.265937$D47.84286(a)fe3.news.blueyonder.co.uk>,
Paul F. Johnson <paul(a)all-the-johnsons.co.uk> wrote:

> Tony Houghton wrote:
>
>> Those 3 libraries are present in /usr/lib32, which is represented in
>> /etc/ld.so.conf. However, there are no links with just an .so suffix ie:
>>
>> /usr/lib32/libX11.so.6 -> libX11.so.6.2.0
>> /usr/lib32/libX11.so.6.2.0
>>
>> but no /usr/lib32/libX11.so
>>
>> Would that be the cause of the problem, and why doesn't ldconfig create
>> the links if they're needed? I've also tried adding "-L/usr/lib32" to
>> C(XX)FLAGS but that didn't help either.
>
> The way I would do it is to explicitly say where the libs are
> (--LIBDIR=/usr/lib32 or whatever) and ensure that you actually have the 32
> bit libs installed (and not just symlinks which may or may not go to the 64
> bit versions).
>
> It's caught me a number of times.

I'm using --libdir=/usr/lib32 anyway but I don't think it's relevant to
the problem. It determines where libraries are installed, not where to
look for libraries to link with.

~ $ file /usr/lib32/libX11.so.6.2.0
/usr/lib32/libX11.so.6.2.0: ELF 32-bit LSB shared object, Intel 80386,
version 1 (SYSV), stripped

> If all else files though, have a look at using mock which is capable of
> compiling for any target platform (assuming the libs exist!)

I've tried -m32 etc with newsstar and it compiled OK. That does have a
much smaller set of dependencies though.

Important stuff coming up:

I've now tried creating the *.so$ symlinks by hand (ie
/usr/lib32/libX{11|ext|t}.so) and this time configure passed.

So I know what the problem is, but not why it's a problem. To test
whether or not it's specific to firefox's configure script I tried a
test with a canonical hello world:

~ $ gcc -m32 -lX11 -o hellow hellow.c
~ $ ldd hellow
...
libX11.so.6 => /usr/lib32/libX11.so.6 (0x55582000)
...

Note that it shows libX11.so.6 as opposed to libX11.so, but again if I
remove /usr/lib32/libX11.so it can't find the library at compile time.
But it can link OK at runtime if I compile it before removing libX11.so.
If I remove libX11.so.6 runtime linking fails too.

Anyway, so it's not firefox's fault. Should ldconfig create libX11.so?
Its man page implies it should handle ia32 libraries on an x86_64
system:

: ldconfig is capable of storing multiple ABI types of libraries into a
: single cache on architectures which allow native running of multiple
: ABIs, like ia32/ia64/x86_64 or sparc32/sparc64.

If OTOH it isn't supposed to create the links, then perhaps ia32-libs is
buggy for not creating them?

--
The address in the Reply-To is genuine and should not be edited.
See <http://www.realh.co.uk/contact.html> for more reliable contact addresses.
From: Chris Lingard on
Tony Houghton wrote:

> checking for cairo >= 0.3.0... yes
> checking CAIRO_CFLAGS... -I/usr/include/cairo
> checking CAIRO_LIBS... -lcairo
> configure: error: Could not find the following X libraries: -lX11 -lXext
> -lXt

Suggest you check where libcairo.so thinks that those libraries should be
with a ldd /usr/lib/libcairo.so (or wherever)

You might have to edit libcairo.la, here on my 64 bit system I have

# Libraries that this one depends upon.
dependency_libs=' -L/usr/X11R6/lib64 -lXrender -lX11 -lXext
-lpng12 /usr/lib/libfontconfig.la /usr/lib/libfreetype.la /usr/lib/libexpat.la /usr/lib/libfreetype.la
-lz -lm'

Chris Lingard



From: Tony Houghton on
In <ds5r94$m6i$1(a)slavica.ukpost.com>,
Chris Lingard <chris(a)stockwith.co.uk> wrote:

> Tony Houghton wrote:
>
>> checking for cairo >= 0.3.0... yes
>> checking CAIRO_CFLAGS... -I/usr/include/cairo
>> checking CAIRO_LIBS... -lcairo
>> configure: error: Could not find the following X libraries: -lX11 -lXext
>> -lXt
>
> Suggest you check where libcairo.so thinks that those libraries should be
> with a ldd /usr/lib/libcairo.so (or wherever)

You could be onto something, because I think cairo is something I
currently only have a 64-bit version of so far. I should have realised
that trying to go straight to ./configure before resolving dependencies
in a more methodical way would end in tears!

--
The address in the Reply-To is genuine and should not be edited.
See <http://www.realh.co.uk/contact.html> for more reliable contact addresses.