[yocto] How to enable php5 (php_5.5.24.bb) support for postgresql

Paul Eggleton paul.eggleton at linux.intel.com
Thu May 28 04:15:22 PDT 2015


On Saturday 23 May 2015 11:12:22 yocto yocto wrote:
> after looking at the config.log that I sent you I realized that all "unsafe
> for cross-compilation" message occur because the recipe tries to link
> against my local installation of postgresql-server-dev-9.3 and libpq-dev
> lying in /usr/lib. Consider the following line:
> 
> "skipping incompatible /usr/lib/libpq.so when searching for -lpq"
> 
> The recipe is doing right to skip the library, because I am using Ubuntu
> 64bit. Therefore my local installations of postgresql-server-dev-9.3 and
> libpq-dev are 64 bit versions. So yesterday evening/night I did the
> following:
> 
> - I installed a virtual machine Ubuntu 32 bit
> - I downloaded the latest linux sources (edison-src-ww18-15-1.tgz)
> - I added the meta-openembbed layer (daisy branch)
> - I removed the php recipe from the daisy branch and replaced it by the
> latest from the master branch
> - I added PACKAGECONFIG_pn-php = "mysql sqlite3 pgsql" in local.conf
> - I added my own layer
> - I built the image
> 
> Result: Everything builds fine from scratch beside the php recipe. I
> appended the latest config.log. As you can see some dependencies are
> missing resulting in linker errors and I still get the "unsafe for
> cross-compilation" error.
>
> Is the approach of the recipe correct (linking against local packages?).

Certainly not. A recipe built for the target machine should never be picking 
up includes or libraries from the host, that's why this check exists. We need 
to ensure the configure script does not look at host locations at all. I guess 
one reason we haven't picked up on this is that by default postgres 
functionality is disabled.

> What is your system configuration? Do you have any ideas or do you know a
> person who might help?

The system I did my most recent build on is a CentOS 6 machine, but that's 
probably not why it works for me - it likely works for me because I simply 
don't have postgres or its development files installed, so there's nothing for 
the configure script to find on the host.

Unfortunately this is a case where someone is going to have to dig into the 
php configure script, find out how that -L/usr/lib is getting into the linker 
path, and then stop that from happening; depending on how it is getting in 
there that may be an additional argument to the configure script or it might 
require patching the configure.ac file. Using "grep" and a little knowledge of 
how autoconf works this shouldn't be too difficult, but it's not something I 
have time for at the moment.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list