8660 Commits

Author SHA1 Message Date
LeRoyce Pearson
772bb1ade3 Disable open flock flags on darwin
The tests were put into a deadlock, and it seems that darwin doesn't
support `O_SYNC`, though it supports `O_NONBLOCK`. It shouldn't block
even with that, but I'm not sure why else it would fail.
2020-04-08 16:38:58 -06:00
LeRoyce Pearson
d0d7895d33 Return error from else
That removes the other switch cases (`error.WouldBlock` here) from the
error set, I think.
2020-04-08 08:37:17 -06:00
LeRoyce Pearson
45d6fb9e36 Catch error.WouldBlock as unreachable 2020-04-08 00:39:17 -06:00
LeRoyce Pearson
858aefac7f Add OpenFileW share_access_nonblocking parameter 2020-04-07 21:26:46 -06:00
LeRoyce Pearson
317f06dc77 Add lock_nonblocking flag for creating or opening files
Also, make windows share delete access. Rationale: this is how it works
on Unix systems, mostly because locks are (usually) advisory on Unix.
2020-04-07 18:00:12 -06:00
LeRoyce Pearson
117d15ed7a Fix file locking on windows
The share_access bitfield was being ORed with what was supposed to be
parts of the default value, meaning that the share_access would be
more permissive than expected.
2020-04-07 16:49:37 -06:00
LeRoyce Pearson
71c5aab3e7 Make lock option an enum
For some reason, this breaks file locking on windows. Not sure if this is
a problem with wine.
2020-04-07 16:49:30 -06:00
LeRoyce Pearson
28d71c97d1 Fix compile error on darwin 2020-04-06 23:19:39 -06:00
LeRoyce Pearson
20597c8596 Only call os.flock on systems that lack openat locks 2020-04-06 22:28:43 -06:00
LeRoyce Pearson
49886d2e45 Remove return value from os.flock() 2020-04-06 22:07:27 -06:00
LeRoyce Pearson
798207ec80 Merge branch 'master' into feature-file-locks 2020-04-06 21:51:57 -06:00
Andrew Kelley
ab05766674
Merge pull request #4966 from ziglang/bootstrap-windows
cmake: improvements to cross-compiling for Windows
2020-04-06 23:16:31 -04:00
Andrew Kelley
fc662ddd54
mingw-w64: add 32-bit version.def
fixes -lversion on 32-bit windows builds
2020-04-06 20:31:00 -04:00
Andrew Kelley
41cb49eb58
stage1 fixes to support building with 32-bit mingw-w64 2020-04-06 20:30:34 -04:00
Andrew Kelley
9ed00b3829
provide ___mb_cur_max_func for i386-windows-gnu 2020-04-06 19:26:31 -04:00
Andrew Kelley
64d0960244
zig cc: recognize a few more linker options
* `--major-image-version`
 * `--minor-image-version`
 * `--stack`
2020-04-06 19:13:36 -04:00
Andrew Kelley
15ab61b2a0
cmake: improvements to cross-compiling for Windows
* don't unconditionally pass -lz3 for mingw builds. If mingw builds
   require this then the llvm-config executable should put it as part of
   --system-libs. If there is a bug and it does not do that, and we need
   a workaround, then the workaround should be an explicit cmake option.
 * don't link libstage2.a against -lntdll. This causes zig to set
   `builtin.link_mode == .Dynamic` and include the TLS definitions,
   which then collide with the mingw-w64 symbols. This should probably
   be addressed separately, but for now this solves the problem and
   there is no reason to link a static library against a DLL.
 * Findllvm.cmake no longer treats the libraries as "optional" and will
   emit a cmake error if one is not found. Additionally, the
   not-required LLVM library LLVMTableGen is omitted.
2020-04-06 18:38:09 -04:00
Andrew Kelley
afa24ccd99 fix the build on Windows
Workaround for issue #2668

Zig std lib currently does not allow forward slashes in Windows path
names.
2020-04-06 18:35:49 -04:00
LemonBoy
a59d31bd28 ir: Support tuple multiplication 2020-04-06 14:03:43 -04:00
Andrew Kelley
e4eb817f79
libc_installation.zig: don't special-case based on C ABI
Whether the C ABI is mingw-w64 or msvc, detection of native libc paths
should be the same. In the future we may want to allow passing a C ABI
parameter to detectNativeCPaths() but for now we have the same behavior
regardless.
2020-04-06 13:33:32 -04:00
Andrew Kelley
96ed544665
build.zig supports specifying config.h location explicitly
also it does not try to run llvm-config executable when -Dlib-files-only

