https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35014
--- Comment #10 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- The manual says: > On systems that provide libgfortran as a shared and a static library, > this option forces the use of the static version. If no shared version > of libgfortran was built when the compiler was configured, this option > has no effect. On MacOSX if I compile a simple test, I get a.out: /opt/gcc/gcc11w/lib/libgfortran.5.dylib (compatibility version 6.0.0, current version 6.0.0) /opt/gcc/gcc11w/lib/libgcc_s.2.dylib (compatibility version 2.0.0, current version 2.0.0) /opt/gcc/gcc11w/lib/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0) with -static-libgfortran a.out: /opt/gcc/gcc11w/lib/libgcc_s.2.dylib (compatibility version 2.0.0, current version 2.0.0) /opt/gcc/gcc11w/lib/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0) and with -static-libgfortran -static-libgcc a.out: /opt/gcc/gcc11w/lib/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0) So AFAICT on an OS for which -fpic is the default everything seems to work.