This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS 12.2 Scanner discovery bug



Hi *,

Scanner discovery does not work.

Under:

Project Properties > C/C++ General > Preprocessor Include Paths, Macros etc. > Providers

-> CDT Cross GCC Built-In Compiler Settings

Default Command to get compiler specs:

${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"

1) Unfortunately ```${COMMAND}``` is not populated!

I manually changed it to:

"${CG_TOOL_CLANG}" -c  -E -P -v -dD "${INPUTS}"

Whereas I got the command from:

Now, the command can be at least executed, but doesn't give the desired results.

Console output from Scanner Discovery:

12:48:48 **** Running scanner discovery: CDT Cross GCC Built-in Compiler Settings ****

"C:\\ti\\ccs1220\\ccs\\tools\\compiler\\ti-cgt-armllvm_2.1.2.LTS\\bin\\tiarmclang.exe" -c -E -P -v -dD H:/ccs_workspace/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec
TI Arm Clang Compiler 2.1.2.LTS
Target: arm-ti-none-eabi
Thread model: posix
InstalledDir: C:\ti\ccs1220\ccs\tools\compiler\ti-cgt-armllvm_2.1.2.LTS\bin
tiarmclang: warning: H:/ccs_workspace/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec: 'linker' input unused [-Wunused-command-line-argument]
tiarmclang: warning: argument unused during compilation: '-c' [-Wunused-command-line-argument]
tiarmclang: warning: argument unused during compilation: '-P' [-Wunused-command-line-argument]
tiarmclang: warning: argument unused during compilation: '-dD' [-Wunused-command-line-argument]

2) where does the variable "${INPUTS}" comes from? Couldn't find it in Build variables.

--

I am on CCS 12.2 with ti-cgt-armllvm_2.1.2.LTS

--

Thanks in advance

  • Hello,

    Now, the command can be at least executed, but doesn't give the desired results.

    yes, I tried this out with the same result. This functionality is something that we never really tested in the CCS environment and our compiler, just something we inherited from being based off Eclipse. I'm not sure the level of support we have for this. I will need to follow up with engineering

    2) where does the variable "${INPUTS}" comes from? Couldn't find it in Build variables.

    It is some internal build macro used my the CDT project system. That is basically the extent of my knowledge. There seems to be a bit more information in:

    https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.cdt.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_cdt_managedbuilder_core_buildDefinitions.html

    ki

  • Found a good workaround.

    tl;dr:

    1) ${COMMAND} was not populated. Replaced it with ${CG_TOOL_CLANG}

    2) The spec file seems to be wrong. This file seems to need an extension, spec.c or spec.cpp. Replaced ${INPUTS} with the path to a spec file with cpp extension.

    My Command now looks like this:

    This gives me exactly what I needed: Compiler specifications, Built-In Include directories and Defines, like this:

    "C:\\ti\\ccs1220\\ccs\\tools\\compiler\\ti-cgt-armllvm_2.1.2.LTS\\bin\\tiarmclang.exe" -c -E -P -v -dD C:/workspace/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.cpp 
    TI Arm Clang Compiler 2.1.2.LTS
    Target: arm-ti-none-eabi
    Thread model: posix
    InstalledDir: C:\ti\ccs1220\ccs\tools\compiler\ti-cgt-armllvm_2.1.2.LTS\bin
     (in-process)
     "C:\\ti\\ccs1220\\ccs\\tools\\compiler\\ti-cgt-armllvm_2.1.2.LTS\\bin\\tiarmclang.exe" -cc1 -triple thumbv7em-ti-none-eabihf -E -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name spec.cpp -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -nostdsysteminc -fno-zero-initialized-in-bss -fdef-uninit-in-bss -fcommon -ffunction-sections -fdata-sections -fno-delete-null-pointer-checks -fwchar-type=int -fshort-enums -target-cpu cortex-m4 -target-feature -vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature +vfp3d16sp -target-feature -vfp3sp -target-feature +fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature +vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature -fp64 -target-feature -d32 -target-feature -neon -target-feature -sha2 -target-feature -aes -target-feature -fp16fml -target-abi aapcs -fvisibility hidden -mfloat-abi hard -fallow-half-arguments-and-returns -debugger-tuning=gdb -v -P "-fcoverage-compilation-dir=C:\\workspace\\tirtos7_ticlang2" -resource-dir "C:\\ti\\ccs1220\\ccs\\tools\\compiler\\ti-cgt-armllvm_2.1.2.LTS\\lib\\clang\\14.0.6" -internal-isystem "C:\\ti\\ccs1220\\ccs\\tools\\compiler\\ti-cgt-armllvm_2.1.2.LTS\\include\\armv7em-ti-none-eabihf\\c++\\v1" -internal-isystem "C:\\ti\\ccs1220\\ccs\\tools\\compiler\\ti-cgt-armllvm_2.1.2.LTS\\include\\c++\\v1" -internal-isystem "C:\\ti\\ccs1220\\ccs\\tools\\compiler\\ti-cgt-armllvm_2.1.2.LTS\\lib\\clang\\14.0.6\\include" -internal-isystem "C:\\ti\\ccs1220\\ccs\\tools\\compiler\\ti-cgt-armllvm_2.1.2.LTS\\include\\c" -fdeprecated-macro "-fdebug-compilation-dir=C:\\workspace\\tirtos7_ticlang2" -ferror-limit 19 -fno-rtti -fno-signed-char -fgnuc-version=4.2.1 -dD -faddrsig -o - -x c++ C:/workspace/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.cpp
    clang -cc1 version 14.0.6 based upon LLVM 14.0.6 default target arm-ti-none-eabi
    ignoring duplicate directory "C:\ti\ccs1220\ccs\tools\compiler\ti-cgt-armllvm_2.1.2.LTS\lib\clang\14.0.6\include"
    #include "..." search starts here:
    #include <...> search starts here:
     C:\ti\ccs1220\ccs\tools\compiler\ti-cgt-armllvm_2.1.2.LTS\include\armv7em-ti-none-eabihf\c++\v1
     C:\ti\ccs1220\ccs\tools\compiler\ti-cgt-armllvm_2.1.2.LTS\include\c++\v1
     C:\ti\ccs1220\ccs\tools\compiler\ti-cgt-armllvm_2.1.2.LTS\lib\clang\14.0.6\include
     C:\ti\ccs1220\ccs\tools\compiler\ti-cgt-armllvm_2.1.2.LTS\include\c
    End of search list.
    #define __llvm__ 1
    #define __clang__ 1
    #define __clang_major__ 14
    #define __clang_minor__ 0
    [...]
    #define __STDC_UTF_16__ 1
    #define __STDC_UTF_32__ 1

    ----

    In case you want to follow up with engineering:

    I did a cross check with Eclipse IDE for Embedded C/C++ Developers from https://eclipse-embed-cdt.github.io/.

    There is a slight difference in the spec-file for the compiler.

    The variable ${INPUTS} should point to an empty spec file. This file is located at:

    C:/YOUR_CCS_WORKSAPCE_DIR/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core

    CCS Eclipse Embedded CD

    .metadata\.plugins\org.eclipse.cdt.managedbuilder.core>tree
    .
    `-- spec

    .metadata\.plugins\org.eclipse.cdt.managedbuilder.core>tree
    .
    |-- spec
    |-- spec.c
    `-- spec.cpp

    fixed it with:

    touch spec.c

    touch spec.cpp

    Results in the following command:

    "${CG_TOOL_CLANG}" -c ${FLAGS} -E -P -v -dD "${WORKSPACE_LOC}/.metadata/.plugins/org.eclipse.cdt.managedbuilder.core/spec.cpp"