Shaojun Wang

Android build error with -llzo2 and -luuid on 64 bits ubuntu

Discussion created by Shaojun Wang Employee on Jan 22, 2013
Latest reply on Sep 25, 2014 by shinu V

When build ICS on 64 bits ubuntu 11.10, if there is -llzo2 in some Android.mk, even you have already run “sudo apt-get install liblzo2-dev”, you may still meet some build error.

For example, in attached mtd-utils package, there is -llzo2 in mtd-utils/mkfs.ubifs/Android.mk, so you may meet this kind of error message:

 

host Executable: mkfs.ubifs (out/host/linux-x86/obj/EXECUTABLES/mkfs.ubifs_intermediates/mkfs.ubifs)

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../liblzo2.so when searching for -llzo2

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../liblzo2.a when searching for -llzo2

/usr/bin/ld: skipping incompatible /usr/lib/liblzo2.so when searching for -llzo2

/usr/bin/ld: skipping incompatible /usr/lib/liblzo2.a when searching for -llzo2

/usr/bin/ld: cannot find -llzo2

collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/EXECUTABLES/mkfs.ubifs_intermediates/mkfs.ubifs] Error 1

 

To fix the error, you should install 32 bits lzo2 and luuid to your 64 bits ubuntu. Below is the example of lzo2.

 

1. Down 32 bits lzo2, then unpack it to a folder. You can get the lzo2 deb package in the attachmemt.

$ sudo mkdir /usr/lib/liblzo2_i386

$ sudo dpkg -x liblzo2-dev_2.05-1_i386.deb /usr/lib/liblzo2_i386/

$ sudo dpkg -x liblzo2-2_2.05-1_i386.deb /usr/lib/liblzo2_i386/

 

2. Change the link of liblzo2 from default 64 bit lib to 32 bit lib.

$ cd /usr/lib/

$ sudo rm liblzo2.a

$ sudo rm liblzo2.so

$ sudo rm liblzo2.so.2

$ sudo ln -s liblzo2_i386/usr/lib/liblzo2.a liblzo2.a

$ sudo ln -s liblzo2_i386/usr/lib/liblzo2.so.2.0.0 liblzo2.so

$ sudo ln -s liblzo2_i386/usr/lib/liblzo2.so.2.0.0 liblzo2.so.2

Original Attachment has been moved to: liblzo2-2_2.05-1_i386.deb.zip

Original Attachment has been moved to: liblzo2-dev_2.05-1_i386.deb.zip

Original Attachment has been moved to: mtd-utils.tgz

Original Attachment has been moved to: uuid-dev_2.20.1-1ubuntu3_i386.deb.zip

Outcomes