http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50562
Bug #: 50562 Summary: configure: --without-newlib does not disable libgloss Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other AssignedTo: unassig...@gcc.gnu.org ReportedBy: jsten...@cisco.com While running the top level configure from latest trunk to build a Solaris cross compiler on a Linux host, if I pass in --without-newlib, libgloss is not disabled. This causes the Solaris cross build to fail since libgloss won't build for Solaris crosses on Linux hosts. configure already provides the --without-newlib flag, and we would like to use this to cleanly disable both libgloss and newlib, but we currently cannot since only newlib is disabled with this flag, not libgloss. The reason libgloss is not disabled is that this code in configure: # Recognize --with-newlib/--without-newlib. case ${with_newlib} in no) skipdirs="${skipdirs} target-newlib" ;; Does not disable libgloss. Later on in configure, if noconfigdirs includes newlib, libgloss is disabled. So this appears to be an inconsistency between the way noconfigdirs and skipdirs are treated. Thus, when calling configure as follows: ../gcc/configure --build=x86_64-linux --target=sparc-sun-solaris2.10 --host=x86_64-linux --enable-languages=c,c++ --enable-targets=sparc-\ sun-solaris2.10,sparcv9-sun-solaris2.10 --with-gnu-ld --with-gnu-as --enable-multilib --enable-threads=solaris --disable-nls --without-newlib <Other args snipped> I still see libgloss being built during the subsequent make: libgloss/libnosys/fstat.c:6:19: fatal error: _ansi.h: No such file or directory I propose the following diff to fix this issue so that --without-newlib also disables libgloss. Index: configure.ac =================================================================== --- configure.ac (revision 179288) +++ configure.ac (working copy) @@ -276,7 +276,7 @@ # Recognize --with-newlib/--without-newlib. case ${with_newlib} in - no) skipdirs="${skipdirs} target-newlib" ;; + no) skipdirs="${skipdirs} target-newlib target-libgloss" ;; yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; esac Index: configure =================================================================== --- configure (revision 179288) +++ configure (working copy) @@ -2823,7 +2823,7 @@ # Recognize --with-newlib/--without-newlib. case ${with_newlib} in - no) skipdirs="${skipdirs} target-newlib" ;; + no) skipdirs="${skipdirs} target-newlib target-libgloss" ;; yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; esac