My application uses the SafeTI safety library for a safety critical application, but the SafeTI library was NOT migrated to the new ARM Clang (1.3.0LTS) so i am currently migrating it manually.
according to tiarmclang documentation , the program tiarmasm is used for legacy asm files (which the SafeTI lib is full of). Migrating the assembly source code is NOT an option. so the logical option is to use the legacy assembler for the legacy assembly files.
the tiarmclang can invoke the tiarmasm using the -Xti-asm command line option according to page in this document.
the compilation line is for tiarmclang is shown below:
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>
i used the -v to see the verbose invocation of tiarmclang to tiarmasm (shown below):
"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"
the file sl_asm_api.asm has a .cdecls asssembly directive which is used to include "sl_config.h"
the following error is produced by the tiarmasm :
[E0900] The .cdecls directive is not supported for this target .cdecls C, LIST, "sl_config.h"
which causes all the file to generate more errors relating to not found symbols (which are found in the sl_config.h)
the target used is TMS570LS1114 Hercules series arm-based microcontroller, and its a cortex r4 so the target specified to the tiarmclang is -mcpu=cortex-r4, and after invoking tiarmasm -mv7R4
i tried also to use the --include_path=<path> command to provide the sl_config.h but the following warning is produced:
tiarmclang: warning: argument unused during compilation: '--include_path=../include/sl_config.h' [-Wunused-command-line-argument]
- merging assembly with C is discussed in the Runtime environment chapter of the aforementioned document. and it says that tiarmclang finds the relvant Runtime environment automatically from the installation directory
however , i also passed the runtime library directory (and relative files) in an explicit way to the linker according to the documentation, but i don't think the linking phase is ever reached because there are still compiler errors (which my error is all about)
so my question is:
1- what am i doing wrong ?
2- is there a workaround to using a C header file into an assembly file ? can anything be done differently to have achieve the same result?