chipKIT® Development Platform

Inspired by Arduino™

Can't build 32 bit elf output file

Created Mon, 19 Dec 2011 04:39:53 +0000 by phgphd


phgphd

Mon, 19 Dec 2011 04:39:53 +0000

I am running the 32bit MP IDE 0022-linux32-20110822 on a 64 bit Ubuntu 11.10 linux laptop. The target is the MAX32 chipkit. Compilation/link fails with the error message

/home/phil/Projects/mpide-0022-linux32-20110822/hardware/pic32/compiler/pic32-tools/bin/../pic32mx/bin/gcc/pic32mx/4.5.1/cc1plus: error while loading shared libraries: libelf.so.1: wrong ELF class: ELFCLASS64

I know this means the the gcc compiler/linker is attempting to use the /usr/lib/libelf.so.1 64 bit library which is of course incompatible with the 32 bit gcc supplied with the MP IDE. I have a 32 bit libelf library and have attempted to place it in just about every sub-directory under the mpide-0022-linux32-20110822 parent directory, hoping that it will be found in the 32 bit gcc search path before going outside to the /usr/lib directory. BUT no such luck.

Does anyone have any advice?


Jacob Christ

Mon, 19 Dec 2011 14:35:08 +0000

Hey, good find, you should add this as an issue on the MPIDE project page so that the maintainers can keep track of the issue. Though I think they all follow the threads here, if they see this when they are busy it might get overlooked.

https://github.com/chipKIT32/chipKIT32-MAX

Jacob


phgphd

Wed, 21 Dec 2011 03:27:06 +0000

This has been solved. I have placed 32 bit versions of libelf.so.1 and libreadline.so.6 in the mpide-0022-linux32-20110822/lib directory. The 32 bit libelf is needed for generating the output elf binary. The 32bit libreadline is needed for uploading through the USB-serial interface. I obtained the 32bit versions from a USB boot jumpdrive of Ubuntu 11.10 32 bit linux.


Jacob Christ

Wed, 21 Dec 2011 05:37:38 +0000

If you have not done so you should post this as an issue with a suggested resolution so that when the next version comes out you and others can benefit from your research.