make linking static in many functions