[Interest] Cross compiling for Pi with PostgreSQL

Roland Hughes roland at logikalsolutions.com
Tue Sep 26 19:56:33 CEST 2017


Has anybody on this list managed to use the cross compilation 
instructions from either here:
or here:

and gotten PostgreSQL support to compile when the host is a 64-bit 
system and the target is 32-bit Pi?

Both the wiki and that link seem horribly broken.

You will notice the environment/path configuration is incorrect:


checking for PostgreSQL...

/home/roland/piBuild/pitools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/roland/piBuild/sysroot -O2 -Wall -W -fPIC  -I. -I/usr/include/postgresql -I../../../mkspecs/devices/linux-rasp-pi2-g++ -o psql.o psql.cpp

/home/roland/piBuild/pitools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/home/roland/piBuild/sysroot/opt/vc/lib -Wl,-rpath-link,/home/roland/piBuild/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/roland/piBuild/sysroot/lib/arm-linux-gnueabihf -mfloat-abi=hard -Wl,-O1 -o psql psql.o   --sysroot=/home/roland/piBuild/sysroot -L/usr/lib/x86_64-linux-gnu -lpq

/usr/lib/x86_64-linux-gnu/libpq.so: file not recognized: File format not recognized

collect2: error: ld returned 1 exit status

Makefile:92: recipe for target 'psql' failed

make: *** [psql] Error 1

PostgreSQL disabled.

PostgreSQL support cannot be enabled due to functionality tests!

  Turn on verbose messaging (-v) to /home/roland/piBuild/qt-everywhere-opensource-src-5.7.1/qtbase/configure to see the final report.

  If you believe this message is in error you may use the continue

  switch (-continue) to /home/roland/piBuild/qt-everywhere-opensource-src-5.7.1/qtbase/configure to continue.

roland at roland-desktop:~/piBuild/qt-everywhere-opensource-src-5.7.1$ cd /

roland at roland-desktop:/$ sudo find -iname libpq.so

[sudo] password for roland:




Even after the library and required headers are installed on the Pi and 
the entire process is started from scratch the cross compile looks in 
the wrong place for the header (on the 64-bit machine) and the tries to 
link with the 64-bit version of the lib.

Has anybody found the work around for this? Preferably a work around 
which does not require loop mounting the SD image.

Roland Hughes, President
Logikal Solutions


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170926/5e232dfc/attachment.html>

More information about the Interest mailing list