Skip to content

Commit f60a892

Browse files
committed
Add details about MSVCRT and AVX in README.md
UCRT is gradually growing in popularity, and it wasn't obvious from README.md that w64devkit is a traditional MSVCRT toolchain. The AVX issue comes up from time to time, just infrequently enough that I need to rediscover the solution each time. Documentation in README.md will be easier to find next time, warns those who haven't been bitten yet, and documents the mitigation offline. Since it is unlikely to be fixed any time soon, medium term I should figure out a small patch that makes GCC only emit unaligned AVX moves. The penalty for unaligned moves is 0% on newer processors and up to 10% on older ones. That's certainly better than crashing due to a compilier bug. https://lemire.me/blog/2012/05/31/data-alignment-for-speed-myth-or-reality/
1 parent 4176ece commit f60a892

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Portable C, C++, and Fortran Development Kit for x64 and x86 Windows
22

33
[w64devkit][] is a Dockerfile that builds from source a small, portable
4-
development suite for creating C and C++ applications on and for x64
5-
Windows. See "Releases" for pre-built, ready-to-use kits.
4+
development suite for creating C and C++ applications on and for x86 and
5+
x64 Windows. See "Releases" for pre-built, ready-to-use kits.
66

77
Included tools:
88

@@ -13,10 +13,10 @@ Included tools:
1313
* [Vim][vim] : powerful text editor
1414
* [Universal Ctags][ctags] : source navigation
1515

16-
The toolchain includes pthreads, C++11 threads, and OpenMP. All included
17-
runtime components are static. **Docker/Podman is not required to use the
18-
development kit**. It's merely a reliable, clean environment for building
19-
the kit itself.
16+
It is an MSVCRT toolchain with pthreads, C++11 threads, and OpenMP. All
17+
included runtime components are static. **Docker/Podman is not required to
18+
use the development kit**. It's merely a reliable, clean environment for
19+
building the kit itself.
2020

2121
## Build
2222

@@ -60,8 +60,7 @@ Then to start an interactive unix shell:
6060
* Trivial to build from source, meaning it's easy to tweak and adjust any
6161
part of the kit for your own requirements.
6262

63-
* [Complements Go](https://nullprogram.com/blog/2021/06/29/) for cgo and
64-
bootstrapping.
63+
* [Complements Go][go] for cgo and bootstrapping.
6564

6665
## Optimized for size
6766

@@ -166,16 +165,16 @@ encapsulating the entire development environment, with home directory, on
166165
removable, even read-only, media. Use a `.profile` in the home directory
167166
to configure the environment further.
168167

169-
I'd love to include Git, but unfortunately Git's build system doesn't
170-
quite support cross-compilation. A decent alternative would be
171-
[Quilt][quilt], but it's written in Bash and Perl.
172-
173168
Neither Address Sanitizer (ASan) nor Thread Sanitizer (TSan) [has been
174169
ported to Mingw-w64][san] ([also][san2]), but Undefined Behavior Sanitizer
175170
(UBSan) works perfectly under GDB. With both `-fsanitize=undefined` and
176171
`-fsanitize-trap`, GDB will [break precisely][break] on undefined
177172
behavior, and it does not require linking with libsanitizer.
178173

174+
[GCC does not fully support AVX on Windows][avx] and may use aligned moves
175+
on unaligned addresses. When targeting AVX, consider disabling all aligned
176+
moves in the assembler: `-Wa,-muse-unaligned-vector-move`.
177+
179178
## Licenses
180179

181180
When distributing binaries built using w64devkit, your .exe will include
@@ -190,6 +189,7 @@ w64devkit includes the concatenated set of all licenses in the file
190189
binaries.
191190

192191

192+
[avx]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
193193
[bb]: https://frippery.org/busybox/
194194
[break]: https://nullprogram.com/blog/2022/06/26/
195195
[bs]: https://www.rdegges.com/2016/i-dont-give-a-shit-about-licensing/
@@ -213,7 +213,6 @@ binaries.
213213
[lic2]: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-libraries/winpthreads/COPYING
214214
[make]: https://www.gnu.org/software/make/
215215
[names]: https://learn.microsoft.com/en-us/cpp/build/reference/decorated-names
216-
[quilt]: http://savannah.nongnu.org/projects/quilt
217216
[san]: http://mingw-w64.org/doku.php/contribute#sanitizers_asan_tsan_usan
218217
[san2]: https://groups.google.com/forum/#!topic/address-sanitizer/q0e5EBVKZT4
219218
[vim]: https://www.vim.org/

0 commit comments

Comments
 (0)