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.

4.9.2 lnk470.exe --opt_level=4 Parameter Problem

When I am passing --opt_level=4 to the linker I get the following warning, then the link fails.

WARNING: more than one source file is specified; option --output_file is ignored
[_level=4.]
Fatal error: could not open source file "_level=4"
1 fatal error detected in the compilation of "_level=4".
Compilation terminated.

To me it looks like this is getting recognized as another parameter by the linker as well.  The output file option is being used.  Is there something obvious I am doing wrong.  Let me know if you need more information.

TMS570 Codegen Tools 4.9.2

  • The linker does not accept the --opt_level option. To use link time optimization the --opt_level=4 option should be passed to the shell. You should not invoke lnk470 directly. The linker invocation should be:

    cl470 --opt_level=4 --run_linker <linker options>

    The options after the --run_linker option are passed directly to the linker. The --opt_level=4 option must be before the --run_linker option.

  • Okay, FYI, lnk470.exe does do something with this, when I passed it, I did start to get errors related to type checking for the link level optimization, and it was after fixing them that I got to the failure I mentioned here, so the parameter checking isn't very good on lnk470.