Compilation problem with oprofile regarding libbfd on latest android-4.2.2_r1 branch?

Hi all,

I am trying to compile the latest android-4.2.2_r1 branch from source (ARM arch, full-eng configuration) and I bump into the following compilation error along the road:

Import includes file: out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/import_includes
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
Export includes file: frameworks/base/tools/obbtool/Android.mk -- out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/export_includes
host Executable: obbtool (out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/obbtool)
Install: out/host/linux-x86/bin/obbtool
Export includes file: external/oprofile/libpp/Android.mk -- out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/export_includes
Export includes file: external/oprofile/libdb/Android.mk -- out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_db_intermediates/export_includes
Export includes file: external/oprofile/libregex/Android.mk -- out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_op_regex_intermediates/export_includes
Export includes file: external/oprofile/libopt++/Android.mk -- out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_opt++_intermediates/export_includes
Export includes file: external/oprofile/libutil++/Android.mk -- out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_util++_intermediates/export_includes
Export includes file: external/oprofile/libpopt/Android.mk -- out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_popt_intermediates/export_includes
Export includes file: external/oprofile/libop/Android.mk -- out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_op_intermediates/export_includes
Export includes file: external/oprofile/libutil/Android.mk -- out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_util_intermediates/export_includes
make: *** No rule to make target `out/host/linux-x86/obj/STATIC_LIBRARIES/libbfd_intermediates/export_includes', needed by `out/host/linux-x86/obj/EXECUTABLES/opannotate_intermediates/import_includes'.  Stop.

I search for some solutions and noticed that a possible solution is to edit external/oprofile/common.mk:

# Common host flags
HAVE_LIBBFD := false

ifeq ($(TARGET_ARCH),arm)
toolchain := prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6
common_host_c_includes := $(common_c_includes) $(toolchain)/include
common_host_cflags := $(common_cflags) -fexceptions -DANDROID_HOST -DHAVE_XCALLOC
common_host_ldlibs_libiconv :=

ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-x86)
HAVE_LIBBFD := true
common_host_cflags += -DMISSING_MREMAP
common_host_ldlibs_libiconv := -liconv
else
ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
HAVE_LIBBFD := false
endif
endif


Quote from a post I found regarding this topic: "Yes, if you're using linaro's toolchain you need to set HAVE_LIBBFD := false in external/oprofile/common.mk". I noticed this is apparently not an android-4.2.2_r1 specific problem, but older version have this too. 

LIBBFD is apparently a Binary File Descriptor library and it seems my tool chain has this functionality too:

$ ls -1 <toolchainpath>/arm-linux-androideabi-4.6/lib32

libbfd.a
libbfd.la
libiberty.a
libintl.a


I have 2 question about this:

  1. Someone has any idea why the library is not picked up correctly, although it seems to be included in the tool chain?
  2. Is it OK to just disable the BFD support in oprofile (a continuous system-wide profiler)? It sounds like this might have mayor impact on my resulting build.

Any hints on this one really appreciated.

 

Best regards,

Bart

 

Are you using the Android-provided toolchains in prebuilts/gcc/? Did you make any change to it?
The Android platform build system will pick up the prebuilt libbfd (and other libraries) via the following makefiles:
<paths-to-the-root-of-the-toolchain>/lib32/Android.mk
<paths-to-the-root-of-the-toolchain>/toolchain.mk
Then that file will be conditionally included in build/libs/host/Android.mk.

原文链接: https://www.cnblogs.com/sinojelly/archive/2013/04/03/2998790.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    Compilation problem with oprofile regarding libbfd on latest android-4.2.2_r1 branch?

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/83201

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月9日 下午8:57
下一篇 2023年2月9日 下午8:58

相关推荐