I'm trying to write BitBake unixodbc, postgresql, and psqlodbc recipes for ARM platform, to integrate with Yocto Project. First of all, I wrote custom BitBake recipes for unixodbc and postgresql. These recipes build and package libs and bins for the ARM platform, as expected.
Now I'm trying to write a recipe for the Official ODBC driver for PostgreSQL (psqlodbc). The psqlodbc configure task needs a "odbc_config" tool (--with-unixodbc flag) compiled for native (x86) platform to execute do_configure task fine. That "odbc_config" tool is built by my custom unixodbc recipe for the ARM platform (as expected), but not for the native platform (x86):
$ file /path/to/tmp/work/armplatform/unixodbc/2.3.1-r0/image/usr/bin/odbc_config /path/to/tmp/work/armplatform/unixodbc/2.3.1-r0/image/usr/bin/odbc_config: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=06728a67598eca297d7dcf83cf15a020c74d11ce, not stripped
The problem is when my psqlodbc recipes tries to use "odbc_config" generated by my unixodbc recipe, task do_configure fails with this ERROR message:
/path/to/tmp/work/armplatform/psqlodbc/09.03.0210-r0/psqlodbc-09.03.0210/configure: line 4272: /path/to/tmp/work/armplatform/unixodbc/2.3.1-r0/image/usr/bin/odbc_config: cannot execute binary file: Exec format error
How should this situation be properly managed with BitBake recipes?
Exec format error
– Charles C.