[LLVMdev] Potential breakage in llvm-gcc's ./configure

Daniel Berlin dberlin at dberlin.org
Mon Mar 24 08:37:25 PDT 2008


>
>  ./configure in the llvm package will work on my amd64 machine
>  with this command line:
>
>  ./configure --prefix=$HOME --enable-optimized \
>  --build=i686-pc-linux-gnu CC=gcc-4.2 CXX=g++-4.2
>
>  Note that the CC and CXX flags are set on the command line, not as
>  environment variables - trying to submit them via the environment got me
>  all kinds of breakage.

Err, you should set them as env vars.
Really.

>
>  Also not that this needs to set just --build, not --host (which defaults
>  to the setting of --build) nor --target (which defaults to whatever
>  value --host ends up as).
>
>
>  Now the ./configure in llvm-gcc4.2 will choke badly on such a command line.
>
>  First, it misinterprets the CC= and CXX= strings as target architecture
>  names, and continues to complain that it cannot configure for multiple
>  architectures at once.
Which is why you should be setting them as env vars :)

>
>  Second, it does not default --host or --target to --build.

This is normal.
Crappy, but normal.

>
>  Third, even with --target and --host explicitly set to
>  i686-pc-linux-gnu, the assembler will be fed with 64-bit code. The
>  failing command is
>
>  /home/jo/llvm-gcc-wrk/gcc/xgcc -B/home/jo/llvm-gcc-wrk/gcc/
>  -B/home/jo/i686-pc-linux-gnu/bin/ -B/home/jo/i686-pc-linux-gnu/lib/
>  -isystem /home/jo/i686-pc-linux-gnu/include
>  -isystem /home/jo/i686-pc-linux-gnu/sys-include -O2 -DIN_GCC -W -Wall
>  -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
>  -Wold-style-definition -isystem ./include -I. -I.
>  -I/home/jo/llvm-gcc-src/gcc -I/home/jo/llvm-gcc-src/gcc/.
>  -I/home/jo/llvm-gcc-src/gcc/../include
>  -I/home/jo/llvm-gcc-src/gcc/../libcpp/include -g0
>  -finhibit-size-directive -fno-inline-functions -fno-exceptions
>  -fno-zero-initialized-in-bss -fno-unit-at-a-time -fno-omit-frame-pointer
>  -c /home/jo/llvm-gcc-src/gcc/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O
>  -o crtbeginT.o
>
>  (slightly edited to leave out multiple blanks and line continuation
>  backslashes).
>
>  The error messages are just what I had seen earlier:
>
>  /tmp/ccVjR8Qt.s: Assembler messages:
>  /tmp/ccVjR8Qt.s:33: Error: suffix or operands invalid for `push'
>  /tmp/ccVjR8Qt.s:43: Error: suffix or operands invalid for `call'
>  /tmp/ccVjR8Qt.s:61: Error: suffix or operands invalid for `push'
>  /tmp/ccVjR8Qt.s:71: Error: suffix or operands invalid for `call'
>

This is interesting, and I wonder if it appears in gcc itself. If so,
it is a bug.



More information about the llvm-dev mailing list