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/MSP432E401Y:支持 ARM-CGT-CLANG?

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

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/955065/ccs-msp432e401y-support-for-arm-cgt-clang

器件型号:MSP432E401Y

工具/软件:Code Composer Studio

看到 ti-cgt-armllvm_1.1.0-STS 可用、能够下载 Linux 安装 程序、并且在 CCS 10.1.1.00004之外安装之后、能够让 CCS 识别编译器。

使用 CCS 可以为 MSP432E401Y 创建空示例工程、但在编译时收到错误消息:







1年为项目 MSP432E401Y_TI_CLAG_hello 构建配置调试****/home/mr_halfword/ti/ccs1011/ccs/utils/bin/gmake /home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include /home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include/CMSIS -k -j 12所有-O 构建文件:"../main.c"调用:ARM 编译器"/home/mr_halfword/ti/ccs1011/ccs/tools/compiler/ti-cgt-armllvm_1.1.0-STS/bin/tiarmclang /home/mr_halfword/workspace_v10/MSP432E401Y_TI_clag_hello -c -mcpu=cortex-M4 -mfloat-abi=hard -mcpu=fpv4-sp-D16 -mwarn16 -mc"-mctrad_-msp4t_-mc"-mctrad_-msp_-msp4t_-msp_g3e.com -msp_main.pru_-mc"-msp_-msp4t_-msp_-msp_-msp4t_-mc"-msp_-msp4t_-mc"-msp_-msp__-msp4t_-mf_-mc"-mf_-mf_-mf_-msp4t_-msp_-msp_-m64____/home/mr_halfword/ti/ccs1011/ccs/tools/compiler/ti-cgt-armllvm_1.1.0-STS/include
ARM 编译
器"/home/mr_halfword/ti/ccs1011/ccs/tools/compiler/ti-cgt-armllvm_1.1.0-STS/bin/tiarmclang -c -mcpu=cortex-mfloat-abi=hard -mfpu=fpv4-sp-D16 -mslitte-endian -mthum-og -i"/home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include /home/mr_halfword/ti/ccs1011/ccs/tools/compiler/ti-cgt-armllvm_1.1.0-STS/include -i"-i"/home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include/CMSIS -i"-i"/home/mr_halfword/workspace_v10/MSP432E401Y_TI_clag_hello -i"-i"-msp432E40mf_-dsp_startup "mccs_m321y1e.t_msp4b.1y1y"-msp_msp401y"-msp_msp401y"-msp4msp4t_em_em_emb"。



ARM 编译

器1年"/home/mr_halfword/ti/ccs1011/ccs/tools/compiler/ti-cgt-armllvm_1.1.0-STS/bin/tiarmclang -c -mcpu=cortex-M4 -mfloat-abi=hard -mfpp=fpv4-sp-D16 -mslittle-endian -mthum-og -i"/home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include /home/mr_halfword/ti/ccs1011/ccs/tools/compiler/ti-cgt-armllvm_1.1.0-STS/include



/home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include/CMSIS/core_cm4.h -i"-i"/home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include/CMSIS /home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include/msp.h -i"/home/mr_halfword/workspace_v10/MSP432E401Y_TI_clag_hello -i"-i"e-msp432euse"-msp4mc_msp4mctradore.1y 文件中包含在/home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include/msp432e401y.h 文件中。
在/home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include/CMSIS/cmsis_compiler.h 中包含的文件中:48:
/home/mr_halfword/ti/ccs1011/ccs/ccs_base/arm/include/CMSIS/cmsis_gcc.h:657:54:error:unknown register name 'vfpcc' in asm
__asm volatile ("VMSR fpscr、%0":"r"(fpscr):"vfpcc"、"memory");

生成^ 1错误。
gmake:***[system_msp432e401y1.o]错误1
gmake:目标'all'不会由于错误而重做。

****构建完成**** 

 CCS 10中是否支持新的 ARM-CGT-CLANG 编译器?

以上示例中的错误位于 cmsis_gcc.h 中的以下内联函数中:

/**
\brief Set FPSCR
\details 将给定的值分配给浮点状态/控制寄存器。
\param [in] fpscr 浮点状态/控制值、用于设置
*/
__attribute__((always_inline)__static_inline void __set_FPSCR (uint32_t fpscr)
{
#if (定义的(__FPU_Present)&&(__FPU_Present == 1U)&&)
(已定义(__FPU_USed)&&(__FPU_USEDE== 1U)))
_asm volatile ("VMSR fpscr,%0":"r"(fpscr):"vfpcc","内存");
#else
(void)fpscr;
#endif
} 

 根据问题 411803002:修复了使用 clang 构建 ARM/Linux 的问题。 (已关闭)、需要使用 __clang__来选择内在函数而不是__asm 语句来进行不同的条件编译、以便与 基于 LLVM 的编译器配合使用。

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

    允许 使用 ti-cgt-armllvm_1.1.0-STS 编译_set_FPSCR 函数的以下更改、但我尚未测试修改后的函数仍然有效:

    /**
    \brief Set FPSCR
    \details 将给定的值分配给浮点状态/控制寄存器。
    \param [in] fpscr 浮点状态/控制值、用于设置
    */
    __attribute__((always_inline)__static_inline void __set_FPSCR (uint32_t fpscr)
    {
    #if (定义的(__FPU_Present)&&(__FPU_Present == 1U)&&)
    (已定义(__FPU_USed)&&(__FPU_USEDE== 1U)))
    #ifdef __clang__
    __builtin_arm_set_fpscr (fpscr);
    #else
    __asm volatile ("VMSR fpscr,%0":"r"(fpscr):"vfpcc","memory";
    #endif
    #else
    (vo)fpscr;
    #endif
    }
    

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

    CCS_INSTALL_ROOT/CCS/CCS_BASE/ARM/Include 中的文件与编译器分开发布。  虽然我不确定、但我怀疑它们尚未与 TI ARM clang 编译器集成并经过测试。  我将确认这一点、并返回给您。

    谢谢、此致、

    乔治

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

    切斯特、您好!

    [引用 user="Chester Gillon"] CCS 10中是否支持新的 ARM-CGT-CLANG 编译器?[/quot]

    根据您所描述的内容、CCS 似乎支持 clang 编译器。

      ccs_install_root/Ccs/Ccs_base/arm/include 中的文件与编译器分开发布。  虽然我不确定、但我怀疑它们尚未与 TI ARM clang 编译器集成并经过测试。  我将确认这一点、然后返回给您。

    乔治就在这里。 遗憾的是 、MSP432E4 SDK 目前不支持 TIARMCLANG。 作为替代方案、您也许可以使用似乎支持 Clang 扩展的 GCC 编译器。  ARM 优化 C/C++编译器 v20.2.0.LTS 用户指南中介绍了这些扩展

    CLANG 语言扩展

    此致、

    James