[llvm-bugs] [Bug 27722] New: MinGW driver fails to find CRT object files
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu May 12 07:43:01 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=27722
Bug ID: 27722
Summary: MinGW driver fails to find CRT object files
Product: clang
Version: 3.8
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Driver
Assignee: unassignedclangbugs at nondot.org
Reporter: bas at abbeygames.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
Created attachment 16364
--> https://llvm.org/bugs/attachment.cgi?id=16364&action=edit
Dockerfile that is used to build the entire toolchain.
Clang's "new" MinGW driver fails to find the CRT object files and seems to
ignore the fact that x86_64-w64-mingw32.static and x86_64-w64-mingw32 are
different toolchains.
Ran into this while trying to integrate Clang 3.8 with MXE and WClang. The full
bug report can be found on the WClang page:
https://github.com/tpoechtrager/wclang/issues/22
When building a very simple C++ project with wclang, mxe and clang 3.8 the
output of the foloowing command:
w64-clang++ HelloWorld.cpp Hello/Speaker.cpp -ohello_world.exe -IHello -v
results in:
clang version 3.8.0-2ubuntu3 (tags/RELEASE_380/final)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/bin
"/usr/lib/llvm-3.8/bin/clang" -cc1 -triple x86_64-w64-windows-gnu -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -main-file-name HelloWorld.cpp
-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 -debugger-tuning=gdb
-nostdsysteminc -nobuiltininc -resource-dir
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0 -isystem
/usr/bin/../lib/clang/3.8/include -isystem
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include -isystem
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include/../../../usr/lib/gcc/x86_64-w64-mingw32.static/4.9.3/include/c++
-isystem
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include/../../../usr/lib/gcc/x86_64-w64-mingw32.static/4.9.3/include/c++/x86_64-w64-mingw32.static
-I Hello -internal-isystem /usr/x86_64-w64-mingw32/include/c++
-internal-isystem /usr/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32
-internal-isystem /usr/x86_64-w64-mingw32/include/c++/backward
-internal-isystem /usr/x86_64-w64-mingw32/include/c++/ -internal-isystem
/usr/x86_64-w64-mingw32/include/c++//x86_64-w64-mingw32 -internal-isystem
/usr/x86_64-w64-mingw32/include/c++//backward -internal-isystem
/usr/include/c++/ -internal-isystem /usr/include/c++//x86_64-w64-mingw32
-internal-isystem /usr/include/c++//backward -internal-isystem include/c++
-internal-isystem include/c++/x86_64-w64-mingw32 -internal-isystem
include/c++/backward -fdeprecated-macro
-fdebug-compilation-dir/usr/src/cmake-hello-world -ferror-limit 19
-fmessage-length 80 -fno-use-cxa-atexit -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/HelloWorld-e12222.o -x c++ HelloWorld.cpp
clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target
x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/include/c++"
ignoring nonexistent directory
"/usr/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32"
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/include/c++/backward"
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/include/c++/"
ignoring nonexistent directory
"/usr/x86_64-w64-mingw32/include/c++//x86_64-w64-mingw32"
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/include/c++//backward"
ignoring nonexistent directory "/usr/include/c++//x86_64-w64-mingw32"
ignoring nonexistent directory "/usr/include/c++//backward"
ignoring nonexistent directory "include/c++"
ignoring nonexistent directory "include/c++/x86_64-w64-mingw32"
ignoring nonexistent directory "include/c++/backward"
#include "..." search starts here:
#include <...> search starts here:
Hello
/usr/bin/../lib/clang/3.8/include
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include/../../../usr/lib/gcc/x86_64-
w64-mingw32.static/4.9.3/include/c++
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include/../../../usr/lib/gcc/x86_64-
w64-mingw32.static/4.9.3/include/c++/x86_64-w64-mingw32.static
/usr/include/c++
End of search list.
"/usr/lib/llvm-3.8/bin/clang" -cc1 -triple x86_64-w64-windows-gnu -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -main-file-name Speaker.cpp
-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 -debugger-tuning=gdb
-nostdsysteminc -nobuiltininc -resource-dir
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0 -isystem
/usr/bin/../lib/clang/3.8/include -isystem
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include -isystem
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include/../../../usr/lib/gcc/x86_64-w64-mingw32.static/4.9.3/include/c++
-isystem
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include/../../../usr/lib/gcc/x86_64-w64-mingw32.static/4.9.3/include/c++/x86_64-w64-mingw32.static
-I Hello -internal-isystem /usr/x86_64-w64-mingw32/include/c++
-internal-isystem /usr/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32
-internal-isystem /usr/x86_64-w64-mingw32/include/c++/backward
-internal-isystem /usr/x86_64-w64-mingw32/include/c++/ -internal-isystem
/usr/x86_64-w64-mingw32/include/c++//x86_64-w64-mingw32 -internal-isystem
/usr/x86_64-w64-mingw32/include/c++//backward -internal-isystem
/usr/include/c++/ -internal-isystem /usr/include/c++//x86_64-w64-mingw32
-internal-isystem /usr/include/c++//backward -internal-isystem include/c++
-internal-isystem include/c++/x86_64-w64-mingw32 -internal-isystem
include/c++/backward -fdeprecated-macro -fdebug-compilation-dir
/usr/src/cmake-hello-world -ferror-limit 19 -fmessage-length 80
-fno-use-cxa-atexit -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/Speaker-1d92c1.o -x c++
Hello/Speaker.cpp
clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target
x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/include/c++"
ignoring nonexistent directory
"/usr/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32"
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/include/c++/backward"
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/include/c++/"
ignoring nonexistent directory
"/usr/x86_64-w64-mingw32/include/c++//x86_64-w64-mingw32"
ignoring nonexistent directory "/usr/x86_64-w64-mingw32/include/c++//backward"
ignoring nonexistent directory "/usr/include/c++//x86_64-w64-mingw32"
ignoring nonexistent directory "/usr/include/c++//backward"
ignoring nonexistent directory "include/c++"
ignoring nonexistent directory "include/c++/x86_64-w64-mingw32"
ignoring nonexistent directory "include/c++/backward"
#include "..." search starts here:
#include <...> search starts here:
Hello
/usr/bin/../lib/clang/3.8/include
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include/../../../usr/lib/gcc/x86_64-
w64-mingw32.static/4.9.3/include/c++
/usr/src/mxe/usr/x86_64-w64-mingw32.static/include/../../../usr/lib/gcc/x86_64-
w64-mingw32.static/4.9.3/include/c++/x86_64-w64-mingw32.static
/usr/include/c++
End of search list.
"/usr/bin/x86_64-w64-mingw32.static-ld" -m i386pep -Bdynamic -o
hello_world.exe crt2.o crtbegin.o
-L/usr/src/mxe/usr/lib/gcc/x86_64-w64-mingw32.static/4.9.3
-L/usr/x86_64-w64-mingw32/lib -L/usr/lib
-L/usr/x86_64-w64-mingw32/sys-root/mingw/lib /tmp/HelloWorld-e12222.o
/tmp/Speaker-1d92c1.o -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex
-lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc
-lmoldname -lmingwex -lmsvcrt crtend.o
/usr/bin/x86_64-w64-mingw32.static-ld: cannot find crt2.o: No such file or
directory
/usr/bin/x86_64-w64-mingw32.static-ld: cannot find crtbegin.o: No such file or
directory
/usr/bin/x86_64-w64-mingw32.static-ld: cannot find -lgcc_s
/usr/bin/x86_64-w64-mingw32.static-ld: cannot find -lgcc_s
/usr/bin/x86_64-w64-mingw32.static-ld: cannot find crtend.o: No such file or
directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
As shown in the output it has trouble locating the crt2.o, etc files. This can
be resolved by installing mingw but mxe and mingw are actually different
toolchains. It also appears to not be able to find gcc_s.
I also attached a docker image that reproduces these issues.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160512/c5c8fc65/attachment-0001.html>
More information about the llvm-bugs
mailing list