[cfe-dev] Header Search Paths with MinGW

Jim Grosbach grosbach at apple.com
Wed Sep 1 16:09:39 PDT 2010


On Sep 1, 2010, at 3:31 PM, Sandeep Patel wrote:

> On Wed, Sep 1, 2010 at 6:26 PM, Fernando Pelliccioni
> <fpelliccioni at gmail.com> wrote:
>> On Wed, Sep 1, 2010 at 3:06 PM, Sandeep Patel <deeppatel1987 at gmail.com>
>> wrote:
>>> 
>>> I deliver compilers for our target that run on MinGW, Darwin, and
>>> Linux. I prefer to bootstrap those compilers from Darwin.
>>> 
>>> That means I'm not running MinGW and don't have a g++ to use -dumpmachine
>>> with.
>>> 
>> 
>> Please, Could you specify exactly how you compile clang?
>> I would like to reproduce it in order to find a solution for all possible
>> cases.
> 
> In the case we're talking about my build starts with building a Darwin
> -> ARM cross toolchain:
> 
> * build binutils for arm-eabi --build=i686-apple-darwin10
> --host=i686-apple-darwin10
> * build LLVM (with clang in llvm/tools/clang) with
> --build=i686-apple-darwin10 --host=i686-apple-darwin10
> * build llvm-gcc and newlib with --target=arm-eabi
> --with-cpu=cortex-a9 --with-fpu=neon --with-abi=aapcs
> --with-float=hard
> 
> The next step is to build a Darwin -> MinGW cross toolchain:
> 
> * build binutils for i686-pc-mingw32 --build=i686-apple-darwin10
> --host=i686-apple-darwin10
> * build LLVM (with clang in llvm/tools/clang) with
> --build=i686-apple-darwin10 --host=i686-apple-darwin10
> * build llvm-gcc and newlib with --target=i686-pc-mingw32
> --enable-sjlj-exceptions --enable-threads=win32
> --disable-win32-registry --disable-__cxa_atexit
> 
> Then I build a MinGW -> ARM cross toolchain, using the just built tools:
> 
> * build binutils for arm-eabi --build=i686-apple-darwin10 --host=i686-pc-mingw32
> * build LLVM (with clang in llvm/tools/clang) with
> --build=i686-apple-darwin10 --host=i686-pc-mingw32
> * build llvm-gcc and newlib with --target=arm-eabi
> --with-cpu=cortex-a9 --with-fpu=neon --with-abi=aapcs
> --with-float=hard
> 
> The essential issue is that I never build directly on a MinGW machine.

Yep. This is a not-uncommon scenario for embedded targets. At a previous job, we built our Windows hosted cross compilers on Linux in exactly this manner (i.e., a Canadian Cross configuration).

-Jim



More information about the cfe-dev mailing list