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.

Only one object file after compiling

Other Parts Discussed in Thread: TMS320F28335

Hello,

I'm using the compiler revision 5.2.1 on a TMS320F28335.

When I build my source files (both .c and .asm) only the following object files (.obj) are generated at the end of the process:

file1.obj, file21.obj, file22.obj, file23.obj, file24.obj, file25.obj, file26.obj, file27.obj, file28.obj, file29.obj and file30.obj.

Also, only file1.asm, file29.asm and file30.asm are generated.

Now, I don't understand why file2.obj to file20.obj are not generated and file1.asm seems to actually include the whole code!

I know I must be missing something but I could not find any useful information on the compiler user manual.

Any help would be appreciated.

The command file is attached for you to read.

Thanks.

Paolo

cc_options.zip
  • You are using the option -pm ("program mode").  This option combines all of the input source files before compiling, and generates one object file.  I don't know why you are getting more than one object file.  Perhaps you did not perform a "clean" before building with -pm.  Also, the -pm option only works with the files specified on the command line; if you invoke the compiler again for different source files, you'll get more object files.

  • Sure, you're right! I don't know how I could miss it...

    We are actually using "scons" and a quite complex set of build scripts, so the compiler is invoked more than once during the process.

    Another question: does that option break the dependency check? I mean, does the fact that only one object file is generated prevent the compiler from re-parsing just the changed modules?

    Thanks again.

    Paolo

  • Paolo Benini said:
    does the fact that only one object file is generated prevent the compiler from re-parsing just the changed modules?

    Well, the dependencies should be that file1.obj depends upon file1.c, file2.c, file.3.c ... file20.c .  If any one of those C files change, then all of them should get rebuilt.  Whether your build engine actually does that is not something the compiler controls.

    Thanks and regards,

    -George

  • Some advice to consider ... Think about dropping -pm in favor of --opt_level=4.  The -pm option does not work well with how code is typically built.  But --opt_level=4 doesn't have that problem, and it is likely to get you as much optimization, if not more, then -pm could.

    Thanks and regards,

    -George

  • Thanks for the advice. Unfortunately I am afraid this version of the compiler does not support --opt_level=4.

    Regards,

    Paolo