I dug up the archive and found a workaround of creating a soft link to libbfd.so and it worked. The build progressed and crashed here -
make[3]: Entering directory `/home/ckk/oprofile-0.9.6/libabi'
/bin/sh ../libtool --tag=CXX --mode=link g++ -W -Wall -fno-common -ftemplate-depth-50 -g -O2   -o opimport  opimport.o libabi.a ../libdb/libodb.a ../libopt++/libopt++.a ../libutil++/libutil++.a ../libutil/libutil.a -lpopt -liberty -ldl
g++ -W -Wall -fno-common -ftemplate-depth-50 -g -O2 -o opimport opimport.o  libabi.a ../libdb/libodb.a ../libopt++/libopt++.a ../libutil++/libutil++.a ../libutil/libutil.a /usr/lib/libpopt.so -liberty -ldl
/usr/lib/libpopt.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[3]: *** [opimport] Error 1
make[3]: Leaving directory `/home/ckk/oprofile-0.9.6/libabi'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/ckk/oprofile-0.9.6/libabi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ckk/oprofile-0.9.6'
make: *** [all] Error 2


On Mon, Aug 9, 2010 at 2:13 PM, C K Kashyap <ckkashyap@gmail.com> wrote:
Hi,
I was trying to build oprofile on RHEL4 x86_84 box. I get the following error -
I even tried with ./configure --with-pic - but I get the same error. Could someone please help me with this?

make[2]: Entering directory `/home/ckk/profile/oprofile-0.9.6/libopagent'
if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I..    -fPIC -I ../libop -I ../libutil -g -O2 -MT libopagent_la-opagent.lo -MD -MP -MF ".deps/libopagent_la-opagent.Tpo" -c -o libopagent_la-opagent.lo `test -f 'opagent.c' || echo './'`opagent.c; \
then mv -f ".deps/libopagent_la-opagent.Tpo" ".deps/libopagent_la-opagent.Plo"; else rm -f ".deps/libopagent_la-opagent.Tpo"; exit 1; fi
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -fPIC -I ../libop -I ../libutil -g -O2 -MT libopagent_la-opagent.lo -MD -MP -MF .deps/libopagent_la-opagent.Tpo -c opagent.c  -fPIC -DPIC -o .libs/libopagent_la-opagent.o
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -fPIC -I ../libop -I ../libutil -g -O2 -MT libopagent_la-opagent.lo -MD -MP -MF .deps/libopagent_la-opagent.Tpo -c opagent.c -o libopagent_la-opagent.o >/dev/null 2>&1
/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O2   -o libopagent.la -rpath /usr/local/lib/oprofile -version-info  1:0:0 -Wl,--version-script=../libopagent/opagent_symbols.ver libopagent_la-opagent.lo -lbfd -liberty -ldl  
gcc -shared  .libs/libopagent_la-opagent.o  -lbfd -liberty -ldl  -Wl,--version-script=../libopagent/opagent_symbols.ver -Wl,-soname -Wl,libopagent.so.1 -o .libs/libopagent.so.1.0.0
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/libbfd.a(archures.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/libbfd.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libopagent.la] Error 1
make[2]: Leaving directory `/home/ckk/profile/oprofile-0.9.6/libopagent'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ckk/profile/oprofile-0.9.6'
make: *** [all] Error 2
[root@gdnh1001.adx.ac4 oprofile-0.9.6]#

--
Regards,
Kashyap



--
Regards,
Kashyap