A Problem About Cross Compiling

Bora Sahin bora.sahin at ttnet.net.tr
Fri May 6 12:04:09 PDT 2005


Hello,

Alexander Gottwald wrote:

>> Bora Sahin wrote:
>> cc -I../../../exports/include -o xkbcomp  xkbcomp.o xkbscan.o expr.o vmod.o indicators.o misc.o \
>> alias.o keymap.o keycodes.o keytypes.o compat.o action.o symbols.o geometry.o \
>> xkbpath.o listing.o xkbparse.o parseutils.o utils.o  -L/usr/X11R6/lib -lxkbfile -lX11
>> /usr/bin/ld: cannot find -lxkbfile
>> collect2: ld returned 1 exit status
>>
>> As it seems, it is trying to use the host toolchain and libs, not the crosscompiled ones. (My host
>> system doesnt contain libxkbfile). After seeing that err msg I looked at Imakefile of it.
>>
>> XCOMM Assumes local libraries installed in /usr/X11R6/lib
>> LOCAL_LIBRARIES = -L/usr/X11R6/lib $(XKBFILELIB) $(XONLYLIB)
>>
>> ROOT_DEFINES = -DDFLT_XKB_CONFIG_ROOT=\"$(LIBDIR)/xkb\"
>>
>> INCLUDES = -I.. -I$(EXTINCSRC)
>>
>> This clearly states that it will use "-L/usr/X11R6/lib $(XKBFILELIB) $(XONLYLIB)". I am wondering is
>> this part of compiling to be done on the host system? or it should be fixed?

> It is quite useful to
> #define UseInstalledOnCrossCompile YES
> if you're crosscompiling. This will use the tools from the system instead of compiling special versions.

I think there is a misunderstanding here. Let me do try to express it more clearly. My host.def file
is below...

#define NothingOutsideProjectRoot YES
#define UseInstalledOnCrossCompile YES
#define DefaultGcc2PpcOpt -O2 -mcpu=603e -mno-string
#define HasFreetype2 NO
#define HasFontconfig NO
#define HasExpat NO
#define HasNCurses NO

Xorg finds my crosstoolchain correctly. It compiles but when it comes to xkbcomp/cross dir, it fires
error message and says libxkbfile is not found. But the problem is in the point of trying to find
host system's xkbfile, not the crosscompiled one. libxkbfile is in the correct dir. I think this is
"extra" dir.

After seeing that err msg, I looked at xkbcomp/croos/Imakefile and see:

XCOMM Assumes local libraries installed in /usr/X11R6/lib
LOCAL_LIBRARIES = -L/usr/X11R6/lib $(XKBFILELIB) $(XONLYLIB)

ROOT_DEFINES = -DDFLT_XKB_CONFIG_ROOT=\"$(LIBDIR)/xkb\"

INCLUDES = -I.. -I$(EXTINCSRC)

So, while imake creating the Makefile, it sets the library search dir to the host system, not the
cross compiled one. I can do
      make -i blabala CROSSCOMPILEDIR=...
and pass that phase but I am wondering if this is a build bug or not?

Thanks...

-- 
Bora SAHIN



More information about the xorg mailing list