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.
Dear C Compiler champs,
We're planning to upgrade to a newer version of the TI compiler to pick up a particular bug fix. This is for the C6000. As part of this, we're asking a third party library vendor to also recompile using the new version of the compiler. We ran into an issue related to 40-bit long type.
The COFF ABI format assumes the “long” C type is 40 bits. ELF ABI assumes it is 32 bits. The last time we sent you an ELF library, it was generated from COFF assembly code which presumably used a 40 bit “long” type. Our functions do not pass the “long” type, so it was okay to assemble the COFF assembly code into ELF objects. The –long_precision_bits compiler option in the newer tools allows you to set the “long” type to 32 or 40 bit where 32 bit is assumed for ELF libraries. If I chose the 40 bit type, then it is not compatible with the ELF run time libraries and the link fails.
Are there any suggestions here?
While your code is still built with COFF ABI, change all instances of "long" or "unsigned long" to one of the types defined in stdint.h. Use this wiki article as a guide for which stdint.h type to use. It varies depending on the situation. Then, while still building with COFF ABI, make sure all tests still pass. Now, with regard to 32 and 40 bit operations, your code works exactly the same whether it is built with COFF ABI or EABI.
Thanks and regards,
-George