semicolon breaking builds on llvm-gcc4.2 cygwin build for arm target 2.2prerelease2

Since we are fast approaching the 10th, I thought it appropriate to report this “bug” with the build despite not having worked around it.
Build environment is

Summary:

When building llvm-gcc with a arm-apple-darwin target on i686-pc-cygwin, make fails because child calls to configure have an errant semicolon that causes the --srcdir parameter to be ignored by the configure script. This causes the builds in the host-i686-pc-cygwin directory to fail unnecessarily.

Removing said semicolon from the configure calls and running ‘make’ manually succeeds.

Configure Parameters for llvm-gcc:

(from /cygdrive/e/llvm-gcc4.2-2.2.source/config.status)

config.status:# ./configure --enable-llvm=/cygdrive/e/llvm-2.2 --target=arm-ap
ple-darwin --enable-sjlj-exceptions --with-heavenly=/usr/local/share/iphone-file
system --with-gcc=/usr/bin/gcc --program-prefix=arm-apple-darwin --with-as=/usr/
local/bin/llvm-as --with-ld=/usr/local/bin/llvm-ld --enable-languages=c,c++,objc
,obj-c++

Root Cause?:

I believe this problem is caused by --srcdir appearing after the program_transform_name substitutions.
This problem was likely introduced within this change

+if test "$program_transform_name" = s,x,x,; then

Revision 43990 - (view) (download) (annotate) - [select for diffs]
Modified Sat Nov 10 22:32:06 2007 CST (2 months, 4 weeks ago) by void
Original Path: llvm-gcc-4.2/trunk/configure
File length: 244731 byte(s)
Diff to previous 43921 (colored)

Update configure scripts to build the Apple Way

Fix:

To maintain computability with the ‘Apple way of building’, while also enabling compatability for Apple platforms, I suggest moving the } ${ml_srcdiroption} options prior to the ${ac_configure_args} when generating calls to ./configure from ‘make’

Closing Comments:

I’ve yet to complete an entire build, but wanted to report this bug now in case the llvm-gcc team would like to address this problem on Cygwin builds prior to the release. It seems easy enough to fix.

I will report back further after I complete the build, and may also install these sources on a clean install of Cygwin to see if I can reproduce the problem. It appears this bug can be corrected rather easily by moving --srcdir as I have suggested.

– Patrick Hennessey
– Dallas, TX

Problem Description

For each host- subdir, the --srcdir parameter follows a semicolon, which to my bash shell means that --srcdir is a second command to execute, rather than a parameter to the configure.

I believe this problem would be mitigated by --srcdir appearing before --program-transform-name in the generated invocations of configure.

It might to be related these lines in the top level configure which contain said semicolon:

  • if test “$program_transform_name” = s,x,x,; then
  • program_transform_name=“s,^,${program_prefix},; $program_transform_name”
  • program_transform_name=“s,$$,${program_suffix},; $program_transform_name”

Here is an example from config.log for **llvm-gcc4.2-2.2.source/**host-i686-pc-cygwin/gcc (fixincludes, libiberty and intl already were ‘fixed’ per my ‘solution’)

$ grep configure config.log |head -3
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
$ /cygdrive/e/llvm-gcc4.2-2.2.source/gcc/configure --cache-file=./config.cac
–build=i686-pc-cygwin --host=i686-pc-cygwin --target=arm-apple-darwin --enab
-llvm=/cygdrive/e/llvm-2.2 --enable-sjlj-exceptions --with-gcc=/usr/bin/gcc
–with-as=/usr/local/bin/llvm-as --with-ld=/usr/local/bin/llvm-ld --enable-languages=c,c++,objc,obj-c++
–program-transform-name=s,^,arm-apple-darwin,; --srcdir=…/…/./gcc

Its an easy fix to get these to compile, though:

  • cd host-i686-pc-cygwin/gcc/
  • grep configure config.log|head -3|tail -1 | perl -pe ‘s/;//;s/^\s+$//;’ > newonfig.sh
  • bash newconfig.sh
  • make
    $ cat newconfig.sh
    /cygdrive/e/llvm-gcc4.2-2.2.source/gcc/configure --cache-file=./config.cache –
    build=i686-pc-cygwin --host=i686-pc-cygwin --target=arm-apple-darwin --enable-ll
    vm=/cygdrive/e/llvm-2.2 --enable-sjlj-exceptions --with-gcc=/usr/bin/gcc --with-as=/usr/local/bin/llvm-as --w
    ith-ld=/usr/local/bin/llvm-ld --enable-languages=c,c++,objc,obj-c++ --program-tr
    ansform-name=s,^,arm-apple-darwin, --srcdir=…/…/./gcc

Below is the first top-level error generated by ‘make’ after configure (for fixincludes) This sort of error is generated for each subdirectory target under ./llvm-gcc4.2-2.2.source/host-i686-pc-cygwin. Each time I get the error, I can correct the invocation of configure and build using the Perl rewrite appearing above.

$ make
make[1]: Entering directory /cygdrive/e/llvm-gcc4.2-2.2.source' make[2]: Entering directory /cygdrive/e/llvm-gcc4.2-2.2.source/host-i686-pc-cyg
win/libiberty’
make[3]: Entering directory /cygdrive/e/llvm-gcc4.2-2.2.source/host-i686-pc-cyg win/libiberty/testsuite' make[3]: Nothing to be done for all’.
make[3]: Leaving directory /cygdrive/e/llvm-gcc4.2-2.2.source/host-i686-pc-cygw in/libiberty/testsuite' make[2]: Leaving directory /cygdrive/e/llvm-gcc4.2-2.2.source/host-i686-pc-cygw
in/libiberty’
make[2]: Entering directory /cygdrive/e/llvm-gcc4.2-2.2.source/host-i686-pc-cyg win/fixincludes' make[2]: *** No rule to make target /cygdrive/e/llvm-gcc4.2-2.2.source/fixinclu
des/Makefile.in’, needed by Makefile'. Stop. make[2]: Leaving directory /cygdrive/e/llvm-gcc4.2-2.2.source/host-i686-pc-cygw
in/fixincludes’
make[1]: *** [all-fixincludes] Error 2
make[1]: Leaving directory `/cygdrive/e/llvm-gcc4.2-2.2.source’
make: *** [all] Error 2

$ cd /cygdrive/e/llvm-gcc4.2-2.2.source/host-i686-pc-cygwin/fixincldes
$ grep configure config.log |head -20
running configure, to aid debugging if configure makes a mistake.
It was created by fixincludes configure , which was
$ /cygdrive/e/llvm-gcc4.2-2.2.source/fixincludes/configure --cache-file=./con
ig.cache --build=i686-pc-cygwin --host=i686-pc-cygwin --target=arm-apple-darwin
–enable-llvm=/cygdrive/e/llvm-2.2 --enable-sjlj-exceptions --with-gcc=/usr/bin/gc
c --enable-languages=c,c++ objc,obj-c++ --program-transform-name=s,^,arm-apple-darwin, --srcdir=/cygdrive/
/llvm-gcc4.2-2.2.source/fixincludes