Re: Final(?) patch to update libtool in GCC and src trees

Paolo Bonzini
2007-04-11T07:36:43Z

Dave Korn wrote:
> On 10 April 2007 21:07, Steve Ellcey wrote:
>
>>> I appreciate the problem, but Cygwin can be a bit 'special' when it
>>> comes to libtool; if it hasn't been done yet, can you possibly bear to
>>> hold off a bit while I give it some hasty testing? (By 'a bit', I mean no
>>> more than say 'overnight'). Sorry to be a pain :-/
>>>
>>>
>>> cheers,
>>> DaveK
>> I can wait, especially since no one has given me the go ahead yet. :-)
>> I know of no cygwin testing that has been done.
>
> Mixed results so far. Patching a binutils checkout and building it got me
> this:
>
>
> === ld tests ===
> @@ -297,14 +297,8 @@ Running /usr/build/src-binutils/ld/tests
> Running /usr/build/src-binutils/ld/testsuite/ld-arm/arm-elf.exp ...
> Running /usr/build/src-binutils/ld/testsuite/ld-auto-import/auto-import.exp
> ...
> Running /usr/build/src-binutils/ld/testsuite/ld-bootstrap/bootstrap.exp ...
> -FAIL: bootstrap
> -FAIL: bootstrap with strip
> FAIL: bootstrap with --static
> -FAIL: bootstrap with --traditional-format
> -FAIL: bootstrap with --no-keep-memory
> -FAIL: bootstrap with --relax
> Running /usr/build/src-binutils/ld/testsuite/ld-cdtest/cdtest.exp ...
> -FAIL: cdtest
> FAIL: cdtest with -Ur
> Running /usr/build/src-binutils/ld/testsuite/ld-checks/checks.exp ...
> Running /usr/build/src-binutils/ld/testsuite/ld-cris/cris.exp ...
> @@ -396,40 +390,40 @@ Running /usr/build/src-binutils/ld/tests
>
> === ld Summary ===
>
> -# of expected passes 53
> -# of unexpected failures 9
> +# of expected passes 59
> +# of unexpected failures 3
> # of unexpected successes 1
> # of expected failures 3
> # of unsupported tests 1
> -/usr/build/obj-binutils/ld/ld-new 2.17.50.20070410
> +/usr/build/obj-binutils-patched/ld/ld-new 2.17.50.20070410
>
>
> ..which is entirely good :-D Then I tried a winsup checkout; it failed to
> configure in newlib:
>
> checking for i686-pc-cygwin-ranlib... ranlib
> checking for i686-pc-cygwin-readelf... no
> checking for readelf... readelf
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether to enable maintainer-specific portions of Makefiles... no
> checking for .preinit_array/.init_array/.fini_array support... readelf: Error:
> Input file 'conftest' is not readable.
> no
> checking for array aliasing support... yes
> configure: updating cache ./config.cache
> configure: error: conditional "am__fastdepCXX" was never defined.
> Usually this means the macro was only invoked conditionally.
> Makefile:8649: *** [configure-target-newlib] Error 1
>
> #0 configure-target-newlib at /usr/build/obj-winsup.new/Makefile:8649
> #1 all-target-newlib at /usr/build/obj-winsup.new/Makefile:8690
> #2 maybe-all-target-newlib at /usr/build/obj-winsup.new/Makefile:8687
> #3 all-target (.PHONY target)
> make[1]: Leaving directory `/usr/build/obj-winsup.new'
>
>
> This is what config.log showed:
>
> configure:3737: checking for a BSD-compatible install
> configure:3793: result: /usr/bin/install -c
> configure:3808: checking whether to enable maintainer-specific portions of
> Makefiles
> configure:3817: result: no
> configure:21892: checking for .preinit_array/.init_array/.fini_array support
> configure:21905: gcc -L/usr/build/obj-winsup.new/i686-pc-cygwin/winsup
> -L/usr/build/obj-winsup.new/i686-pc-cygwin/winsup/cygwin
> -L/usr/build/obj-winsup.new/i686-pc-cygwin/winsup/w32api/lib -isystem
> /usr/build/src-winsup/winsup/include -isystem
> /usr/build/src-winsup/winsup/cygwin/include -isystem
> /usr/build/src-winsup/winsup/w32api/include
> -B/usr/build/obj-winsup.new/i686-pc-cygwin/newlib/ -isystem
> /usr/build/obj-winsup.new/i686-pc-cygwin/newlib/targ-include -isystem
> /usr/build/src-winsup/newlib/libc/include
> -I/usr/build/src-winsup/winsup/cygwin/include -o conftest conftest.c
> -static -nostartfiles -nostdlib 1>&5
> configure:21908: $? = 0
> configure:21921: result: no
> configure:21931: checking for array aliasing support
> configure:21942: gcc -L/usr/build/obj-winsup.new/i686-pc-cygwin/winsup
> -L/usr/build/obj-winsup.new/i686-pc-cygwin/winsup/cygwin
> -L/usr/build/obj-winsup.new/i686-pc-cygwin/winsup/w32api/lib -isystem
> /usr/build/src-winsup/winsup/include -isystem
> /usr/build/src-winsup/winsup/cygwin/include -isystem
> /usr/build/src-winsup/winsup/w32api/include
> -B/usr/build/obj-winsup.new/i686-pc-cygwin/newlib/ -isystem
> /usr/build/obj-winsup.new/i686-pc-cygwin/newlib/targ-include -isystem
> /usr/build/src-winsup/newlib/libc/include
> -I/usr/build/src-winsup/winsup/cygwin/include -c conftest.c
> 1>&5
> conftest.c:1: warning: excess elements in scalar initializer
> conftest.c:1: warning: (near initialization for `x3')
> conftest.c:1: warning: excess elements in scalar initializer
> conftest.c:1: warning: (near initialization for `x3')
> configure:21945: $? = 0
> configure:21954: result: yes
> configure:22030: updating cache ./config.cache
> configure:22141: error: conditional "am__fastdepCXX" was never defined.
> Usually this means the macro was only invoked conditionally.
>
>
> Note the huge jump:
>
> configure:3817: result: no
> configure:21892: checking for .preinit_array/.init_array/.fini_array support

Right.

Inside those two lines we have

if test "${use_libtool}" = "yes"; then
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_PROG_AWK
fi

I would rewrite them at the very least as

AC_PROG_AWK
AC_PROG_CXX

if test "${use_libtool}" = "yes"; then
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
fi

There might be more macros to put above the "if" to avoid that they be
expanded inside an "if".

Paolo