tinygo-site icon indicating copy to clipboard operation
tinygo-site copied to clipboard

Unable to build with mingw 10.2.0

Open sago35 opened this issue 4 years ago • 6 comments
trafficstars

mingw 10.2.0 has been released on 2021/01/12. However, the included gcc 10.2 was not able to build tinyg 0.16 and dev branch. https://chocolatey.org/packages/mingw#versionhistory

I was able to build it by installing 8.1.0.

choco install mingw -Version 8.1.0
  or
choco install mingw -Version 8.1.0 --allow-downgrade

I'm using windows 10, and I'm building according to the following page https://tinygo.org/getting-started/windows/

sago35 avatar Jan 27 '21 12:01 sago35

What is the error that you are getting with MinGW 10?

aykevl avatar Jan 27 '21 22:01 aykevl

The log is below.

https://gist.github.com/sago35/8cabacb874cf49cff36946c62f229e35

sago35 avatar Jan 28 '21 04:01 sago35

It looks like MinGW 10 doesn't support std::mutex. I'm not sure how to get it supported again, as LLVM relies on an up-to-date and fully supported compiler. Maybe some additional build flag is needed?

aykevl avatar Feb 01 '21 16:02 aykevl

This is an error in the latest mingw-w64 package for chocolatey.

See https://chocolatey.org/packages/mingw#comment-5223930374

We should tell people to specifically install 8.1.0

deadprogram avatar Feb 02 '21 00:02 deadprogram

@deadprogram glad we're not the only ones!

Unfortunately we currently depend on MinGW, MSVC is unsupported by the Go toolchain: https://github.com/golang/go/issues/20982

aykevl avatar Feb 02 '21 08:02 aykevl

Now we can build with the version available with choco install mingw. The following version was installed when I tried it now. And I was able to build correctly (make llvm-build CCACHE=OFF).

mingw 11.2.0.07112021 (gcc 11.2.0)

sago35 avatar Sep 17 '22 06:09 sago35