[vim/vim] Add support for using mingw64 clang on MS-Windows to build Vim (PR #10557)

134 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Jun 11, 2022, 2:49:24 PM6/11/22
to vim/vim, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/10557

Commit Summary

  • c5b8aa5 Add support for using mingw64 clang on MS-Windows to build Vim

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557@github.com>

codecov[bot]

unread,
Jun 11, 2022, 3:00:13 PM6/11/22
to vim/vim, Subscribed

Codecov Report

Merging #10557 (c5b8aa5) into master (a34b446) will decrease coverage by 4.79%.
The diff coverage is n/a.

@@            Coverage Diff             @@

##           master   #10557      +/-   ##

==========================================

- Coverage   81.68%   76.88%   -4.80%     

==========================================

  Files         158      148      -10     

  Lines      185318   146696   -38622     

  Branches    41908    38300    -3608     

==========================================

- Hits       151368   112786   -38582     

- Misses      21500    22216     +716     

+ Partials    12450    11694     -756     
Flag Coverage Δ
huge-clang-none ?
linux ?
mingw-x64-HUGE 0.00% <ø> (ø)
mingw-x64-HUGE-gui 78.10% <ø> (+<0.01%) ⬆️
windows 76.88% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/xdiff/xpatience.c 0.00% <0.00%> (-81.99%) ⬇️
src/xdiff/xhistogram.c 0.00% <0.00%> (-72.42%) ⬇️
src/hardcopy.c 10.87% <0.00%> (-66.40%) ⬇️
src/if_cscope.c 4.88% <0.00%> (-63.78%) ⬇️
src/beval.c 1.62% <0.00%> (-60.97%) ⬇️
src/libvterm/src/mouse.c 0.00% <0.00%> (-41.94%) ⬇️
src/debugger.c 49.39% <0.00%> (-40.38%) ⬇️
src/sound.c 28.26% <0.00%> (-36.11%) ⬇️
src/mouse.c 47.86% <0.00%> (-31.16%) ⬇️
src/libvterm/src/keyboard.c 15.58% <0.00%> (-26.81%) ⬇️
... and 138 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a34b446...c5b8aa5. Read the comment docs.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/c1152982103@github.com>

Bram Moolenaar

unread,
Jun 11, 2022, 5:36:43 PM6/11/22
to vim/vim, Subscribed

any comments?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/c1153001722@github.com>

Yegappan Lakshmanan

unread,
Jun 11, 2022, 6:15:22 PM6/11/22
to vim/vim, Push

@yegappan pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/push/10135989964@github.com>

Yegappan Lakshmanan

unread,
Jun 12, 2022, 12:11:55 AM6/12/22
to vim/vim, Push

@yegappan pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/push/10136889979@github.com>

Yegappan Lakshmanan

unread,
Jun 12, 2022, 10:15:45 PM6/12/22
to vim/vim, Push

@yegappan pushed 1 commit.

  • 69713a9 Add support for using mingw64 clang on MS-Windows to build Vim

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/push/10141601389@github.com>

Yegappan Lakshmanan

unread,
Jun 12, 2022, 10:16:06 PM6/12/22
to vim/vim, Push

@yegappan pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/push/10141603243@github.com>

K.Takata

unread,
Jun 12, 2022, 10:52:52 PM6/12/22
to vim/vim, Subscribed

Recent MSYS2 provides two types of Clang compilers:

  1. Installed in the /mingw{64,32}/bin directory. Usable via the C:\msys64\mingw{64,32}.exe shell. (In my understanding,) ASAN is not available.
    Packages: mingw-w64-{x86_64,i686}-clang, etc.
  2. Installed in the /clang{64,32}/bin directory. Usable via the C:\msys64\clang{64,32}.exe shell. ASAN is available.
    Packages: mingw-w64-clang-{x86_64,i686}-clang, etc.

See https://www.msys2.org/docs/environments/ for detail.

If one wants to use clang on MSYS2, the CLANG{64,32} environments might be better.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/c1153405807@github.com>

K.Takata

unread,
Jun 12, 2022, 10:56:46 PM6/12/22
to vim/vim, Subscribed

@k-takata commented on this pull request.


In src/INSTALLpc.txt:

> @@ -282,6 +282,27 @@ This command is in msys32.bat.  Or for the 64 bit compiler use msys64.bat:
 If you have msys64 in another location you will need to adjust the paths for
 that.
 
+2.5. Build Vim with Clang
+
+The following package group is required for building Vim with Clang:
+
+* mingw-w64-x86_64-clang
+
+Use the following command to install it:
+
+    $ pacman -S mingw-w64-x86_64-clang
+
+Go to the source directory of Vim, then execute the make command.  E.g.:
+
+    CC=clang

Isn't CXX=clang++ needed when OLE or DIRECTX is set to yes?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/review/1003736861@github.com>

Yegappan Lakshmanan

unread,
Jun 12, 2022, 11:46:36 PM6/12/22
to vim_dev, reply+ACY5DGEWGRJWDYZUD5...@reply.github.com, vim/vim, Subscribed
Hi,

On Sun, Jun 12, 2022 at 7:52 PM K.Takata <vim-dev...@256bit.org> wrote:

Recent MSYS2 provides two types of Clang compilers:

  1. Installed in the /mingw{64,32}/bin directory. Usable via the C:\msys64\mingw{64,32}.exe shell. (In my understanding,) ASAN is not available.
    Packages: mingw-w64-{x86_64,i686}-clang, etc.

I have used the clang installed in the \mingw64\bin directory to build Vim (from the command-line shell and not
from the msys2 environment).  I am able to build Vim with ASAN with this compiler.
 
  1. Installed in the /clang{64,32}/bin directory. Usable via the C:\msys64\clang{64,32}.exe shell. ASAN is available.
    Packages: mingw-w64-clang-{x86_64,i686}-clang, etc.

See https://www.msys2.org/docs/environments/ for detail.

If one wants to use clang on MSYS2, the CLANG{64,32} environments might be better.



I am also able to build Vim with the MSYS2 CLANG64 environment.

Regards,
Yegappan
 

vim-dev ML

unread,
Jun 12, 2022, 11:46:52 PM6/12/22
to vim/vim, vim-dev ML, Your activity

Hi,


On Sun, Jun 12, 2022 at 7:52 PM K.Takata ***@***.***> wrote:

> Recent MSYS2 provides two types of Clang compilers:
>
> 1. Installed in the /mingw{64,32}/bin directory. Usable via the
> C:\msys64\mingw{64,32}.exe shell. (In my understanding,) ASAN is *not*

> available.
> Packages: mingw-w64-{x86_64,i686}-clang, etc.
>
>
I have used the clang installed in the \mingw64\bin directory to build Vim
(from the command-line shell and not
from the msys2 environment). I am able to build Vim with ASAN with this
compiler.


>
> 1. Installed in the /clang{64,32}/bin directory. Usable via the

> C:\msys64\clang{64,32}.exe shell. ASAN is available.
> Packages: mingw-w64-clang-{x86_64,i686}-clang, etc.
>
> See https://www.msys2.org/docs/environments/ for detail.
>
> If one wants to use clang on MSYS2, the CLANG{64,32} environments might be
> better.
>
>
>
I am also able to build Vim with the MSYS2 CLANG64 environment.

Regards,
Yegappan


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/c1153432592@github.com>

Yegappan Lakshmanan

unread,
Jun 12, 2022, 11:49:47 PM6/12/22
to vim/vim, vim-dev ML, Push

@yegappan pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/push/10142021710@github.com>

Yegappan Lakshmanan

unread,
Jun 12, 2022, 11:50:42 PM6/12/22
to vim_dev, reply+ACY5DGH4GRVGRHG3X3...@reply.github.com, vim/vim, Subscribed
Hi,

On Sun, Jun 12, 2022 at 7:56 PM K.Takata <vim-dev...@256bit.org> wrote:
>
> @k-takata commented on this pull request.
>
> ________________________________
>
> In src/INSTALLpc.txt:
>
> > @@ -282,6 +282,27 @@ This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat:
> If you have msys64 in another location you will need to adjust the paths for
> that.
>
> +2.5. Build Vim with Clang
> +
> +The following package group is required for building Vim with Clang:
> +
> +* mingw-w64-x86_64-clang
> +
> +Use the following command to install it:
> +
> + $ pacman -S mingw-w64-x86_64-clang
> +
> +Go to the source directory of Vim, then execute the make command. E.g.:
> +
> + CC=clang
>
> Isn't CXX=clang++ needed when OLE or DIRECTX is set to yes?
>

Yes. I have updated the PR.

Thanks,
Yegappan

vim-dev ML

unread,
Jun 12, 2022, 11:51:00 PM6/12/22
to vim/vim, vim-dev ML, Your activity

Hi,


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/c1153434050@github.com>

K.Takata

unread,
Jun 13, 2022, 12:03:55 AM6/13/22
to vim/vim, vim-dev ML, Comment

I am able to build Vim with ASAN with this
compiler.

That is nice. When I asked the msys2 team last year, ASAN was available only on the clang{64,32} environment:
msys2/MINGW-packages#8476


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/10557/c1153438702@github.com>

K.Takata

unread,
Jun 13, 2022, 1:12:57 AM6/13/22
to vim/vim, vim-dev ML, Comment

Hmm, I couldn't build with the MINGW64 version of clang:

$ clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer example_UseAfterFree.cc
C:/msys64/mingw64/bin/ld: cannot find C:/msys64/mingw64/lib/clang/14.0.4/lib/windows/libclang_rt.asan_dynamic-x86_64.dll.a: No such file or directory
C:/msys64/mingw64/bin/ld: cannot find C:/msys64/mingw64/lib/clang/14.0.4/lib/windows/libclang_rt.asan_dynamic_runtime_thunk-x86_64.a: No such file or directory
C:/msys64/mingw64/bin/ld: cannot find C:/msys64/mingw64/lib/clang/14.0.4/lib/windows/libclang_rt.asan_dynamic_runtime_thunk-x86_64.a: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

example_UseAfterFree.cc is coming from the official document of clang:
https://clang.llvm.org/docs/AddressSanitizer.html


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/10557/c1153480065@github.com>

Yegappan Lakshmanan

unread,
Jun 13, 2022, 10:42:26 AM6/13/22
to vim/vim, vim-dev ML, Push

@yegappan pushed 1 commit.

  • 00b664a Update help to mention the correct ming64 clang package

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/push/10147418028@github.com>

Yegappan Lakshmanan

unread,
Jun 13, 2022, 10:47:47 AM6/13/22
to vim_dev, reply+ACY5DGC2RAQBNOCQAY...@reply.github.com, vim/vim, vim-dev ML, Comment
Hi,

On Sun, Jun 12, 2022 at 10:12 PM K.Takata <vim-dev...@256bit.org> wrote:

Hmm, I couldn't build with the MINGW64 version of clang:

$ clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer example_UseAfterFree.cc
C:/msys64/mingw64/bin/ld: cannot find C:/msys64/mingw64/lib/clang/14.0.4/lib/windows/libclang_rt.asan_dynamic-x86_64.dll.a: No such file or directory
C:/msys64/mingw64/bin/ld: cannot find C:/msys64/mingw64/lib/clang/14.0.4/lib/windows/libclang_rt.asan_dynamic_runtime_thunk-x86_64.a: No such file or directory
C:/msys64/mingw64/bin/ld: cannot find C:/msys64/mingw64/lib/clang/14.0.4/lib/windows/libclang_rt.asan_dynamic_runtime_thunk-x86_64.a: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

example_UseAfterFree.cc is coming from the official document of clang:
https://clang.llvm.org/docs/AddressSanitizer.html


You are correct. I don't know how it worked for me before. I uninstalled and
reinstalled all the Mingw clang packages and tried to build Vim again and
couldn't build with ASAN.  But I am able to build Vim with ASAN using the
mingw-w64-clang-{x86_64,i686}-clang package. I have updated the help to
reflect this.

Regards,
Yegappan
 

Bram Moolenaar

unread,
Jun 14, 2022, 7:30:55 AM6/14/22
to vim/vim, vim-dev ML, Comment

Closed #10557 via 1630bd9.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/10557/issue_event/6803493061@github.com>

vim-dev ML

unread,
Oct 11, 2022, 4:59:26 AM10/11/22
to vim/vim, vim-dev ML, Your activity

Hi,


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10557/c1274349230@github.com>

Reply all
Reply to author
Forward
0 new messages