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扫描器发现错误

Guru**** 2539500 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/1220722/ccs-12-2-scanner-discovery-bug

您好*:

扫描器发现不起作用。

在下:

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

-> CDT Cross GCC Built-In Compiler Settings

获取编译器规格的默认命令:

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

1)很遗憾、```${command}```未填充!

我手动将其更改为:

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

而我的命令是从:

现在、该命令至少可以执行、但无法提供所需的结果。

扫描器发现的控制台输出:

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) 2)变量"${inputs}"来自哪里? 在编译变量中找不到它。

--

我使用的是 CCS 12.2、ti-cgt-armllvm_2.1.2.LTS

--

提前感谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    现在,该命令至少可以执行,但不能提供所需的结果。

    是的、我尝试了相同的结果。 此功能是我们从未在 CCS 环境和编译器中真正测试过的功能、只是我们基于 Eclipse 继承的功能。 我不确定我们对此的支持水平。 我需要跟进工程部门

    Unknown 说:
    2)变量"${inputs"来自哪里? 无法在编译变量中找到它。

    CDT 工程系统中使用了某个内部生成宏。 这基本上就是我所知的程度。 中似乎有更多信息:

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

    小标题

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    找到了良好的权变措施。

    TL;dr:

    1)${COMMAND}未填充。 已将其替换为 ${CG_TOOL_CLANG}

    2)规范文件似乎是错误的。 该文件似乎需要扩展名spec.c或 spice.cpp。 将${inputs}替换为扩展名为 CPP 的规范文件的路径。

    我的命令现在如下所示:

    这正是我所需要的:编译器规范、内置的 include 目录和定义、如下所示:

    "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

    ---

    如果您想跟进工程部的情况:

    我在 https://eclipse-embed-cdt.github.io/上对面向嵌入式 C/C++开发人员的 Eclipse IDE 进行了交叉校验

    编译器的 spec 文件略有不同。

    变量${inputs}应该指向一个空的规范文件。 此文件位于:

    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

    使用以下内容修复:

    touch spec.c

    touch spec.cpp

    将生成以下命令:

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