How to static link on OS X
Solution 1:
In order to link to an archive library (sometimes also called static library), just add it to the link line:
gcc main.o ... -lfoo ...
The linker will search for libfoo.dylib, and then libfoo.a, which is all you need.
If you have both versions of the library, and want to link with an archive version in preference of the dynamic one, just specify the full path to the archive on the link line:
gcc main.o ... /path/to/libfoo.a ...
Solution 2:
Regretfully, it's not supported. Some people reported it's possible to manually compile crt0 but nobody confirms it.