On 18 May 2017 at 10:23, Bin Chen <bin.chen@linaro.org> wrote:Hi,I have two directories under device/poplar, one is gralloc one is audio.All gralloc and audio builds fine with mm inside of the directory. But weridthing happens when trying to build on the top of source using make gralloc.poplarFrom the error message, it is because when building the gralloc.poplar, the audio sourceis included, but the compiler option (cflag, include) are actually the one setup for gralloc![ 14% 1/7] target thumb C: gralloc.poplar <= device/hisilicon/poplar/audio/audio_hw.c FAILED: /bin/bash -c "(PWD=/proc/self/cwd prebuilts/misc/linux-x86/ccache/ccache prebuilts/clang/host/linux-x86 /clang-2690385/bin/clang -I vendor/arm/mali6xx -I vendor/arm/mali6xx/include -I vendor/arm/mali6xx/kernel/incl ude -I system/core/libion/include -I device/hisilicon/poplar/grallo c -I out/target/product/poplar/obj/ SHARED_LIBRARIES/gralloc.popla r_intermediates -I out/target/product/poplar/gen/ SHARED_LIBRARIES/gralloc.popla r_intermediates -I libnativehelper/include/native helper \$(cat out/target/product/poplar/obj/ SHARED_LIBRARIES/gralloc.popla r_intermediates/import_include s) -isystem system/core/include -isystem system/media/audio/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/in clude -isystem hardware/ril/include -isystem libnativehelper/include -isystem frameworks/native/include -isystem frameworks/native/opengl/inclu de -isystem frameworks/av/include -isystem frameworks/base/include -isystem out/target/product/poplar/obj/ include -isystem bionic/libc/arch-arm/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/common -isystem bionic/libc/kernel/uapi/asm-ar m -isystem bionic/libm/include -isystem bionic/libm/include/arm -c -fno-exceptions -Wno-multichar -msoft-float -ffunction-sections -fdata-sections -funwind-tables -fstack-protector-strong -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=2 -fno-short-enums -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=neon -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -DNDEBUG -g -Wstrict-aliasing=2 -DNDEBUG -UDEBUG -D__compiler_offsetof=__built in_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argum ent -fcolor-diagnostics -nostdlibinc -target arm-linux-androideabi -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/ arm-linux-androideabi-4.9/arm- linux-androideabi/bin -std=gnu99 -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -DLOG_TAG=\\\"gralloc\\\" -DSTANDARD_LINUX_SCREEN -DMALI_ION=1 -DMALI_AFBC_GRALLOC=0 -DGRALLOC_32_BITS -DMALI_ARCHITECTURE_UTGARD=0 -DPLATFORM_SDK_VERSION=25 -DDISABLE_FRAMEBUFFER_HAL=0 -DMALI_SUPPORT_AFBC_WIDEBLK=0 -DMALI_USE_YUV_AFBC_WIDEBLK=0 -DAFBC_YUV420_EXTRA_MB_ROW_NEE DED=0 -DGRALLOC_USE_ION_DMA_HEAP=0 -DGRALLOC_USE_ION_COMPOUND_PAG E_HEAP=0 -DGRALLOC_INIT_AFBC=0 -DGRALLOC_FB_SWAP_RED_BLUE -DGRALLOC_ARM_FORMAT_SELECTION _DISABLE -fPIC -D_USING_LIBCXX -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=null-dereference -Werror=return-type -MD -MF out/target/product/poplar/obj/ SHARED_LIBRARIES/audio.primary .poplar_intermediates/audio_ hw.d -o out/target/product/poplar/obj/ SHARED_LIBRARIES/audio.primary .poplar_intermediates/audio_ hw.o device/hisilicon/poplar/audio/ audio_hw.c ) && (cp out/target/product/poplar/obj/ SHARED_LIBRARIES/audio.primary .poplar_intermediates/audio_ hw.d out/target/product/poplar/obj/ SHARED_LIBRARIES/audio.primary .poplar_intermediates/audio_ hw.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\\\\$//' -e '/^\$/ d' -e 's/\$/ :/' < out/target/product/poplar/obj/ SHARED_LIBRARIES/audio.primary .poplar_intermediates/audio_ hw.d >> out/target/product/poplar/obj/ SHARED_LIBRARIES/audio.primary .poplar_intermediates/audio_ hw.P; rm -f out/target/product/poplar/obj/ SHARED_LIBRARIES/audio.primary .poplar_intermediates/audio_ hw.d )" I hunted down a little bit and find this cmd comes from the build-poplar.ninja file which is generated by kati.And it is wrong for unknown reason. If we do a mm inside of the module, the generated .ninjia fileis correct.I tend to think there is something wrong with the kati in certain circumstance...
I debug the Android.mk file, by printing out the $(LOCAL_SRC_FILES) before calling$(BUILD_SHARED_LIBRARY). And include $(CLEAR_VARS) were called in each Android.mk.including ./device/hisilicon/poplar/audio/Android.mk ... ./device/hisilicon/poplar/audio/Android.mk:36: audio_hw.c including ./device/hisilicon/poplar/gralloc/Android.mk ... ./device/hisilicon/poplar/gralloc/Android.mk:171: gralloc_module.cpp alloc_device.cpp alloc_ion.cpp gralloc_module_ion.cpp framebuffer_device.cpp format_chooser.cpp format_chooser_blockinit.cpp gralloc_vsync_default.cpp gralloc_hisilicon_adp.cpp Note that audio_hw.c is not in the source of gralloc target.What can possible go wrong?--Regards,Bin--Regards,Bin