[PATCH] fix bug in autoconf-2.13 that keeps cross gcc from buildingoncygwin

Dan Kegel dkegel@ixiacom.com
Tue Aug 27 11:12:00 GMT 2002

I would certainly agree, except that the gcc developers
tried and failed to update to 2.53; it's really involved to
update gcc's autoconf.  

The only project that I think should be using my patch is the
gcc project, and only until they update to autoconf 2.53.
Everyone else should move to autoconf 2.53 asap.

It won't do much good for cygwin to include the patch, since
gcc is maintained on Unix, not on cygwin, and the patch matters
mostly for the system where the gcc source tarball is generated.
- Dan

-----Original Message-----
From: Earnie Boyd

But, development and maintenance of 2.13 is dead for Autoconf proper.
There have been three
or four releases since then.  If the developers who use Cygwin want to
continue to support
2.13 that's a different matter and those developers, someone like Dan
Kegel, can create the
patch there.  However, I see that any developers time would be better
spent in converting the
"buggy configure script" to 2.53 format.


Dan Kegel wrote:

> It'd be good for Cygwin to apply the patch, yes.  Then the gcc FAQ
> have an entry
>     Q. Why can't I build cross-compilers on Cygwin?
>     A. Because the configure scripts shipped with gcc are buggy.
>        Regenerate them all under Cygwin, and it should work.
> But frankly, the point of configure scripts is to be portable, so
> it makes a fair bit of sense for gcc to ship with configure scripts
> that are portable even to systems like cygwin.
> - Dan
> Earnie Boyd wrote:
> > I suggest that this issue be dealt with within the Cygwin
distribution of autoconf-2.13.
> >
> > Earnie.
> >
> > Dan Kegel wrote:
> >
> >
> >>[repost -- mail system problems]
> >>
> >>Building cross gcc's on cygwin fails because autoconf 2.13's
> >>test assumes that it's ok to try to run possibly cross-compiled
> >>and that if they run, the compiler must not be a cross-compiler.
> >>This assumption fails on Cygwin; see
> >>
> >>   http://gcc.gnu.org/ml/gcc-help/2002-05/msg00165.html
> >>   http://sources.redhat.com/ml/crossgcc/2002-08/msg00099.html
> >>The symptom is the build hangs about twenty times waiting for you to
click a dialog box,
> >>and the target directory's ac_cv_prog_cc_cross is improperly set to
> >>
> >>The problem will likely go away when gcc moves to using autoconf
2.5x, but
> >>that may take a while, and won't help people who need to build
> >>gcc's like 3.0.x.  So it's worth fixing autoconf-2.13 if it's a
small, safe fix.
> >>
> >>Fortunately, the fix does look small and safe:
> >>
> >>--- /usr/share/autoconf2.13/acgeneral.m4.orig   Thu Aug 22 18:26:58
> >>+++ acgeneral.m4        Thu Aug 22 19:03:12 2002
> >>@@ -1510,11 +1510,13 @@
> >>   EOF
> >>   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
> >>     [$2]=yes
> >>-  # If we can't run a trivial program, we are probably using a
cross compiler.
> >>-  if (./conftest; exit) 2>/dev/null; then
> >>-    [$3]=no
> >>-  else
> >>-    [$3]=yes
> >>+  if test "$[$3]" != yes; then
> >>+    # If we can't run a trivial program, we are probably using a
cross compiler.
> >>+    if (./conftest; exit) 2>/dev/null; then
> >>+      [$3]=no
> >>+    else
> >>+      [$3]=yes
> >>+    fi
> >>     fi
> >>   else
> >>     echo "configure: failed program was:" >&AC_FD_CC
> >>
> >>i.e. after the patch, AC_TRY_COMPILER checks its 3rd parameter,
> >>and if it's already 'yes', it knows not to run the binaries.
> >>
> >>After applying this patch to autoconf-2.13 and installing,
> >>you then need to regenerate libiberty/configure,
> >>gcc/configure and fastjar/configure.  It might be good if future
> >>of gcc that still used autoconf-2.13 were done on machines with an
> >>autoconf-2.13 with this patch applied.
> >>
> >>This is only a partial fix; it requires the user to override
> >>ac_cv_prog_cc_cross.  A similar bug in ltconfig can be worked around
> >>without a patch by overriding cross_compiling=yes in the same way.
> >>Both overrides should only be done during the build of runtime
> >>Fortunately, gcc's makefile has pseudotargets that let you do this.
> >>For instance:
> >>      make all-gcc
> >>      ac_cv_prog_cc_cross=yes cross_compiling=yes make all-target
> >>      make install
> >>
> >>Users on non-cygwin platforms can ignore this issue, and just do
> >>'make install' as usual.  This patch will neither help nor hurt
> >>
> >>(Note that overriding ac_cv_prog_cc_cross at make time appears to be
> >>Although it would be more logical to override them when doing
> >>configuration of gcc, that wouldn't let you work around the ltconfig
> >>
> >>Even if future autoconf and gcc releases don't apply this patch,
> >>this post will help people who need to build gcc on cygwin.
> >>
> >>- Dan
> >>
> >>http://www.kegel.com
> >

More information about the Cygwin-apps mailing list