rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.92k stars 318 forks source link

Bear not catching compiler that is specified #279

Closed SethGower closed 4 years ago

SethGower commented 4 years ago

At work I need to use TI's Vision SDK, and am trying to generate the compilation database for it. They use their own code compilers, and bear doesn't seem to be catching all of them. The once that I am trying to get it to catch, along with others is their armcl compiler, because I have determined that is the one that is compiling some of the code I am looking to have indexed. I have tried calling bear --use-cc <full path to armcl> make (I now realize, after poking around in the source that the full path is unnecessary), and it doesn't seem to catch it since it isn't in the compile_commands.json. I have scoured the output of the entire make job using make -Bnkw | tee build_output.txt, and have verified that that is the compiler that is being called. But it doesn't seem that it is working.
To Reproduce It is kinda hard to reproduce, unless you get their build system working. But here is a snapshot of the compile command

/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/cg_tools/linux/ti-cgt-arm_16.9.2.LTS/bin/armcl -c -qq -pdsw225 --endian=little -mv7M4 --float_support=vfplib --abi=eabi -eo.oem4 -ea.sem4 --symdebug:dwarf --embed_inline_assembly -DBIOS_BUILD -DSYSBIOS --common=off --emit_warnings_as_errors -DA15_TARGET_OS_LINUX -DDDR_MEM_1024M -DBSP_DISABLE_I2C0 -DBSP_DISABLE_I2C2 -DBSP_DISABLE_I2C5 -DIPU1_LOAD_EVES -DDDR_MEM_1024M -DCPU_IDLE_ENABLED -g -ms  -D___DSPBIOS___ -D___DUCATI_FW___ -Dxdc_target_name__=M4 -Dxdc_target_types__=ti/targets/arm/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_4_6_1 -ms -oe -O3 -op0 -os --optimize_with_debug --inline_recursion_limit=20 -DTDA2PX_BUILD -DTDA2XX_FAMILY_BUILD -DSOC_TDA2PX -DPLATFORM_EVM_SI -D_DRA7xx -D_SC_VER_1_16 -D__sysbios__ -DFPD_DISPLAY -DUTILS_ASSERT_ENABLE -DFVID2_BACKWARD_COMPATIBLE -DUSE_STD_ASSERT -DTRACE_ENABLE -DASSERT_ENABLE -DENABLE_UART_LOG -D_GNU_SOURCE -DBOARD_TYPE_TDA2PX_RVP -DRELEASE_BUILD -DBUILD_M4 -DBUILD_M4_2 -DPROC_IPU2_INCLUDE -DPROC_DSP1_INCLUDE -DPROC_DSP2_INCLUDE -DPROC_EVE1_INCLUDE -DPROC_EVE2_INCLUDE -DIVAHD_INCLUDE -DDSS_INCLUDE -DCAL_INCLUDE -DISS_INCLUDE -DVPE_INCLUDE -DIPU_PRIMARY_CORE_IPU2 -DIPU_SECONDARY_CORE_IPU1 -DCIO_REDIRECT -DVSDK_VERSION=\"D3/BUILD/VISION_SDK_03_06_355_TDA2PX_RVP_LINUX-39-g9e12\" -DPDK_VERSION=\"D3/BUILD/VISION_SDK_03_06_271_TDA2PX_RVP_LINUX\"       -DTDA2PX_BUILD -DTDA2XX_FAMILY_BUILD -DPLATFORM_EVM_SI -DBOARD_TYPE_TDA2PX_RVP -DVPS_VIP_BUILD  -DVPS_VPE_BUILD -DVPS_CAL_BUILD -DVPS_ISS_BUILD -DVPS_DSS_BUILD -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/cg_tools/linux/ti-cgt-arm_16.9.2.LTS/include -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/cg_tools/linux/ti-cgt-arm_16.9.2.LTS/include/AUTOSAR31 -I. -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/os_tools/bios_6_46_06_00/packages -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/os_tools/linux/xdctools_3_32_01_22_core/packages -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/os_tools/ipc_3_45_00_00/packages -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/drivers/pdk_01_10_02_07/packages -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/codecs/framework_components_3_40_02_07/packages -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/codecs/xdais_7_24_00_04/packages -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/drivers/edma3_lld_02_12_00_21/packages -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/links_fw -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/links_fw/src -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/networking/ndk_2_24_02_31/packages -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/networking/nsp_gmacsw_4_16_00_00/packages -I/packages -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/links_fw/include/config/apps/tda2px_rvp_linux_all -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/algorithms/eve_sw_01_19_00_00/common -I/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/../ti_components/algorithms/REL.TIDL.01.01.03.00/modules/ti_dl/inc -I/home/sgower/Documents/Development/d3/sdk_manager/staging/ti_components/algorithms/REL.TIOP.00.01.00.00/modules/ti_object_propagation/inc -fr=/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/binaries/apps/tda2px_rvp_linux_all/obj/links_common_gate/tda2px-rvp/ipu2/release -fs=/home/sgower/Documents/Development/d3/sdk_manager/staging/vision_sdk/binaries/apps/tda2px_rvp_linux_all/obj/links_common_gate/tda2px-rvp/ipu2/release -fc gateLink_tsk_create_single_mbx.c

Expected behavior I expect it to catch the armcl command, but it doesn't seem to be.

Environment:

Additional context

SethGower commented 4 years ago

Update: I got it to work. I am not sure if it was because I just installed it from source instead of apt, which bumped me up to 2.4.3, or something else. I ended up doing a clean build and running bear -vvv --use-cc armcl --use-cc cl6x --use-cc cl-arp32 make -s. This is a great program!