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

İsmail Dönmez ismail at donmez.ws
Fri Jul 10 09:30:53 PDT 2015


Hi,

I meant to try these but both on cygwin and linux hosts we have
linking regression that goes like:

λ clang -v -target x86_64-w64-mingw32 -isystem
C:/mingw-w64-6.0.0/x86_64-w64-mingw32/include -isystem
C:/mingw-w64-6.0.0/include/c++/6.0.0 -isystem
C:/mingw-w64-6.0.0/include/c++/6.0.0/x86_64-w64-mingw32
randomworks/windows/nic.c
clang version 3.7.0 (https://github.com/llvm-mirror/clang.git
ca355c9f413a6ca4941e3033e89e5242e29bd802)
Target: x86_64-w64-windows-gnu
Thread model: posix
 "C:\\Program Files\\LLVM\\bin\\clang.exe" -cc1 -triple
x86_64-w64-windows-gnu -emit-obj -mrelax-all -disable-free
-main-file-name nic.c -mrelocation-model pic -pic-level 2
-mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v
-dwarf-column-info -resource-dir "C:\\Program
Files\\LLVM\\bin\\..\\lib\\clang\\3.7.0" -isystem
C:/mingw-w64-6.0.0/x86_64-w64-mingw32/include -isystem
C:/mingw-w64-6.0.0/include/c++/6.0.0 -isystem
C:/mingw-w64-6.0.0/include/c++/6.0.0/x86_64-w64-mingw32
-internal-isystem "C:\\Program
Files\\LLVM\\bin\\..\\lib\\clang\\3.7.0\\include" -internal-isystem
include -internal-isystem include-fixed -internal-isystem
"C:\\cygwin64\\mingw32\\include" -internal-isystem
"C:\\cygwin64\\include" -std=c11 -fdebug-compilation-dir
"C:\\cygwin64\\home\\ismail" -ferror-limit 19 -fmessage-length 0
-mstackrealign -fno-use-cxa-atexit -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -fansi-escape-codes -o
"C:\\cygwin64\\tmp\\nic-6bff3b.o" -x c randomworks/windows/nic.c
clang -cc1 version 3.7.0 based upon LLVM 3.7.0svn default target
x86_64-pc-windows-msvc
ignoring nonexistent directory "include"
ignoring nonexistent directory "include-fixed"
ignoring nonexistent directory "C:\cygwin64\mingw32\include"
ignoring nonexistent directory "C:\cygwin64\include"
#include "..." search starts here:
#include <...> search starts here:
 C:/mingw-w64-6.0.0/x86_64-w64-mingw32/include
 C:/mingw-w64-6.0.0/include/c++/6.0.0
 C:/mingw-w64-6.0.0/include/c++/6.0.0/x86_64-w64-mingw32
 C:\Program Files\LLVM\bin\..\lib\clang\3.7.0\include
End of search list.
 "C:\\cygwin64\\bin\\ld.exe" -m i386pep -Bdynamic -o a.exe crt2.o
crtbegin.o -L "-LC:\\cygwin64\\lib" "-LC:\\cygwin64\\mingw32\\lib"
"C:\\cygwin64\\tmp\\nic-6bff3b.o" -lmingw32 -lgcc_s -lgcc -lmoldname
-lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32
-lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt crtend.o
/usr/bin/ld: cannot find crt2.o: No such file or directory
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lmingw32
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lmoldname
/usr/bin/ld: cannot find -lmingwex
/usr/bin/ld: cannot find -lmsvcrt
/usr/bin/ld: cannot find -lmingw32
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lmoldname
/usr/bin/ld: cannot find -lmingwex
/usr/bin/ld: cannot find -lmsvcrt
/usr/bin/ld: cannot find crtend.o: No such file or directory
clang.exe: error: linker command failed with exit code 1 (use -v to
see invocation)

Any ideas? Also reproducible with gcc 5.1.1 on Linux.


On Tue, Jul 7, 2015 at 6:19 PM, Yaron Keren <yaron.keren at gmail.com> wrote:
> Here is a patch honoring sysroot for ld, let me know if it works for you.
>
> 2015-07-07 12:13 GMT+03:00 Yaron Keren <yaron.keren at gmail.com>:
>>
>> Hi,  Please see if the attached patch works on opensuse.
>>
>> I'll look at the cygnus ld issue later.
>>
>>
>> 2015-07-07 10:38 GMT+03:00 İsmail Dönmez <ismail at donmez.ws>:
>>>
>>> Hi,
>>>
>>> On Mon, Jul 6, 2015 at 10:40 AM, Yaron Keren <yaron.keren at gmail.com>
>>> wrote:
>>> > Author: yrnkrn
>>> > Date: Mon Jul  6 02:40:10 2015
>>> > New Revision: 241432
>>> >
>>> > URL: http://llvm.org/viewvc/llvm-project?rev=241432&view=rev
>>> > Log:
>>> > Teach mingw toolchain the msys2 mingw-w64 distribution C++ dirs.
>>> >
>>> >
>>> > Modified:
>>> >     cfe/trunk/lib/Driver/MinGWToolChain.cpp
>>> >     cfe/trunk/lib/Driver/ToolChains.h
>>>
>>> I tried this revision on openSUSE MinGW toolchain and its missing one
>>> include path, which is $GCC_ROOT/nclude/c++/x86_64-w64-mingw32 which
>>> contains "bits" and "ext" directories. Would you mind adding that to
>>> the list too?
>>>
>>> Thanks!
>>
>>
>




More information about the cfe-commits mailing list