gcc <options> <sources> -o <binary> -Wl,-Bstatic <list of static libs> -Wl,Bdynamic <list of dynamic libs>
Gcc linking and mixed static and dynamic linking
GCC syntax schema to link some libraries statically and others dynamically: