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.

Compiler/TMS570LC4357: Optimisation level 4 on the Compiler causes link to fail

Part Number: TMS570LC4357

Tool/software: TI C/C++ Compiler

In upgrading to use the latest version of the TI compiler our projects failed to compile 

We have recreated the problem using a very simple project and I attach the project directory zipped up.

'Finished building: "../main.c"'


'Building target: "Test1.out"'
'Invoking: ARM Linker'
"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_18.1.0.LTS/bin/armcl" -mv7R5 --code_state=32 --float_support=VFPv3D16 -O4 -g --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi -z -m"Test1.map" --heap_size=0x800 --stack_size=0x800 -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_18.1.0.LTS/lib" -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_18.1.0.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="Test1_linkInfo.xml" --rom_model --be32 -o "Test1.out" "./main.obj" -llibc.a
<Linking>
error: option --silicon_version=7R4 is set in "mpu_init.c", and is incompatible
with the previously seen option --silicon_version=7R5
error: option --silicon_version=7R4 is set in "pre_init.c", and is incompatible
with the previously seen option --silicon_version=7R5
error: option --silicon_version=7R4 is set in "cpy_tbl.c", and is incompatible
with the previously seen option --silicon_version=7R5
error: option --silicon_version=7R4 is set in "copy_zero_init.c", and is
incompatible with the previously seen option --silicon_version=7R5
error: option --silicon_version=7R4 is set in "copy_decompress_none.c", and is
incompatible with the previously seen option --silicon_version=7R5
error: option --silicon_version=7R4 is set in "copy_decompress_lzss.c", and is
incompatible with the previously seen option --silicon_version=7R5
error: option --silicon_version=7R4 is set in "_lock.c", and is incompatible

with the previously seen option --silicon_version=7R5
>> Compilation failure

>> Compilation failure

>> Compilation failure
makefile:140: recipe for target 'Test1.out' failed
fatal error #10192: Failed linktime optimization
gmake[1]: *** [Test1.out] Error 1
gmake: *** [all] Error 2
makefile:136: recipe for target 'all' failed

**** Build Finished ****

However if we lower the optimisation level then it does build fully.


**** Build of configuration Debug for project Test1 ****

"C:\\ti\\ccsv7\\utils\\bin\\gmake" -k -j 8 all -O

'Building file: "../main.c"'
'Invoking: ARM Compiler'
"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_18.1.0.LTS/bin/armcl" -mv7R5 --code_state=32 --float_support=VFPv3D16 -O3 --include_path="C:/Users/jeffrey.smith/workspace_v7/Test1" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-arm_18.1.0.LTS/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi --preproc_with_compile --preproc_dependency="main.d_raw" "../main.c"
'Finished building: "../main.c"'

'Building target: "Test1.out"'
'Invoking: ARM Linker'
"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_18.1.0.LTS/bin/armcl" -mv7R5 --code_state=32 --float_support=VFPv3D16 -O3 -g --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi -z -m"Test1.map" --heap_size=0x800 --stack_size=0x800 -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_18.1.0.LTS/lib" -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_18.1.0.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="Test1_linkInfo.xml" --rom_model --be32 -o "Test1.out" "./main.obj" -llibc.a
<Linking>
warning #10247-D: creating output section ".text" without a SECTIONS specification
'Finished building target: "Test1.out"'

**** Build Finished ****Test1.zip