[cfe-dev] Failure building x86_64-w64-mingw32 triplet of clang on Windows

NAKAMURA Takumi via cfe-dev cfe-dev at lists.llvm.org
Tue Jun 14 05:21:17 PDT 2016


I guess you are building on msys2 with external mingw-w64.
CMake picks up msys2's libxml2, I guess.

Could you try overriding CMake and reconfigure?
-DCMAKE_LIBRARY_PATH="C:/mingw-w64/x86_64-4.9.3-posix-seh-rt_v4-rev1/ming
w64/x86_64-w64-mingw32/lib"

On Tue, Jun 14, 2016 at 11:48 AM Edward Diener via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> On 6/13/2016 8:58 PM, Saleem Abdulrasool via cfe-dev wrote:
> > On Sun, Jun 12, 2016 at 7:51 AM, Edward Diener via cfe-dev
> > <cfe-dev at lists.llvm.org
> > <mailto:cfe-dev at lists.llvm.org>> wrote:
> >
> >     I was successful building a 32-bit version clang from source on
> >     Windows using gcc-5.3. When I try to build a 64-bit version of clang
> >     on Windows with the triplet x86_64-w64-mingw32 and the 64-bit
> >     version of gcc-5.3 I get as an error:
> >
> >         [482/563] Linking CXX executable bin\c-index-test.exe
> >         FAILED: bin/c-index-test.exe
> >         cmd.exe /C "cd . &&
> >         C:\utilities\mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0\min
> >         gw64\bin\c++.exe  -Wall -W -Wno-unused-parameter -Wwrite-strings
> >         -Wcast-qual -Wn
> >         o-missing-field-initializers -pedantic -Wno-long-long
> >         -Wno-maybe-uninitialized -
> >         Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time
> >         -std=gnu++11 -fno-common
> >          -Woverloaded-virtual -fno-strict-aliasing  -O2
> >          tools/clang/tools/c-index-test
> >         /CMakeFiles/c-index-test.dir/c-index-test.c.obj
> >         tools/clang/tools/c-index-test/C
> >         MakeFiles/c-index-test.dir/core_main.cpp.obj  -o
> >         bin\c-index-test.exe -Wl,--out-
> >         implib,lib\libc-index-test.dll.a
> >         -Wl,--major-image-version,0,--minor-image-versi
> >         on,0  lib/libLLVMSupport.a lib/liblibclang.dll.a
> >         lib/libclangAST.a lib/libclangB
> >         asic.a lib/libclangFrontend.a lib/libclangIndex.a
> >         C:/utilities/libxml/lib/libxml
> >         2.lib lib/libclangFrontend.a lib/libclangDriver.a -lversion
> >         lib/libclangParse.a
> >         lib/libLLVMMCParser.a lib/libclangSerialization.a
> >         lib/libclangSema.a lib/libclan
> >         gEdit.a lib/libclangAnalysis.a lib/libLLVMBitReader.a
> >         lib/libLLVMOption.a lib/li
> >         bLLVMProfileData.a lib/libclangFormat.a
> >         lib/libclangToolingCore.a lib/libclangAS
> >         T.a lib/libclangRewrite.a lib/libclangLex.a lib/libclangBasic.a
> >         lib/libLLVMCore.
> >         a lib/libLLVMMC.a lib/libLLVMSupport.a -lpsapi -lshell32 -lole32
> >         -luuid -lkernel
> >         32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
> >         -luuid -lcomdlg32 -l
> >         advapi32 && cd ."
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x3066): undefined reference to
> >         `xmlRelaxNGNewParserCtxt'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x307a): undefined reference to
> >         `xmlRelaxNGParse'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x3085): undefined reference to `xmlParseDoc'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x3099): undefined reference to
> >         `xmlRelaxNGNewValidCtxt'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x30a7): undefined reference to
> >         `xmlRelaxNGValidateDoc'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x30bb): undefined reference to
> >         `xmlGetLastError'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x30d3): undefined reference to
> >         `xmlRelaxNGFreeValidCtxt'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x30db): undefined reference to `xmlFreeDoc'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x30e3): undefined reference to
> `xmlRelaxNGFree'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x30eb): undefined reference to
> >         `xmlRelaxNGFreeParserCtxt'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text+0x3452): undefined reference to
> >         `xmlGetLastError'
> >
>  tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/c-index-test.c.obj:c-
> >         index-test.c:(.text.startup+0x23): undefined reference to
> >         `xmlCheckVersion'
> >         collect2.exe: error: ld returned 1 exit status
> >
> >
> >     Anyone know what I have to do to correct this problem ?
> >
> >
> > You are failing to link against libxml2.  I don't have any idea why that
> > would be the case.  I would recommend that you look at the cake output
> > and see if it failed to find the 64-bit version of libxml2 on your
> > installation.
>
> Why is llvm/clang looking for libxml2 ? It's not a part of the
> mingw-64/gcc compiler being used to build llvm/clang.
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160614/923ad0dc/attachment.html>


More information about the cfe-dev mailing list