[LLVMdev] Building CFE in Mingw

Anton Korobeynikov asl at math.spbu.ru
Sun Apr 23 14:46:59 PDT 2006

Hello, all.

Just found this file in my e-mail atchive, hope it will be useful for somebody.


Some small rules:

 1) No blankspace in the paths to the top-level directories.
 2) Add paths to binaries to your system PATH variable.
 3) Use short paths to top-level directories.

1. Some checks & preparations.

 1) Be sure, that you're using right make version:
    $ make --version
    GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
    Built for i686-pc-msys
    Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
            Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

    Report bugs to <bug-make at gnu.org>.

  2) Some patching:
     Go to gcc\gcc directory, open Makefile.in file.

     Find lines:

INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
           -I$(srcdir)/../include @INCINTL@

     Change them to:

INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
           -I$(srcdir)/../include @INCINTL@ -IPREFIX/include

      Note: use forward slashes for PREFIX, e.g.

2. Possible issues.

    1) Problem: Complains about *.info files.
       Resolutions: There are know miscompartibilities between msys makeinfo
                    file and GCC's sources. Either use makeinfo from cygwin,
                    or just remove msys' version out.

    2) Problem: Complains about gthr-default.h file.
       Resolution: Grab gcc/gcc/gthr-win32.h file and copy it to gthr-default.h

    3) Problem: Complains about "CL_ObjCXX" and simular ("CL_") during
                compilation c-opts.c.
       Resolution: Turn off windows file protection, remove system32\sort.exe
                   file. After, check, that sort --version tells you, that it
                   is sort 2.0 (GNU textutils).

    4) Problem: Complains about files sitting in your PATH (or above), but,
                actually had not found.
       Resolution: Check your directories for the trailing '\'. It should not
                   be used! (E.g. c:\winnt - right, c:\winnt\ - wrong).

    5) Problem: Complains about find.exe while building libstdc++.
       Resolution: Look into issue 3) and remove windows' find.exe.
       You should you GNU's one.

With best regards,
 Anton                          mailto:asl at math.spbu.ru

Monday, April 24, 2006 1:44:03 AM

Faculty of Mathematics & Mechanics, Saint-Petersburg State University

More information about the llvm-dev mailing list