1

I am cross compiling oprofile for arm.

$ export CC=arm-linux-gnueabi-gcc
$ export CXX=arm-linux-gnueabi-g++
$ export CXXCPP='arm-linux-gnueabi-g++ -E'
$ export CPP='arm-linux-gnueabi-gcc -E'

I get the following error (see the last line)

checking for ld... /usr/arm-linux-gnueabi/bin/ld
checking /usr/include/linux/perf_event.h usability... yes
checking /usr/include/linux/perf_event.h presence... yes
checking for /usr/include/linux/perf_event.h... yes
checking kernel supports perf_events... yes
checking whether PERF_RECORD_MISC_GUEST_KERNEL is defined in perf_event.h... yes
checking whether precise_ip is defined in perf_event.h... yes
checking whether malloc attribute is understood... no
checking whether __builtin_expect is understood... yes
checking for sched_setaffinity... yes
checking for perfmonctl... no
checking for poptGetContext in -lpopt... no

configure: error: popt library not found

If I do not set my CXX, CPP to cross-compiler binaries then the configure step completes just fine, without errors.

How can I fix this?

Ankur Agarwal
  • 23,692
  • 41
  • 137
  • 208

1 Answers1

0

oprofile package has the following dependencies

1) popt

2) binutils

The popt and binutils package provides libraries which are used by oprofile. So compile popt and binutils first. You can also refer the below link

http://bylnote.blogspot.in/2014/04/cross-compile-oprofile-for-arm-linux.html

ashwanth selvam
  • 486
  • 3
  • 13