Interrogate and cross-compiling

Hi everybody.

I’m stuck with a cross-compiling issue. I’ve been able to cross-compile (host x86 64bit, target ARM 32bit) a basic Panda3D installation using ppremake and tweaking my Config.pp.
Now I’m getting at the step of compiling with Python support, but I have the problem that the “interrogate” binary generated and installed by dtool is compiled (obviously) for ARM, and so it doesn’t work in my x86. On the contrary if I use a x86 “interrogate” binary I have the problem that libraries are built for ARM, so I get:

error while loading shared libraries: libp3interrogatedb.so: wrong ELF class: ELFCLASS32

Is there any way to cross-compile Panda3D from an x86 host to an ARM target? Am I missing something?

I know I can build natively, but I’d like to know if there’s a possibility to continue cross-compiling 'cause I get more CPU power and other good stuff by doing so.

Thank you so much,
Diego

Sure. First, set yourself up to build natively. In your Config.pp file, define the line:

#define LINK_ALL_STATIC yes

Then compile dtool only (don’t bother with building the rest of panda), which will build you (among other things) interrogate and interrogate_module, nicely compiled with static libraries so they’re standalone and don’t depend on any other .so files in dtool. Rename these files to, for instance, stinterrogate and stinterrogate_module, and put them on your path.

Now switch back to cross compiling, and in your Config.pp file, remove the LINK_ALL_STATIC line and define the lines:

#define INTERROGATE stinterrogate
#define INTERROGATE_MODULE stinterrogate_module

You are telling ppremake to use the native stinterrogate binaries that you built and set aside, instead of the cross-built interrogate that it will build now.

David

Thank you drwr,

your answer has been very useful!

Thank you so much,
Diego