Re: 答复: oProfile building trouble
William Cohen <[email protected]>
| Newsgroups | gmane.linux.oprofile |
|---|---|
| Message-ID | <[email protected]> |
On 02/16/2017 08:49 PM, [email protected] wrote: > Hi Will, > > Thank you for your reply. > > The building issue (" liberty library not found") was fixed. But the new issue("/usr/lib/libbfd.so : error adding symbols:") was appeared in oProfile-v1.0.0. > > I don`t konw why it did not use my libbfd.so that I have given in configure parameter. And I am sure my libbfd.so( "/home/ryan/workdir/brcm/tvos2.0-dth/tvos-dbs/platform/linux_h5/target/external/binutils/usr/lib/libbfd.so ") is fine . Below is my building parameter: > > export AS=$(TARGET_AS); \ > export LD=$(TARGET_LD); \ > export CC=$(TARGET_CC); \ > export CXX=$(TARGET_CXX); \ > export AR=$(TARGET_AR); \ > export NM=$(TARGET_NM); \ > export STRIP=$(TARGET_STRIP); \ > export OBJCOPY=$(TARGET_OBJCOPY); \ > export OBJDUMP=$(TARGET_OBJDUMP); \ > export RANLIB=$(TARGET_RANLIB); \ > export CFLAGS="$(CFLAGS) -I$(OUTDIR)/include ";\ > export LDFLAGS="$(LDFLAGS) -L$(OUTDIR)/external/popt/usr/lib -L$(OUTDIR)/external/binutils/usr/lib"; \ > export LD_LIBRARY_PATH="$(OUTDIR)/external/binutils/usr/lib:$(OUTDIR)/external/zlib/usr/lib:$(OUTDIR)/external/popt/usr/lib";\ > export LIBRARY_PATH="$(OUTDIR)/external/binutils/usr/lib:$(OUTDIR)/external/zlib/usr/lib:$(OUTDIR)/external/popt/usr/lib";\ > export ac_cv_va_copy=yes; \ > ./configure --host=mipsel-linux-gnu --with-kernel=/home/ryan/workdir/platform/linux_h5/platform/kernel/linux --with-extra-libs=$(OUTDIR)/external/popt/usr/lib/:$(OUTDIR)/external/zlib/usr/lib:$(OUTDIR)/external/binutils/usr/lib --with-extra-includes=$(OUTDIR)/include --with-binutils=$(PRIVATE_LOCAL_PATH)/../binutils/binutils-2.26 --prefix=$(TARGET_PREFIX) ; > > I also build oProfile-v1.1.0 in the same configure parameter. The error message("kernel supports perf_events... no ") appeared again. > > I have already opened the kernel option in ordering to make Linux support to oProfile. > CONFIG_PERF_EVENTS=y > CONFIG_PROFILING=y > CONFIG_OPROFILE=y > CONFIG_HAVE_OPROFILE=y > > Just make it work, I don`t care the oProfile version. I enclosed building log, both of them. > > I am anticipating your reply. > > Best Regards, > Ryan > Date:10/10/2015 The error message in the oprofile_v1_0.log is: /bin/bash ../libtool --tag=CC --mode=link mipsel-linux-gcc -fPIC -I/home/ryan/workdir/platform/linux_h5/target/include -version-info 1:1:0 -Wl,--version-script=../libopagent/opagent_symbols.ver -L/home/ryan/workdir/platform/linux_h5/target/external/popt/usr/lib -L/home/ryan/workdir/platform/linux_h5/target/external/binutils/usr/lib -L/home/ryan/workdir/platform/linux_h5/external/oprofile/../binutils/binutils-2.26/lib -Xlinker -R -Xlinker /home/ryan/workdir/platform/linux_h5/external/oprofile/../binutils/binutils-2.26/lib -L/home/ryan/workdir/platform/linux_h5/target/external/popt/usr/lib -L/home/ryan/workdir/platform/linux_h5/target/external/binutils/usr/lib -o libopagent.la -rpath /usr/lib/oprofile libopagent_la-opagent.lo -lbfd -liberty -ldl libtool: link: mipsel-linux-gcc -shared .libs/libopagent_la-opagent.o -L/home/ryan/workdir/platform/linux_h5/target/external/popt/usr/lib -L/home/ryan/workdir/platform/linux_h5/target/external/binutils/usr/lib -L/home/ryan/workdir/platform/linux_h5/external/oprofile/../binutils/binutils-2.26/lib /usr/lib/libbfd.so -L/home/ryan/workdir/platform/linux_h5/external/binutils/binutils-2.26/bfd/../libiberty/pic -L/home/ryan/workdir/platform/linux_h5/external/binutils/binutils-2.26/zlib -lz -liberty -ldl -Wl,--version-script=../libopagent/opagent_symbols.ver -Wl,-R -Wl,/home/ryan/workdir/platform/linux_h5/external/oprofile/../binutils/binutils-2.26/lib -Wl,-soname -Wl,libopagent.so.1 -o .libs/libopagent.so.1.0.1 /usr/lib/libbfd.so: error adding symbols: File in wrong format It looks like an issue due to the cross compile (target is mips, but the host is x86_64). Is looks like the compiler is trying to link it /usr/lib/libbfd.so rather than You might take a look at how cross compile was done for arm on the following threads as a examples: https://sourceforge.net/p/oprofile/mailman/oprofile-list/thread/[email protected]/ http://oprofile-list.sf.narkive.com/m5jF92DK/instructions-for-cross-compile-oprofile-using-codesourcery-2008q3-arm-none-linux-gnueabi-toolchain -Will > > > > > -----邮件原件----- > 发件人: William Cohen [mailto:[email protected]] > 发送时间: 2017年2月16日 22:53 > 收件人: [email protected]; [email protected] > 主题: Re: oProfile building trouble > > On 02/15/2017 08:51 PM, [email protected] wrote: >> Hi all, >> >> I met some trouble when I build oprofile. It shows me "kernel supports perf_events... no“. >> >> I have tried oprofile-1.0.0, oprofile-1.1.0, oprofile-0.9.6. >> >> My building environment is kernel3.3.8, binutils-2.26 and popt-1.14. >> >> I enclosed building log. Any help would be appreciated. >> >> BestRegards, >> >> Ryan >> >> Date:10/10/2015 > > Hi Ryan, > > The real problem seems to be: > > checking for cplus_demangle in -liberty... no > configure: error: liberty library not found > > The configure can't find the needed file ( libiberty.a) to build things with liberty. On fedora these are supplied by binutils-devel. I am not so sure what supplies them for the cross compile enviroment you are using. > > -Will > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ oprofile-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oprofile-list