libgfortran references environ which is not available to shared libraries directly on darwin. This means that we can not build fortran shared libraries without undefined symbols.
The solution is to use crt_externs.h and #define environ (*_NSGetEnviron()) in libgfortran/runtime/ environ.c. -- Summary: libgfortran contains undefined references to _environ Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: peter at pogma dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: powerpc-apple-darwin GCC host triplet: powerpc-apple-darwin GCC target triplet: powerpc-apple-darwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17748