9 years, 6 months ago.

Order depenency of linked objects

Hi,

I have a peculiar problem that I hope someone would be able to shed some light on.

I wanted to port the libmongoose web-server library (https://github.com/cesanta/mongoose) to mbed and for that I had to patch the lwip library somewhat, in order to make it compatible with the c runtime library of GCC ARM (out of the box they e.g. use different values for errno defines). Lwip refers to headers in mbed-rtos, so I had to include that library.

I managed to make it work and then my intention was to make everything available in the web-based development environment, so that you simply by exporting the program could build a libmongoose based web-server using GCC ARM.

The exported program builds without problems, but does not work. It turned out that in the exported makefile, the object mbed-rtos/rtx/rt_System.o appears before the object mbed-rtos/rtx/RTX_Conf_CM.o, while I in my manually created Makefile had them (just by chance) the other way around.

Anyway, if RTC_Conf_CM.o is before rt_System.o then everything works, if not, then the program just hangs (don't know where, I don't have the means to find out).

What could the reason for the order dependency be? Is there a way for influencing the order in which objects are listed in the generated exported Makefile?

Thanks, Johan

Be the first to answer this question.