http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55105
Bug #: 55105 Summary: use of LD_LIBRARY_PATH incorrect for AIX -- cause trunk build to fail Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: pedz...@gmail.com configure.ac has this: # Decide which environment variable is used to find dynamic libraries. case "${host}" in *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;; *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;; *) RPATH_ENVVAR=LD_LIBRARY_PATH ;; esac Starting with AIX 6.1, LD_LIBRARY_PATH is used. I don't 100% understand the intent of the code above. The environment variable mentioned (e.g. LD_LIBRARY_PATH) is passed via the environment when (e.g.) libatomic is built. With LD_LIBRARY_PATH in the environment, xgcc and cc1 no longer execute properly because at the time they execute, LD_LIBRARY_PATH points to the bit version being built -- not the bit version that xgcc was built for. There is a longer description here: http://gcc.gnu.org/ml/gcc/2012-10/msg00386.html I changed it to this: # Decide which environment variable is used to find dynamic libraries. case "${host}" in *-*-aix*) RPATH_ENVVAR=BOGUS ;; *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; *-*-darwin*) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;; *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;; *) RPATH_ENVVAR=LD_LIBRARY_PATH ;; esac In theory, it should be "LIBPATH" but I'm sure that will cause the build to fail as well. In essence, the logic needs to be reviewed. Perhaps other platforms are different in their use of LD_LIBRARY_PATH / LIBPATH than AIX.