Thanks Will,
After installing the packages you mentioned, I was able to install - I still had to create a soft link ibbfd.so to point to libbfd-2.15.92.0.2.so though.

Now I need to install oprofile on a server machine where there are no X libraries. Are there any recommendations for that? Installing qt etc is not an option there.
 

On Mon, Aug 9, 2010 at 8:15 PM, William Cohen <wcohen@redhat.com> wrote:
On 08/09/2010 07:40 AM, C K Kashyap wrote:
> 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 <mailto: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 <http://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 <http://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
>

Hi Kashyap,

One thing you might do is make sure that you have all the rpms used for building the oprofile rpm installed on the machine. The list of packages oprofile srpm's oprofile.spec required to build oprofile are:

BuildPreReq: qt-devel
BuildPreReq: libxslt
BuildPreReq: docbook-style-xsl
BuildPreReq: docbook-utils
BuildPreReq: elinks
BuildPreReq: gtk2-devel
BuildPreReq: automake

I tried to build the oprofile-0.9.6 from the pristine oprofile-0.9.6.tar.gz on a RHEL-4 i686 machine that has been updated and it built fine. I used the same configure as for the rpmbuild on RHEL-4. The following is i686 machine:

 ./configure --with-kernel-support --host=i686-redhat-linux-gnu --target=i386-redhat-linux-gnu --build=i686-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --with-separate-debug-dir=/usr/lib/debug --enable-abi



-Will

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
oprofile-list mailing list
oprofile-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list



--
Regards,
Kashyap