Latest status of cl.exe support for cgo build on Windows

128 views
Skip to first unread message

Makoto Shimazu

unread,
Sep 13, 2021, 7:35:22 PM9/13/21
to golang-nuts
Hi members,

I'm now configuring CircleCI to build our tools on Windows, and trying to use cl.exe for it because CircleCI's Windows image has Visual Studio out of the box.
However, it didn't work well so far because the command line flags passed to cl.exe doesn't seem to be for cl.exe.
Here's the error I got:

```
# runtime/cgo
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30133 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl : Command line error D8021 : invalid numeric argument '/Werror'
make: *** [Makefile:15: build-windows-amd64] Error 2
```

I found a few related CLs to support cl.exe that are still in review:
https://go-review.googlesource.com/c/go/+/133946/
but it seems to be stopped.

Can I ask experts here about the latest status of supporting cl.exe, or any tips?

Thanks!
Makoto

Ian Lance Taylor

unread,
Sep 13, 2021, 8:37:35 PM9/13/21
to Makoto Shimazu, golang-nuts
I think you have correctly identified the status: there was some work
to support it, but it was never completed.

Ian

Makoto Shimazu

unread,
Sep 14, 2021, 4:01:13 AM9/14/21
to Ian Lance Taylor, golang-nuts
Hi Ian,

I see, thanks for your quick response!
I'm going to use gcc by installing mingw through chocolatey instead.

Makoto

2021年9月14日(火) 9:37 Ian Lance Taylor <ia...@golang.org>:
Reply all
Reply to author
Forward
0 new messages