When building with LLVM, always do -lole32 -lversion -luuid even when
using the cmake-provided build stuff. Otherwise we get undefined symbols
when linking.
- C compilation flows didn't hold an exclusive lock on the cache manifest file when writing to it in all cases
- On windows, explicitly unlock the file lock before closing it
There are still a few occurrences of "stage1" in the standard library
and self-hosted compiler source, however, these instances need a bit
more careful inspection to ensure no breakage.
When testing with
```
stage4/bin/zig test ../test/behavior.zig -I../test -ofmt=c -target x86_64-windows
```
previously, one would see this message:
```
error: lld-link: subsystem must be defined
```
Now, `--subsystem console` as well as `-lntdll -lkernel32` are on the
`zig run` line, producing a binary.
This commit adds a 637 KB binary file to the source repository. This
commit does nothing else, so it should be replaced with a different
commit before this branch is merged to avoid bloating the git
repository.
On windows we get:
lld-link: error: undefined symbol: __stack_chk_fail
>>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(main)
>>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(main_main)
>>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(log_scoped_28_default_29_err__anon_2764)
>>> referenced 36192 more times
lld-link: error: undefined symbol: __stack_chk_guard
>>> referenced by CMakeFiles/zig2.dir/zig2.c.obj:(.refptr.__stack_chk_guard)
>>> referenced by CMakeFiles/zig2.dir/compiler_rt.c.obj
I messed up the spelling of '-stack_size' making it '-stack' instead.
Will need to fix on master branch. But let's test this here before
making another master branch commit.
In particular, these two changes are relevant:
* zig cc: support -stack in addition to --stack for linker arg
- Fixes stack overflow when running zig2 on aarch64-macos.
* compiler_rt: avoid using weak aliases
- Fixes duplicate symbol when linking zig2 on aarch64-linux.
In the CI system, I copied the old tarball and then applied
05c21a26cb2d5daf06191bd996d0770192704b66 to its compiler_rt
implementation.
After this is verified we can drop this commit and regenerate the
tarballs from a master branch commit.