Hello, Everyone.
I'm currently trying to bootstrap llvm-gcc4 on mingw32 platform.
Everything (except some small fixes) seems to be fine: stage1 finished
successfully. I'm linking with debug variant of LLVM, since linker bug
prevents release builds.
Unfortunately, stage2 failes immediately with this cryptic message:
$/f/tmp/llvm/gccbuild/gcc/xgcc -B/f/tmp/llvm/gccbuild/gcc/ -Bf:/tmp/llvm/install/mingw32/bin/
-Bf:/tmp/llvm/install/mingw32/lib/ -isystem f:/tmp/llvm/install/mingw32/include -isystem
f:/tmp/llvm/install/mingw32/sys-include -O -I../../gccsrc/gcc/../winsup/w32api/include -DIN_GCC
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I.
-I../../gccsrc/gcc -I../../gccsrc/gcc/. -I../../gccsrc/gcc/../include -I../../gccsrc/gcc/../libcpp/include
-I/f/tmp/llvm/build -If:/tmp/llvm/build/../src/include -DL_muldi3 -c ../../gccsrc/gcc/libgcc2.c -o
libgcc/./_muldi3.o
In file included from ../../gccsrc/gcc/tsystem.h:90,
from ../../gccsrc/gcc/libgcc2.c:41:
f:/tmp/llvm/install/lib/../include/stdio.h: In function 'vsnprintf':
f:/tmp/llvm/install/lib/../include/stdio.h:219: internal compiler error: in assemble_external_real, at varasm.c:1925
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
Does anybody have idea, why does this error might occur? I can supply
any needed information (such as -save-temps output, etc).
I'm currently trying to bootstrap llvm-gcc4 on mingw32 platform.
Everything (except some small fixes) seems to be fine: stage1 finished
successfully. I'm linking with debug variant of LLVM, since linker bug
prevents release builds.
Ok.
$/f/tmp/llvm/gccbuild/gcc/xgcc -B/f/tmp/llvm/gccbuild/gcc/ -Bf:/tmp/llvm/install/mingw32/bin/
-Bf:/tmp/llvm/install/mingw32/lib/ -isystem f:/tmp/llvm/install/mingw32/include -isystem
f:/tmp/llvm/install/mingw32/sys-include -O -I../../gccsrc/gcc/../winsup/w32api/include -DIN_GCC
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I.
-I../../gccsrc/gcc -I../../gccsrc/gcc/. -I../../gccsrc/gcc/../include -I../../gccsrc/gcc/../libcpp/include
-I/f/tmp/llvm/build -If:/tmp/llvm/build/../src/include -DL_muldi3 -c ../../gccsrc/gcc/libgcc2.c -o
libgcc/./_muldi3.o
In file included from ../../gccsrc/gcc/tsystem.h:90,
from ../../gccsrc/gcc/libgcc2.c:41:
f:/tmp/llvm/install/lib/../include/stdio.h: In function 'vsnprintf':
f:/tmp/llvm/install/lib/../include/stdio.h:219: internal compiler error: in assemble_external_real, at varasm.c:1925
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
Does anybody have idea, why does this error might occur? I can supply
any needed information (such as -save-temps output, etc).
The function that it is dying in (assemble_external_real) should not be called by llvm-gcc. If I had to guess, I would guess that changing varasm.c:1941 from:
#ifdef ASM_OUTPUT_EXTERNAL
to:
#if defined(ASM_OUTPUT_EXTERNAL) && !defined(ENABLE_LLVM)
will fix it. If so, please let me know and I'll update my tree. If not, please get a stack trace of the failure so I can see where it is called.
Thanks,
-Chris
You wrote Wednesday, May 3, 2006, 1:41:31 AM:
> will fix it. If so, please let me know and I'll update my tree. If not,
> please get a stack trace of the failure so I can see where it is called.
Yes. This fixes the bug. ASM_OUTPUT_EXTERNAL was defined in cygming.h
and seems to be platform specific. There are also some other platform
issues, but they can be easily fixed, so, I'll report them at the end
of all process.
Sounds good. I've integrated the ASM_OUTPUT_EXTERNAL fix, and it went out in the tarball I sent out this morning.
Now compilation goes further...
1. While compiling __main.o from libgcc2 I had complain about
".local". It seems, that it isn't supported by win32 version of as.
After removing this line and compiling by hand everything goes further
(generated .s file attached). Maybe X86AsmWriter should be modified?
Probably. Patches welcome 
2. While compiling gthr-win32.c I've got the following exception
stopped all compilation:
./cc1.exe -fpreprocessed h:\WINNT\Temp/ccAnbaaa.i -quiet -dumpbase gthr-win32.c
-auxbase-strip libgcc/./gthr-win32.o -g -O2 -W -Wall -Wwrite-strings -Wstrict-p
rototypes -Wmissing-prototypes -Wold-style-definition -version -o gthr-win32.s
GNU C version 4.0.1 LLVM (Apple Computer, Inc. build 5400) (mingw32)
compiled by GNU C version 3.4.5 (mingw special).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=131012
Compiler executable checksum: abcac2bc9d947e35dbd545ee6a02bf8f
Could not match memory address. Inline asm failure!
It seems to be exception in SelectionDAGISel.cpp. .i file attached.
Thanks, I'll take a look.
-Chris