r241432 - Teach mingw toolchain the msys2 mingw-w64 distribution C++ dirs.

İsmail Dönmez ismail at donmez.ws
Sun Jul 12 06:36:32 PDT 2015


On Sun, Jul 12, 2015 at 4:31 PM, Yaron Keren <yaron.keren at gmail.com> wrote:
> clang does call ld directly and needs to know libs directories. Calling gcc
> may solve the link problem but clang would still have to find the include
> dirs somehow.
> You solved this problem with -isystem
> /usr/x86_64-w64-mingw32/sys-root/x86_64-w64-mingw32/include but there are
> additional C++ includes.
>
> The root of the problem is x86_64-w64-mingw32-gcc is in /usr/bin but
> includes and libs under /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0. So
> x86_64-w64-mingw32-gcc is not in the same subtree as its includes and libs.
>
> Is that standard installation of mingw?

Its the default openSUSE mingw package, so its standard at least on Linux.

> Any idea how clang can find out these
> /usr/lib64/gcc/x86_64-w64-mingw32/5.1.0  dirs?

No idea, yet :)

> How about using --sysroot=/usr/lib64/gcc/x86_64-w64-mingw32/5.1.0 ?

Doesn't seem to work.

P.S: The problem on Cygwin side seems to be that my toolchain is
missing libgcc_s.a and this seems to be working fine since I build the
whole toolchain as static. Do you think its reasonable to
conditionally add -lgcc_s depending on it exists or not?



More information about the cfe-commits mailing list