[LLVMdev] Building CFE on MinGW

Greg Pettyjohn gregp at ccs.neu.edu
Sat Apr 22 10:38:34 PDT 2006


I've blown a couple of weekends trying to build under MinGW.

I can build the llvm tools with only a couple of minor hassles, but can't
seem to make any headway with the C Front End

Most errors I run into involve not being able to find header files.
The most frustrating part is that the error messages report that the file
can't be found, and then proceed to give a path to where the file actually
is located.

In the example below, the header "config/i386/xm-mingw32.h" cannot be
found. BUT the include path, specified by "-I../../src/gcc/", leads right
to the desired header.

I can work-around this particular error by copying files out of the src
directory into the corresponding places in the build directory.

I'm left believing that something is fundamentally wront with my setup.

Has anyone had any recent success building the CFE on MinGW?

Thanks.

$ xgcc -B/home/llvm-1.7/cfrontend/build/gcc
-B/home/llvm-1.7/cfrontend/install/i686-pc-mingw32/bin/ -B/home/llvm-1.7/
cfrontend/install/i686-pc-mingw32/lib/ -isystem
/home/llvm-1.7/cfrontend/install/i686-pc-mingw32/include -isystem /ho
me/llvm-1.7/cfrontend/install/i686-pc-mingw32/sys-include -O2
-I../../src/gcc/../winsup/w32api/include -DIN_GCC -DDEF
AULT_TARGET_MACHINE=\"i686-pc-mingw32\" -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -isystem ./
include -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I -I../../src
-I../../src/gcc/ -I../../src/gcc/../include -DL_m
uldi3 -c ../../src/gcc/libgcc2.c -o libgcc/./_muldi3.o
In file included from ../../src/gcc/libgcc2.c:40:
./tconfig.h:5:37: config/i386/xm-mingw32.h: No such file or directory
In file included from ../../src/gcc/libgcc2.c:41:
../../src/gcc/tsystem.h:75:19: stdio.h: No such file or directory
../../src/gcc/tsystem.h:78:23: sys/types.h: No such file or directory
../../src/gcc/tsystem.h:81:19: errno.h: No such file or directory
../../src/gcc/tsystem.h:88:20: string.h: No such file or directory
../../src/gcc/tsystem.h:89:20: stdlib.h: No such file or directory
../../src/gcc/tsystem.h:90:20: unistd.h: No such file or directory
In file included from
C:/msys/1.0/home/llvm-1.7/cfrontend/build/gcc/include/limits.h:122,
                 from
C:/msys/1.0/home/llvm-1.7/cfrontend/build/gcc/include/syslimits.h:7,
                 from
C:/msys/1.0/home/llvm-1.7/cfrontend/build/gcc/include/limits.h:11,
                 from ../../src/gcc/tsystem.h:93,
                 from ../../src/gcc/libgcc2.c:41:
./include/limits.h:122:61: no include path in which to search for limits.h
In file included from ../../src/gcc/libgcc2.c:41:
../../src/gcc/tsystem.h:96:18: time.h: No such file or directory
In file included from ../../src/gcc/libgcc2.c:43:
./tm.h:4:31: config/i386/i386.h: No such file or directory
./tm.h:5:31: config/i386/unix.h: No such file or directory
./tm.h:6:30: config/i386/bsd.h: No such file or directory
./tm.h:7:30: config/i386/gas.h: No such file or directory
./tm.h:8:29: config/dbxcoff.h: No such file or directory
./tm.h:9:34: config/i386/cygming.h: No such file or directory
./tm.h:10:34: config/i386/mingw32.h: No such file or directory
./tm.h:11:23: defaults.h: No such file or directory
In file included from ../../src/gcc/libgcc2.c:44:
../../src/gcc/llvm-out.h:69: error: syntax error before '*' token
../../src/gcc/llvm-out.h:69: warning: function declaration isn't a
prototype
../../src/gcc/libgcc2.c: In function `__mulhi3':

../../src/gcc/libgcc2.c:502: error: `BITS_PER_UNIT' undeclared (first use
in this function)
../../src/gcc/libgcc2.c:502: error: (Each undeclared identifier is
reported only once
../../src/gcc/libgcc2.c:502: error: for each function it appears in.)




More information about the llvm-dev mailing list