Dependencies should be linked in order before their dependencies

This fixes linux builds where the linker strips out unused symbols before they're needed in case they're in the wrong order.