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.

[参考译文] TMS570LS1114:tiarmclang:此目标不支持.cdecls 指令

Guru**** 2393725 points
Other Parts Discussed in Thread: TMS570LS1114

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1055093/tms570ls1114-tiarmclang-the-cdecls-directive-is-not-supported-for-this-target

器件型号:TMS570LS1114

我的应用将 SafeTI 安全库用于安全关键型应用、但 SafeTI 库未迁移到新的 ARM Clang (1.3.0LTS)、因此我目前正在手动迁移它。

根据 tiarmclang 文档,程序 tiarmasm 用于旧 asm 文件(SafeTI 库中已满)。 迁移汇编源代码不是一个选项。 因此、逻辑选项是将旧汇编器用于汇编文件。

根据  本 文档中的页面、tiarmclang 可以使用-xTI-asm 命令行选项调用 tiarmasm。

编译行用于 tiarmclang、如下所示:

tiarmclang -mcpu=cortex-r4 -marm -mfloat-abi=hard  -mfpu=vfpv3-d16  -mbig-endian  
-x ti-asm -v   -Xti-assembler <DEFINES> --symdebug:dwarf -Xti-assembler --include_path=../include/
-o <outputfilename.obj> -c <sourcefilename.asm> 

我使用-v 来查看 tiarmclang 到 tiarmasm 的详细调用(如下所示):

"C:\\toolchain\\ti_armllvm_1.3.0.LTS\\bin\\tiarmasm" --abi=eabi --object_format=elf
--silicon_version=7R4 --float_support=VFPv3D16 --endian=big --code_state=32
--unaligned_access=on --arm_vmrs_si_workaround=on --embedded_constants=on
--hll_source=asm --symdebug:none --define=<DEFINES> --symdebug:dwarf
--include_path=../include/  "thirdparty\\safety_library\\source\\sl_asm_api.asm" 
"...\thirdparty\\safety_library\\source\\sl_asm_api.asm.obj"

文件 sl_asm_api.asm 具有个.cdecls asssembly 指令、用于包含"sl_config.h"  

以下错误是由 tiarmasm 生成的:

[E0900]

         The .cdecls directive is not supported for this target

	    .cdecls C, LIST, "sl_config.h"

这会导致所有文件生成更多与未找到的符号(在 sl_config.h 中找到)相关的错误

使用的目标是 TMS570LS1114 Hercules 系列基于 ARM 的微控制器、它是一个 cortex R4、因此调用 tiarmasm -mv7R4之后、指定给 tiarmclang 的目标是-mcpu=cortex-R4

我还尝试使用--include_path= 命令提供 sl_config.h、但会生成以下警告:

tiarmclang: warning: argument unused during compilation: '--include_path=../include/sl_config.h' [-Wunused-command-line-argument]

-上述 文档的运行时环境一章讨论了如何将汇编语言与 C 语言合并。 它指出 tiarmclang 会自动从安装目录中查找 relvant Runtime 环境

但是、我还根据文档以显式方式将运行时库目录(和相对文件)传递给链接器、但我认为没有达到链接阶段、因为仍然存在编译器错误(我的错误就是这些错误)

我的问题是:

1 -我做了什么错?

2-在汇编文件中使用 C 头文件是否有权变措施? 是否可以采取不同的方式来实现相同的结果?

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

    遗憾的是、支持.cdecls 指令。  即使您使用旧版汇编器编译器编译也是如此。   

    [引用 userid="504659" URL"~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1055093/tms570ls1114-tiarmclang-the-cdecls-directive-is-not-supported-for-this-target "]是否存在将 C 头文件用于汇编文件的变通办法?[/quot]

    不幸的是、不

    谢谢、此致、

    乔治