A few comments:
- You say the macro is defined as
old_interrupt_posture = tx_interrupt_control(TX_INT_DISABLE);
and that
tx_thread_interrupt_control is converted to _tx_thread_interrupt_control
but you say the error is
undefined reference to `tx_thread_interrupt_control'
So there is something inconsistent in your description.
- An undefined reference error is from the linker. So, you are not adding the library that resolves the reference to tx_thread_interrupt_control
Don't get confused between #include (which is a compiler operation) with undefined references which is a linker error
- The evaluation of commands on a link compile command is very important.
When the compiler sees .o files, they get added to the target binary automatically, so all .o files are present. That leaves a list of undefined entities which need to be found.
The next stage is to look through the libraries. Each library is searched, and the .o elements of each library which fulfills an undefined reference is added to the target binary. That always resolves some issues. However, it may also have further requirements. So adding part of a library may add to the required elements to be satisfied.
When a library requires another library, it needs to be specified after something which required it, and before the libraries which satisfy its requirements.
There is a chance if the .o files also require the same parts of a library, this issue can crop up when code is deleted from a .o (removing the mechanism which pulls in the library part).
- If this doesn't help, we are going to need to reproduce the problem here to be able to resolve it.