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.
Greetings,
If a project, which is a build dependency for another project, does not specify a memory range for a given section, the linker generates a warning. But when the final link occurs, will the main project’s range for that section be used?
Thank you,
Ed
I need to know more about the relationship between the dependent project and the main project. Typically, a dependent project builds a library of object files. No link occurs. The main project calls functions (sometimes uses data, but that's less common) in the library from the dependent project.
That's not how it works in your case. How does it work? And why?
Thanks and regards,
-George
This is for a series of projects which were built using a much older compiler which was, in essence, run on a command line. They consist of a variety of objects which can be accessed by the main project via function calls as you suspected. The linker is automatically invoked, as it is with our newer projects which also have no linker command file in the dependent projects. The output is an abs file and there will be a warning for every unspecified output section. I found a check box, which if unchecked, suppresses the warning.
The main project builds its files, and then links them with the abs files from the dependent projects using its cmd file.
But all of this begs the question of what happens to those unspecified output sections in the dependent projects. It seems that they end up being mapped to the appropriate section in the main project’s cmd file.
Is this correct?
Thank you,
Ed
The output is an abs file
I'm not sure what you mean by the term abs file. Please show me the command used to create it. Please copy and paste the text, and do not use a screen shot.
Thanks and regards,
-George
Sorry George. The abs file is specified in a dialog box under C2000 Linker->Basic Options->Specify output file name (--output_fie, -o).
I changed the default output type to abs which matches the output file type of the older linker and our more recent projects. Should I use something else?
Ed
For the dependent project, please rebuild the entire project. One way to do that is to right-click on the name of the project and select Rebuild Project. Then save the contents of the Console (not Problems) view to a text file. Use the icon named Copy Build Log. When you name the log file, be sure to use the file extension .txt. Please attach that text file to your next post.
Thanks and regards,
-George
To protect our IP, I have changed names, and deleted a lot of the outputs since they were all the same except the names. I also removed the link errors in the main project which will be the subject of a different thread. Also, I can see a way to attach pictures, but not txt files. So I've simply copied them below.
Thank you,
Ed
Dependent File Output
**** Build of configuration Debug for project <DependentProject> ****
"C:\\ti\\ccs1040\\ccs\\utils\\bin\\gmake" -k -j 8 all -O
Building file: "../<file1>.cpp"
Invoking: C2000 Compiler
"C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=softlib --fp_mode=relaxed --fp_reassoc=off --include_path="<DependentProjectPath>/<DependentProjectFolder>" --include_path="C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/include" --advice:performance=all -g --c99 --cpp_default --float_operations_allowed=32 --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=coffabi --rpt_threshold=31 --silicon_errata_fpu1_workaround=off --call_assumptions=0 --remove_hooks_when_inlining -k --asm_listing --asm_cross_reference_listing --gen_cross_reference_listing --gen_preprocessor_listing --preproc_with_compile --preproc_dependency="<file1>.d_raw" "../<file1>.cpp"
Finished building: "../<file1>.cpp"
Building file: "../<file2>.cpp"
Invoking: C2000 Compiler
"C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=softlib --fp_mode=relaxed --fp_reassoc=off --include_path="<DependentProjectPath>/<DependentProjectFolder>" --include_path="C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/include" --advice:performance=all -g --c99 --cpp_default --float_operations_allowed=32 --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=coffabi --rpt_threshold=31 --silicon_errata_fpu1_workaround=off --call_assumptions=0 --remove_hooks_when_inlining -k --asm_listing --asm_cross_reference_listing --gen_cross_reference_listing --gen_preprocessor_listing --preproc_with_compile --preproc_dependency="<file2>.d_raw" "../<file2>.cpp"
Finished building: "../<file2>.cpp"
etc...
Building target: "<DependentProject>.abs"
Invoking: C2000 Linker
"C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=softlib --fp_mode=relaxed --fp_reassoc=off --advice:performance=all -g --c99 --cpp_default --float_operations_allowed=32 --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=coffabi --rpt_threshold=31 --silicon_errata_fpu1_workaround=off --call_assumptions=0 --remove_hooks_when_inlining -k --asm_listing --asm_cross_reference_listing --gen_cross_reference_listing --gen_preprocessor_listing -z -m"<DependentProject>.map" -i"C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/lib" -i"C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/include" --reread_libs --disable_auto_rts --diag_wrap=off --display_error_number --relocatable --xml_link_info="<DependentProject>_linkInfo.xml" --rom_model -o "<DependentProject>.abs" "./<file1>.obj" "./<file2>.obj" etc... "../<DependentProject>.cmd" -llibc.a
<Linking>
Finished building target: "<DependentProject>.abs"
**** Build Finished ****
Main Project Output
**** Build of configuration Debug for project <ProjectName> ****
"C:\\ti\\ccs1040\\ccs\\utils\\bin\\gmake" -k all
Building file: "../<file1>.cpp"
Invoking: C2000 Compiler
"C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/bin/cl2000" -v28 -ml -mt --include_path="C:<ProjectPath>/<ProjectName>" --include_path="C:/ti/ccs1040/ccs/tools/compiler/ti-cgt-c2000_20.2.5.LTS/include" --advice:performance=all -g --c99 --c++03 --relaxed_ansi --cpp_default --float_operations_allowed=32 --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --abi=coffabi --rpt_threshold=31 --call_assumptions=0 -k --asm_listing --asm_cross_reference_listing --gen_cross_reference_listing --gen_preprocessor_listing --preproc_with_compile --preproc_dependency="<file1>.d_raw" "../<file1>.cpp"
Finished building: "../<file1>.cpp"
>> Compilation failure
makefile:203: recipe for target '<ProjectName>.out' failed
gmake: *** [<ProjectName>.out] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
Thank you for the build log. I understand what you mean by an abs file. It is an executable COFF file created by the linker. The typical file extension is .out. You use .abs instead. Otherwise, they are the same.
The build log does not show how the abs file is used as an input in the main project.
I continue to think it would be better if the dependent project built a library instead of an executable COFF file. Then the main project links against that library. This is simpler, and avoids the whole question of how the dependent project links. Should I show you how to do that?
Thanks and regards,
-George
There is no method to change an existing project that creates an executable COFF file into a project that creates a library. You have to start a new project.
Start with the Creating a New CCS Project part of the CCS online documentation. Understand the setting named Output type. You need to choose Static Library. Here's a screen shot ...
After that, it is pretty similar to the project you have now. The source files, compiler options, etc. are the same. Since you don't link, there are no linker settings. The build ends by running a tool, called the archiver, to create the library that contains all the object files. The archiver in the C28x tools is named ar2000. I don't think you need the details of how it works. But if you do, please search the C28x assembly tools manual for the chapter titled Archiver Description.
Next, see the Project Dependencies part of CCS online documentation to learn how to make the dependency connection between the two projects. Note the part about how the library entry is not automatically added to the main project. See this forum thread for the details of that step.
If this all seems daunting, then I suggest you first try it out with two toy projects. One is the main project, and the other is the dependent library project. Have the main project call a function from the library project. Just get it to all build clean. It doesn't have to run. Then scale up from there.
Thanks and regards,
-George
This seems to be working. The new compiler has caught a few things in the old code and which I have resolved. There are two remaining issues which I believe are unrelated to this thread. I appreciate your help George.
Ed