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.

Compiler/DRA745: M4 executable contains libraries compiled with old compiler version - are they compatible?

Part Number: DRA745


Tool/software: TI C/C++ Compiler

Hi,

We are migrating to the 16.9.2 version for the CG Tools compiler for the M4 software development but I noticed that some of the libraries that we are linking into are compiled with older compiler versions like 4.6.3 and 5.0.3.

$ armofd file.lib | grep Version
Format: ELF Version 1
Linker Version: 4.6.3
Format Version: 'A'
Tag_Producer_VMajor 5 (Producer Major Version + 1)
Tag_Producer_VMinor 7 (Producer Minor Version + 1)
Tag_Producer_VPatch 4 (Producer Patch Version + 1)


$ armofd file.xem4 | grep Version
Format: ELF Version 1
Linker Version: 16.9.2
Format Version: 'A'
Tag_Producer_VMajor 17 (Producer Major Version + 1)
Tag_Producer_VMinor 10 (Producer Minor Version + 1)
Tag_Producer_VPatch 3 (Producer Patch Version + 1)

Although, there is no issue with compile or linking or even runtime execution, I want to check if this mismatch is fine.

Are there are recommendations from the compiler team to handle this scenario?

Regards

Karthik

  • In general, it should be fine to use an older library. For the most part, if there is a potential problem, the linker will emit a warning.

    It's possible to get into trouble if you use an older linker with a newer library; please avoid this if possible.

    However, when linking against the RTS library, you must make sure that you use the version that matches the linker version.
  • Thanks, that clarifies.

    Could you please provide more information about this point?
    > However, when linking against the RTS library, you must make sure that you use the version that matches the linker version.

    Regards
    Karthik
  • The linker and the RTS library share some special/undocumented symbols to implement certain features. If a new feature gets introduced in the linker, it expects the special symbol to exist in the RTS library, and vice versa. If you don't use exactly the same RTS library version as the linker version, you run the risk of a mismatch. Most of the time, a mismatch won't cause any problems, but once in great while, it could. For this reason, TI only supports the case where you use exactly the same RTS library version as linker version. This is not a burden, because you get both of them in the same package.

    On the other hand, for any other library, there are no special/undocumented symbols, so this is not a requirement for any other library.
  • Thanks for the details.

    I understand your point. For the current scenario, since the linker and the RTS libraries are going to come from the same compiler package (TI CGT ARM 16.9.2) this should not be an issue.

    I have noted the other points that you mentioned.

    Regards

    Karthik