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.

unresolved symbols remain (FS$$DIV, C2000 --fp_mode=relaxed) when linking library built without --fp_mode

Hi,

I am building a project via makefile. It links a custom library. This library contains a reference to floating point div (FS$$DIV).

This worked fine, but now I added the option --fp_mode=relaxed (only to the main project, not to the library build routine), together with tmu_support.

Now I am getting a link error "unresolved symbols remain" regarding FS$$DIV.

I am also including

rts2800_fpu32_fast_supplement.lib
rts2800_fpu32.lib

I thought the --fp_mode=relaxed is a compiler option, so the linker should link FS$$DIV from rts2800_fpu32.lib if necessary!?

cgtools version is 6.4.2.

Any help is appreciated.

Regards,

Stephan

  • So here are my option combinations:
    library always compiled with
    --float_support=fpu32

    Application options:
    --tmu_support=tmu0 --float_support=fpu32 --> works
    --float_support=fpu32 --fp_mode=relaxed --> works
    --tmu_support=tmu0 --float_support=fpu32 --fp_mode=relaxed --> does not work, unresolved symbols remain (FS$$DIV in custom library)
  • When building both the library and the application with the same options
    --float_support=fpu32 --fp_mode=relaxed --tmu_support=tmu0,
    it works.
  • Yes, FS$$DIV is defined in rts2800_fpu32.lib, and it should have been found. I'm not familiar with rts2800_fpu32_fast_supplement.lib, but I presume its intent is to replace a subset of functions from the standard library. In that case, you should use the linker options --priority and --reread_libs to make sure that the linker prioritizes the symbols from rts2800_fpu32_fast_supplement.lib, and is able to resolve references between the libraries. If that doesn't help, please show me the complete text of the error message, particularly, the "first referenced in file" part. It might also be helpful to see the linker map file, generated with the --map_file linker option.
  • Ah, I did not think of --priority and --reread_libs. I tried both and either option works - no unresolved symbols left.
    The map file shows that FS$$DIV is correctly taken from rts2800_fpu32_fast_supplement.lib, again for either or both options.
    So this is solved.
    Thanks for the help!
  • For your use case, you really should use --priority, whether or not you use --reread_libs. It may only be by coincidence that you are getting the version of FS$$DIV from the first library.