i get the following error when i try to cross compile perf tool for arm

../lib/lk/liblk.a: member ../lib/lk/liblk.a(debugfs.o) in archive is not an object

what i have done ?

cd stable-kernel/tools/perf
make ARCH=arm CROSS_COMPILE=arm-linux-gnu-eabi-gcc

surprisingly when i actually see there its a member

ar -t ../lib/lk/liblk.a 

what may be the reason for this abnormal behaviour?

PS: this did not happen when i did compile for x86 (the usual way make and then make install)


You have to export CC to your ARM tool-chain to compile liblk.a into ARM elf format.

export CC=arm-linux-gnueabihf-gcc

that is because liblk.a is build for x86 and the makescript searches for a liblk.a built for ARM / required platform, so even though the liblk.a is having a member when i look at type of file , by command file liblk.a it showed me clearly that the file is built for x86 so the error raised !

so to overcome this i have first built the liblk.a for ARM and then i have run the makescript which solved the problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.