CrossComiling Xorg X11R7.1 for ARM (Error at makekeys : cannot execute binary)

Nix nix at esperi.org.uk
Tue Oct 17 14:06:56 PDT 2006


On Tue, 17 Oct 2006, zubair ahmed mused:
> Few more error now..
> i got this error after i appied patchs from the Xorg site ,,,

There are more errors there than you noticed. Some are potentially
serious.

> test -z "/root/Rnd/Arun/out/lib/pkgconfig" || mkdir -p -- "/root/Rnd/Arun/out/lib/pkgconfig"
>  /usr/bin/install -c -m 644 'compositeproto.pc' '/root/Rnd/Arun/out/lib/pkgconfig/compositeproto.pc'

First, are you (or whatever script you're using) setting PKG_CONFIG_PATH
to point through /root/Rnd/Arun/out/lib/pkgconfig? Some things will fail
to link unless you do that.

> checking dependency style of arm_v5t_le-gcc... none

I'd expect that to say `gcc3' or something like that.

> /bin/sh ../libtool --mode=link arm_v5t_le-gcc  -g -O2   -o libAppleWM.la -rpath /root/Rnd/Arun/out/lib -version-info 7:0:0 -no-undefined libAppleWM_la-applewm.lo -L/root/Rnd/Arun/out/lib -lX11 -lXext   
> rm -fr  .libs/libAppleWM.a .libs/libAppleWM.la .libs/libAppleWM.lai .libs/libAppleWM.so .libs/libAppleWM.so.7 .libs/libAppleWM.so.7.0.0
> ../libtool: line 4115: test: : integer expression expected
> ../libtool: line 4115: test: : integer expression expected
> creating reloadable object files...
> creating a temporary reloadable object file: .libs/libAppleWM.la-1.o
> arm_v5t_le-ld -r -o .libs/libAppleWM.la-1.o .libs/libAppleWM_la-applewm.o 
> arm_v5t_le-gcc -shared .libs/libAppleWM.la-1.o  -Wl,--rpath -Wl,/root/Rnd/Arun/out/lib -Wl,--rpath -Wl,/root/Rnd/Arun/out/lib -L/root/Rnd/Arun/out/lib /root/Rnd/Arun/out/lib/libX11.so /root/Rnd/Arun/out/lib/libXext.so  -Wl,-soname -Wl,libAppleWM.so.7 -o .libs/libAppleWM.so.7.0.0
> rm -f .libs/libAppleWM.la-1.o
> (cd .libs && rm -f libAppleWM.so.7 && ln -s libAppleWM.so.7.0.0 libAppleWM.so.7)
> (cd .libs && rm -f libAppleWM.so && ln -s libAppleWM.so.7.0.0 libAppleWM.so)
> ../libtool: line 5405: test: : integer expression expected
> ../libtool: line 5405: test: : integer expression expected
> using piecewise archive linking...
> ../libtool: line 5440: test: : integer expression expected
> arm_v5t_le-ar cru .libs/libAppleWM.a libAppleWM_la-applewm.o
> arm_v5t_le-ranlib .libs/libAppleWM.a
> creating libAppleWM.la

*That* is a sign that something's wrong with your libtool configuration
(or the libtool configuration of whoever ran autogen.sh or autoreconf on
the source tree). It often means that when libtoolize was run,
acinclude.m4 already existed and contained some libtool-related (LT_*)
macros belonging to an earlier version of libtool.

(libtool 2.x will diagnose this case, just like automake 1.10 already
does.)

> arm_v5t_le-gcc -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -g -O2 -o .libs/sxpm sxpm-sxpm.o  -L/root/Rnd/Arun/out/lib -lXt /root/Rnd/Arun/out/lib/libSM.so /root/Rnd/Arun/out/lib/libICE.so /root/Rnd/Arun/out/lib/libXext.so ../src/.libs/libXpm.so /root/Rnd/Arun/out/lib/libX11.so /root/Rnd/Arun/out/lib/libXau.so /root/Rnd/Arun/out/lib/libXdmcp.so -ldl -Wl,--rpath -Wl,/root/Rnd/Arun/out/lib
> /opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/bin/../target/usr/lib/libXt.so: undefined reference to `_Xsetlocale'

Now this is partly a real cross-compilation-related problem, and partly
fallout from modularization.

On non-Darwin platforms, the _Xsetlocale() symbol is defined in libX11
if and only if X_LOCALE is #defined at libX11 build time. It's referenced
by <X11/Xlocale.h> if and only if X_LOCALE is #defined when that header
is used.


(Aside: On Darwin platforms, it is always defined, although with a
different definition if X_LOCALE is not #defined.

Pre-modularization, __DARWIN__ was #defined by util/cf/darwin.cf:

/*
 * __DARWIN__ will be used for platform specific #ifdefs that can't
 * be handled by existing X defines.
 *
 * Darwin's alloca() seg faults (rather than returning NULL) on failed
 * allocations, so we can't use it.
 */
#define StandardDefines         DarwinMachineDefines -D__DARWIN__ \
                                -DNO_ALLOCA -DCSRG_BASED DarwinLocaleDefines

Post-modularization, nothing defines it, yet there are many places in
the tree that still reference it. In my cut-down copy of the tree (with
most video drivers that I don't own not present), I see:

lib/lbxutil/src/image/lbxbwcodes.h:#ifdef __DARWIN__
lib/lbxutil/src/image/lbxbwcodes.h:#ifdef __DARWIN__
lib/lbxutil/src/image/lbxfax.h:#ifdef __DARWIN__
lib/X11/src/xlibi18n/XlcPubI.h:#ifdef __DARWIN__
lib/X11/src/SetLocale.c:#ifdef __DARWIN__
lib/X11/src/SetLocale.c:#endif /* __DARWIN__ */
proto/X11/Xosdefs.h:#ifdef __DARWIN__
util/lndir/lndir.c:#ifdef __DARWIN__
util/imake/imakemdep.h:        "-D__DARWIN__",
util/makedepend/imakemdep.h:        "-D__DARWIN__",
util/cf/darwin.cf: * __DARWIN__ will be used for platform specific #ifdefs that can't
util/cf/darwin.cf:#define StandardDefines         DarwinMachineDefines -D__DARWIN__ \
xserver/miext/rootless/rootlessConfig.h:#ifdef __DARWIN__
xserver/miext/rootless/rootlessConfig.h:#endif /* __DARWIN__ */
xserver/include/window.h:#ifdef __DARWIN__
xserver/include/window.h:#ifdef __DARWIN__
xserver/include/resource.h:#ifdef __DARWIN__
xserver/include/dixfont.h:#ifdef __DARWIN__
xserver/include/cursor.h:#ifdef __DARWIN__
xserver/hw/vfb/InitOutput.c:#ifdef __DARWIN__
xserver/hw/xnest/Init.c:#ifdef __DARWIN__
xserver/GL/glx/glxcmdsswap.c:#ifndef __DARWIN__
xserver/GL/glx/glxcmds.c:#ifndef __DARWIN__
xserver/GL/glx/glxscreens.c:#ifndef __DARWIN__
xserver/dix/main.c:#if defined(__DARWIN__) && defined(DARWIN_WITH_QUARTZ)
xserver/mi/miinitext.c:#ifndef __DARWIN__
xserver/mi/miinitext.c:#ifndef __DARWIN__
xserver/mi/miinitext.c:#ifndef __DARWIN__
xserver/Xprint/ddxInit.c:#ifdef __DARWIN__
xserver/Xprint/attributes.c:    defined(__DARWIN__)

These will likely all require adjustment, ideally to use feature
tests...)


... but this is all irrelevant for you because you're trying to cross-
compile to Linux/ARM, not Darwin. I'd guess your problem is that
X_LOCALE was not defined when you compiled libX11, but *was* defined
when you compiled libXt.

I strongly suspect that the cause of this is your not setting
PKG_CONFIG_PATH. If your distribution compiled libX11 on your
cross-compilation host with -DX_LOCALE set, then libX11.pc on the host
may well have -DX_LOCALE in its Cflags stanza, which would be picked up
(erroneously) when cross-building other packages (because
PKG_CONFIG_PATH is set wrong and is picking up the host's pkg-config
files rather than the target's, and thus defining X_LOCALE when building
libXt even though it was not defined when building libX11).

The only thing which makes me a bit nervous is that almost *nobody*
defines X_LOCALE anymore: if your cross-compilation host does, um,
what on earth is it?

-- 
`When we are born we have plenty of Hydrogen but as we age our
 Hydrogen pool becomes depleted.'



More information about the xorg mailing list