[cfe-dev] Clang on Windows targeting gcc requirements
Yaron Keren
yaron.keren at gmail.com
Sat Jul 4 08:40:33 PDT 2015
Hi Hurcan,
clang support the mingw-builds and mingw.org directory structure.
With the msys2 build, the problem is the missing C++ include directories?
Yaron
2015-07-04 16:41 GMT+03:00 Hurcan Solter <hsolter at gmail.com>:
> I've used to build clang on MSYS2 with older version of this patch at
> https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-clang/clang-mingw-driver.patch
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Alexpux_MINGW-2Dpackages_blob_master_mingw-2Dw64-2Dclang_clang-2Dmingw-2Ddriver.patch&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=r3JtGknlg70px5yvRWhv1Zl7r4WNJKqtaJd9HISLW8E&s=Ix-0aW1nGYMxzuqzb9pdVofsl42YNYgvP3nfa6Vzf8E&e=>
> and it served me well. this new patch not so much.Below the relevant dumps ;
>
> $ g++ -E -x c++ - -v < /dev/null
> Using built-in specs.
> COLLECT_GCC=C:\msys2_64\mingw64\bin\g++.exe
> Target: x86_64-w64-mingw32
> Configured with: ../gcc-4.9.2/configure --prefix=/mingw64
> --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32
> --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
> --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include
> --libexecdir=/mingw64/lib --with-gxx-include-dir=/mingw64/include/c++/4.9.2
> --enable-bootstrap --with-arch=x86-64 --with-tune=generic
> --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared
> --enable-static --enable-libatomic --enable-threads=posix --enable-graphite
> --enable-fully-dynamic-string --enable-libstdcxx-time=yes
> --disable-libstdcxx-pch --disable-libstdcxx-debug
> --enable-cloog-backend=isl --enable-version-specific-runtime-libs
> --disable-cloog-version-check --disable-isl-version-check --enable-lto
> --enable-libgomp --disable-multilib --enable-checking=release
> --disable-rpath --disable-win32-registry --disable-nls --disable-werror
> --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64
> --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64
> --with-cloog=/mingw64 --with-pkgversion='Rev5, Built by MSYS2 project'
> --with-bugurl=http://sourceforge.net/projects/msys2
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__sourceforge.net_projects_msys2&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=r3JtGknlg70px5yvRWhv1Zl7r4WNJKqtaJd9HISLW8E&s=qxch1gn6dUS6rczZ8OX27JDQX2SAixXM5TJTJug9FhI&e=>
> --with-gnu-as --with-gnu-ld
> Thread model: posix
> gcc version 4.9.2 (Rev5, Built by MSYS2 project)
> COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mtune=generic'
> '-march=x86-64'
> C:/msys2_64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/cc1plus.exe
> -E -quiet -v -iprefix
> C:/msys2_64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/ -D_REENTRANT -
> -mtune=generic -march=x86-64
> # 1 "<stdin>"
> # 1 "<built-in>"
> # 1 "<command-line>"
> # 1 "<stdin>"
> ignoring duplicate directory
> "C:/msys2_64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.9.2/include"
> ignoring nonexistent directory "C:/msys64/mingw64/include"
> ignoring nonexistent directory "/mingw64/include"
> ignoring duplicate directory
> "C:/msys2_64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.9.2/include-fixed"
> ignoring duplicate directory
> "C:/msys2_64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/include"
> ignoring nonexistent directory
> "C:/msys64/mingw64/x86_64-w64-mingw32/include"
> #include "..." search starts here:
> #include <...> search starts here:
> C:/msys2_64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include
>
> C:/msys2_64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../include
> C:/msys2_64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/include-fixed
>
> C:/msys2_64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/include
> C:/msys2_64/mingw64/lib/gcc/../../include/c++/4.9.2
> C:/msys2_64/mingw64/lib/gcc/../../include/c++/4.9.2/x86_64-w64-mingw32
> C:/msys2_64/mingw64/lib/gcc/../../include/c++/4.9.2/backward
>
>
> Built with the older MSYS2 patch ;
> $ clang++ -E -x c++ - -v < /dev/null
> clang version 3.7.0 (http://llvm.org/git/clang.git
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_git_clang.git&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=r3JtGknlg70px5yvRWhv1Zl7r4WNJKqtaJd9HISLW8E&s=pPjfizf2zAebxGKdA0tfJNJMfhG4rOM7lwPnfPMa14Q&e=>
> e7cee814a12b5dd16c8672543fd93efe741d5208) (http://llvm.org/git/llvm.git
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_git_llvm.git&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=r3JtGknlg70px5yvRWhv1Zl7r4WNJKqtaJd9HISLW8E&s=nrLEvIb_FdlnMl1MALmnNd72UDSWQ11U46obfWTKRRA&e=>
> d594ba081506f0f57e9801e3f81467b1766b1e04)
> Target: x86_64-pc-windows-gnu
> Thread model: posix
> "C:\\msys2_64\\mingw64\\bin\\clang++.exe" -cc1 -triple
> x86_64-pc-windows-gnu -E -disable-free -disable-llvm-verifier
> -main-file-name - -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
> -fno-unique-section-names -resource-dir
> "C:\\msys2_64\\mingw64\\bin\\..\\lib\\clang\\3.7.0" -internal-isystem
> "C:\\msys2_64\\mingw64\\bin/../include/c++/4.9.2" -internal-isystem
> "C:\\msys2_64\\mingw64\\bin/../include/c++/4.9.2/x86_64-w64-mingw32"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\bin/../include/c++/4.9.2/backward"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\bin/../x86_64-w64-mingw32/include/c++"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\bin/../x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\bin/../x86_64-w64-mingw32/include/c++/backward"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\bin\\..\\lib\\clang\\3.7.0\\include"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\bin/../x86_64-w64-mingw32/include"
> -internal-isystem "C:\\msys2_64\\mingw64\\bin/../include"
> -fdeprecated-macro -fdebug-compilation-dir "E:\\llvm\\buildmingw64\\bin"
> -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-use-cxa-atexit
> -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
> -o - -x c++ -
> clang -cc1 version 3.7.0 based upon LLVM 3.7.0svn default target
> x86_64-pc-windows-gnu
> ignoring nonexistent directory
> "C:\msys2_64\mingw64\bin/../x86_64-w64-mingw32/include/c++"
> ignoring nonexistent directory
> "C:\msys2_64\mingw64\bin/../x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32"
> ignoring nonexistent directory
> "C:\msys2_64\mingw64\bin/../x86_64-w64-mingw32/include/c++/backward"
> ignoring duplicate directory
> "C:\msys2_64\mingw64\bin\..\lib\clang\3.7.0\include"
> #include "..." search starts here:
> #include <...> search starts here:
> C:\msys2_64\mingw64\bin/../include/c++/4.9.2
> C:\msys2_64\mingw64\bin/../include/c++/4.9.2/x86_64-w64-mingw32
> C:\msys2_64\mingw64\bin/../include/c++/4.9.2/backward
> C:\msys2_64\mingw64\bin\..\lib\clang\3.7.0\include
> C:\msys2_64\mingw64\bin/../x86_64-w64-mingw32/include
> C:\msys2_64\mingw64\bin/../include
> End of search list.
> New Patch
> $ ./clang++ -E -x c++ - -v < /dev/null
> clang version 3.7.0 (http://llvm.org/git/clang.git
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_git_clang.git&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=r3JtGknlg70px5yvRWhv1Zl7r4WNJKqtaJd9HISLW8E&s=pPjfizf2zAebxGKdA0tfJNJMfhG4rOM7lwPnfPMa14Q&e=>
> 0af047c817acbc67e61aa82f0b43a54d61b753f8) (http://llvm.org/git/llvm.git
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_git_llvm.git&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=r3JtGknlg70px5yvRWhv1Zl7r4WNJKqtaJd9HISLW8E&s=nrLEvIb_FdlnMl1MALmnNd72UDSWQ11U46obfWTKRRA&e=>
> 9a9ee6f550c0789053c260203aea8430a34554fe)
> Target: x86_64-pc-windows-gnu
> Thread model: posix
> "E:\\llvm\\buildmingw64\\bin\\clang++.exe" -cc1 -triple
> x86_64-pc-windows-gnu -E -disable-free -disable-llvm-verifier
> -main-file-name - -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 "E:\\llvm\\buildmingw64\\bin\\..\\lib\\clang\\3.7.0"
> -internal-isystem "C:\\msys2_64\\mingw64\\x86_64-w64-mingw32\\include\\c++"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\x86_64-w64-mingw32\\"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\x86_64-w64-mingw32\\include\\c++\\backward"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2\\include\\c++"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2\\include\\c++\\x86_64-w64-mingw32\\"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2\\include\\c++\\backward"
> -internal-isystem
> "E:\\llvm\\buildmingw64\\bin\\..\\lib\\clang\\3.7.0\\include"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2\\include"
> -internal-isystem
> "C:\\msys2_64\\mingw64\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2\\include-fixed"
> -internal-isystem "C:\\msys2_64\\mingw64\\x86_64-w64-mingw32\\include"
> -internal-isystem "C:\\msys2_64\\mingw64\\include" -fdeprecated-macro
> -fdebug-compilation-dir "E:\\llvm\\buildmingw64\\bin" -ferror-limit 19
> -fmessage-length 0 -mstackrealign -fno-use-cxa-atexit -fobjc-runtime=gcc
> -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o - -x c++ -
> clang -cc1 version 3.7.0 based upon LLVM 3.7.0svn default target
> x86_64-pc-windows-gnu
> ignoring nonexistent directory
> "C:\msys2_64\mingw64\x86_64-w64-mingw32\include\c++"
> ignoring nonexistent directory
> "C:\msys2_64\mingw64\x86_64-w64-mingw32\include\c++\x86_64-w64-mingw32\"
> ignoring nonexistent directory
> "C:\msys2_64\mingw64\x86_64-w64-mingw32\include\c++\backward"
> ignoring nonexistent directory
> "C:\msys2_64\mingw64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++"
> ignoring nonexistent directory
> "C:\msys2_64\mingw64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\x86_64-w64-mingw32\"
> ignoring nonexistent directory
> "C:\msys2_64\mingw64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\backward"
> #include "..." search starts here:
> #include <...> search starts here:
> E:\llvm\buildmingw64\bin\..\lib\clang\3.7.0\include
> C:\msys2_64\mingw64\lib\gcc\x86_64-w64-mingw32\4.9.2\include
> C:\msys2_64\mingw64\lib\gcc\x86_64-w64-mingw32\4.9.2\include-fixed
> C:\msys2_64\mingw64\x86_64-w64-mingw32\include
> C:\msys2_64\mingw64\include
> End of search list.
>
> I assume this patch only meant to fix the official mingw-builds?
>
>
> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150704/41fdeddc/attachment.html>
More information about the cfe-dev
mailing list