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.

--program_level_compile apparent failure and linker errors

Version: 4.1.2.00027 

Hi,

I am trying to use the program level compilation option so that I can get the benefits of program level optimisation. Without --program_level_compile defined my project builds successfully.

With --program_level_compile defined raises a couple of questions:

1. I was expecting to see a single .asm file as described in section 3.3 of the TI ARM Optimizing C/C++ Compiler v4.6 User Guide (SPNU151E). However, I still have an .asm file for each .C file. So I am not convinced that the --program_level_compile has been recognised. I note that this same section states 'However, if any file has a file-specific option that is not selected as a project-wide option, that file is compiled separately', but as far as I am aware I do not have file-specific options.

2. Where I have a successful build without --program_level_compile, with --program_level_compile I get linker errors relating to the redefinition of some debug symbols, for example '#10056: symbol "__TI_DW.debug_info.f91965596ebba1def9b5918b8714db57" redefined: first defined in "./DriverSoftware/MicrocontrollerDrivers/Nmi.obj"; redefined in "./DriverSoftware/MicrocontrollerDrivers/Esm.obj" MvMotorControlTMS570 line 0 1294923529751 35610'. These are not my symbols so I have no idea what they are. I do not have any duplicate redefined symbols in these files, though I have to say that the code is identical so maybe a confusion has occurred during merge. This problem is resolved by suppressing all symbolic debug generation (--symdebug:none).

FYI I have the following pertinent compiler options selected:

 

--keep_asm -g, -O3, --opt_for_speed=5, --gen_opt_info=2, --preproc_with_compile, --program_level_compile

Any help would be appreciated, regards, Tony.

 

  • Tony,

    I havent been able to recreate the issue with --program_level_compile that you describe. Are you building using CCS? If so, could you check that all the .asm files were regenerated with the build using --program_level_compile? Because the .asm files in the \Debug folder are not removed as part of the build or rebuild, so files generated from a previous build could remain there. To be sure, please delete all .asm files and rebuild with --program_level_compile and let us know if the issue persists.

    Tony Morrell said:
    Where I have a successful build without --program_level_compile, with --program_level_compile I get linker errors relating to the redefinition of some debug symbols, for example '#10056: symbol "__TI_DW.debug_info.f91965596ebba1def9b5918b8714db57" redefined: first defined in "./DriverSoftware/MicrocontrollerDrivers/Nmi.obj"; redefined in "./DriverSoftware/MicrocontrollerDrivers/Esm.obj" MvMotorControlTMS570 line 0 1294923529751 35610'

    I haven't seen this specific error before. Can you send us a simple test case that reproduces this? Which version of the code generation tools are you using?

  • Hi Aarti,

    I've verified that the .asm files are all generated on build.

    I haven't been able to construct a simple test case yet but will send one when I have. In the meantime please find attached a copy of the relevant files FYI.

    Tool versions are:

    Code Composer Studio  Version: 4.1.2.00027 

    TMS470 Code Generation Tools 4.7.0B2

    Regards, Tony.

    1050.ProgramLevelCompile.txt

     

     

  • Tony,

    I looked at this some more and from your build log I see that the --program_level_compile is within a Compiler.opt options file. That is the cause of the problem as this option is not being passed correctly by CCS when it is within a options file. If you enable the option directly from within CCS Build Properties->Compiler->Language Options, then it should work properly.

    You can compare the build outputs in both cases and see how the source files are passed differently in the 2 cases. When the --program_level_compile is passed correctly (enabled through GUI), there is only 1 compile step and all the source files are passed together to the compiler shell. When it is passed via the options file, the build command looks like it does without that option with each source file being built separately.

    Can you please test this with your project and confirm that it works when the option is enabled from within CCS? I will check with the CCS team if there is a way to parse option files to recognize this properly, but it may not be possible.

    I'm still not sure about the symbol redefinitions but let us know if that error remains after making this change.

  • Hi Aarti,

    I enabled --program_level_compile as you suggested in CCS Build Properties->Compiler->Language Options and deleted the old build output directory 'Release'.

    I find that the build now does not run. I see the build progress window briefly pop up and see that it reports that it is building one of my code sub-tree makefiles. This is all that happens. There is no output written to the Console pane. I have three files generated; the top level directory sources.mk, my library directory subdir.mk and single source sub-tree subdir.mk (which is in fact empty).

    Disabling --program_level_compile allows a normal successful build.

    What is going on! I'm confused.

    Regards, Tony.

  • Tony,

    Is the behavior specific to this project? Do you have other projects you can enable --program_level_compile on (with same version of Code gen tools and CCS) and see if it works?

    Not sure how large your project is, but if it is not too much trouble, could you try compiling the files on a command line? This could help isolate if the issue is with the --program_level_compile option in the compiler or if it within CCS. Something like the following should do it:
    cl470 -o3 --program_level_compiler <other options> file1.c file2.c file3.c ...

    It may be difficult to dig into this further without a reproducible test case. Are you able to share your project? You can send it to me via private message if you do not wish to share it here on the forum.

     

  • Hi Aarti,

    I'm using compiler version 4.7.0B2 and have discovered in forum post http://e2e.ti.com/support/development_tools/compiler/f/343/p/88758/308090.aspx#308090 that link time optimisation is available (--opt_level=4, it wasn't present in V4.6 compiler) .

    This appears to be an altogether better option over program level compile, so I'm not going to waste any more time for either of us on this post.

    Thanks for your help to date, regards, Tony.