reorder the link sequence because the shared lib mush be written after file