This fixes cross-compiling using the bootstrap repository.
2020-04-06 13:07:19 -04:00
LemonBoy
a0b73c9f02 compiler-rt: Separate max size allowed for load/store and CAS
The v6m ISA has no way to express a CAS loop natively without turning
off the interrupts or using the kernel cmpxchg harness.

On such a platform the user has to provide a few __sync_* builtins to
satisfy the linker.
2020-04-06 12:52:53 -04:00
Vexu
c5ced0d74a
Merge pull request #4939 from SuperAuguste/master
translate-c: Properly translate C multicharacter literals
2020-04-06 10:31:17 +03:00
Andrew Kelley
701c03d083 zig uses mingw-w64 to provide -lpsapi 2020-04-05 23:06:47 -04:00
Andrew Kelley
28d9696617 use mingw-w64 to provide -luuid if requested 2020-04-05 23:06:47 -04:00
SuperAuguste
6106cf4419 fixes 2020-04-05 19:06:43 -04:00
Benjamin Feng
cb98984ae6 Generate clearer size mismatch error message 2020-04-05 18:38:19 -04:00
Andrew Kelley
05b587fcde
Merge branch 'LemonBoy-vec-div'
closes #4737
2020-04-05 18:34:47 -04:00
Andrew Kelley
e84b9b70ff
annotate disabled tests with github issue links 2020-04-05 18:34:32 -04:00
Andrew Kelley
5597b11a52
add runtime safety tests for SIMD integer division 2020-04-05 18:34:31 -04:00
LemonBoy
f6cdc94a50
ir: Fix error checking for vector ops
The extra logic that's needed was lost during a refactoring, now it
should be fine.
2020-04-05 18:34:31 -04:00
LemonBoy
0f964e1910
I'm getting tired of this shit LLVM 2020-04-05 18:34:31 -04:00
LemonBoy
91a8e3b47b
tests: Chop away some flaky tests 2020-04-05 18:34:31 -04:00
LemonBoy
fe77c38247
ir: Remove unused and commented out code 2020-04-05 18:34:31 -04:00
LemonBoy
eff7555d5d
std: Delete a hack in the feature set code
Now that bitwise not works on vectors we can simplify the code.
2020-04-05 18:34:31 -04:00
LemonBoy
d2d97e55cc
ir: Support shift left/right on vectors 2020-04-05 18:34:31 -04:00
LemonBoy
2485f30046
ir: Support bitwise not on vectors 2020-04-05 18:34:31 -04:00
LemonBoy
54ffcf95a8
ir: Support div/mod/rem on vector types
Closes #4050
2020-04-05 18:34:31 -04:00
Andrew Kelley
e2dc63644a
type_has_one_possible_value takes comptime struct fields into account
Before, type_has_one_possible_value would return false for the value
`.{1}`. But actually, that type is a tuple with a single comptime field.
Such a type, in fact, has one possible value.

This plus the corresponding adjustment to get_the_one_possible_value
solves #3878.
2020-04-05 17:09:01 -04:00
Vexu
6ef15fc8d0
Merge pull request #4901 from phase/feature/translate-c-remassign
translate-c: RemAssign and DivAssign
2020-04-05 21:05:18 +03:00
Andrew Kelley
607b2661a0
Merge pull request #4942 from daurnimator/tidy-atomics
Tidy up compiler_rt/atomics
2020-04-05 11:13:31 -04:00
daurnimator
4daec63aea .gitattributes: deps/SoftFloat-3e/*.txt lines are crlf terminated 2020-04-05 11:03:31 -04:00
daurnimator
d4d2180148 Convert .gitattributes to use unix line endings 2020-04-05 11:03:31 -04:00
Michaël Larouche
c4a5f519f2 Do not parse native_libc.txt anymore when linking on native target, always run detection of libc.
Fixes #4772
2020-04-05 11:01:35 -04:00
Jadon Fowler
ae376e0758 translate-c: remove unneeded semicolon
Signed-off-by: Jadon Fowler <j@jadon.io>
2020-04-05 10:44:42 -04:00
daurnimator
e9e43ed0d3
compiler_rt/atomics: be consistent with const value 2020-04-05 14:08:25 +10:00
daurnimator
f947444362
Tidy up compiler_rt/atomics 2020-04-05 14:06:12 +10:00
SuperAuguste
027e2a1673 fix multichar literals in translate_c 2020-04-04 17:56:25 -04:00
xackus
cd20e0cc67 rename mem.separate to mem.split 2020-04-04 17:37:51 -04:00
Andrew Kelley
e5d479b06e detect an endless loop when trying to detect native libc installation
closes #4810
2020-04-04 15:03:22 -04:00