Cross-compile lipng for Beagleboard with Code Sourcery 2012.03-57 (arm)

If you try to compile this library (up to 1.2.50) with this toolchain version you may find an error at link step :
/opt/crosstool/arm-2012.03-57-lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/ld:libpng.vers:2: syntax error in VERSION script

The first encountered error is that the « libpng.vers » script file contains an empty global section (compare when compiling with host).
This section is empty because the libpng.sym file is empty.
Check this calling « make libpng.sym » (after removing it).
You may have the following error :

arm-none-linux-gnueabi-gcc -E -DPNG_CONFIGURE_LIBPNG -DPNG_BUILDSYMS ./png.h
./png.h:470:18: fatal error: zlib.h: No such file or directory

Apparently with other version of prepocessor (arm2009q1, x86 4.3) this does not prevent to make the expected result, but with the last arm toolchain the file is empty.

The workaround : simply use the CPPFLAGS with the include directory (that contains zlib.h).

À propos de Selso

Salut ! Je m'appelle Selso. Je vis à Saint-Etienne depuis 2005. Je suis ingénieur en informatique embarquée en poste chez CIO Systèmes Embarqués.
Cette entrée a été publiée dans Développement, Non classé. Vous pouvez la mettre en favoris avec ce permalien.

Laisser un commentaire