Commit Graph

10932 Commits (92926c4331f66934498c0b7fdd41b6f83f2b109a)

Author SHA1 Message Date
Tadeo Kondrak bf4bfe54ac
Update compile error test for field access of opaque type 2020-10-06 22:08:30 -06:00
Tadeo Kondrak 6b8ae6fffb
langref: update for opaque {} syntax 2020-10-06 22:08:29 -06:00
Tadeo Kondrak 0a56390230
stage1: use size_t over int as index in resolve_opaque_type 2020-10-06 22:08:28 -06:00
Tadeo Kondrak d71f339395
stage1: disallow fields in opaque types 2020-10-06 22:08:27 -06:00
Tadeo Kondrak d5b8172a82
translate_c: emit opaque {} instead of @Type(.Opaque) 2020-10-06 22:08:26 -06:00
Tadeo Kondrak 2b4b03d301
Update zig files for opaque type syntax 2020-10-06 22:08:25 -06:00
Tadeo Kondrak 069fbb3c01
Add opaque type syntax 2020-10-06 22:08:24 -06:00
Timon Kruiper d6d05fc84d Update the list of libraries that llvm11 uses 2020-10-06 20:07:40 -04:00
Frank Denis fb63a2cfae std/crypto: faster (mod 2^255-19) square root computation
251 squarings, 250 multiplications -> 251 squarings, 11 multiplications
2020-10-06 19:48:26 -04:00
travisstaloch dd4771a5d2
cache-hash: add test_filter and test_name_prefix (#6583) 2020-10-06 19:36:14 -04:00
LemonBoy 87807d53dd stage2: Fix arg processing for zig run
* Stop parsing arguments after `--`
* Calculate the correct index for the first argument after `--`
2020-10-06 19:31:57 -04:00
LemonBoy 1f7ec0de70 Address review comments & fix compilation errors 2020-10-06 11:57:23 +02:00
LemonBoy a419a1aabc Move copy_file to fs namespace
Now it is a private API.
Also handle short writes in copy_file_range fallback implementation.
2020-10-06 09:38:59 +02:00
Vexu 58502b8bfe translate-c: respect C operator precedence in macros 2020-10-05 22:26:11 -04:00
Noah Altunian c507c7862e Fix spelling in code comment
Changed **an handle** -> **a handle**.
2020-10-05 22:25:07 -04:00
Andrew Kelley 41aa5edaaf
Merge pull request #6580 from jedisct1/aesgcm
std/crypto: Add support for AES-GCM
2020-10-05 22:20:29 -04:00
Timon Kruiper 75db8d9e2c Fix cross-compiling the zig compiler
zig0 is only used for building objects, thus it has no options like
`build-exe/obj`. But when cross-compiling, we have a working zig
compiler on the host, thus we need to pass `build-obj` to the zig compiler.
2020-10-05 22:18:42 -04:00
Isaac Freund 0741505d6d std/zig: handle underscore in kernel version
On some distros (e.g. Void Linux) the release field of the tsname
struct may contain an underscore followed by a revision number at the
end. (e.g. 5.8.12_2).
2020-10-05 22:17:28 -04:00
LemonBoy dbc11be038 std: Fix two bugs in bigint pow
* Correctly scan all the exponent bits, this caused the incorrect result
  to be computed for exponents being powers of two.
* Allocate enough limbs to make llmulacc stop whining.
2020-10-05 22:16:26 -04:00
Frank Denis 06c16f44e7 std/crypto: Add support for AES-GCM
Already pretty fast on platforms with AES-NI, even though GHASH
reduction hasn't been optimized yet, and we don't do stitching either.
2020-10-06 00:00:33 +02:00
Frank Denis d343b75e7f ghash & poly1305: fix handling of partial blocks and add pad()
pad() aligns the next input to the first byte of a block, which is
useful to implement the IETF version of ChaCha20Poly1305 and AES-GCM.
2020-10-05 23:50:38 +02:00
Andrew Kelley 7f7e2d608a Revert "revert adding std.event.Loop.runDetached"
This reverts commit 70f3767903.

After discussion, I can see the value provided here, specifically with
avoiding the footgun of defer { suspend { free(@frame()); } }.

However the doc comments are updated to explain the semantics directly,
rather than basing them on the behavior of another programming language.
2020-10-05 14:41:51 -07:00
Andrew Kelley 939b4860ef
Merge pull request #6472 from alexnask/add_some_frees
Add a few missing deallocations of temporaries to stage1
2020-10-05 04:56:58 -04:00
LemonBoy 22b5e47839 stage1: Implement @reduce builtin for vector types
The builtin folds a Vector(N,T) into a scalar T using a specified
operator.

Closes #2698
2020-10-05 04:51:45 -04:00
joachimschmidt557 7c5a24e08c Turn zig fmt back on in various src/ files 2020-10-05 04:48:58 -04:00
Alexandros Naskos 9952a072cc Remove MSVC 2015 from supported compilers in README 2020-10-05 03:55:41 -04:00
Andrew Kelley 55ac973953 fix each-lib-rpath functionality
It was regressed in 2 ways from the merge of #6250:
 * it was not being enabled by default when the target OS is native.
 * we were testing the libfoo.so file path existence with bogus format
   string ('{}' instead of '{s}') and so it ended up being something
   like "libstd.HashMap(K,V,...).Entry.so" instead of "libfoo.so". Using
   {} rather than {s} is a footgun, be careful!

Previous functionality is now restored.

closes #6523
2020-10-04 23:16:46 -07:00
Andrew Kelley d5d48c6f4e
Merge pull request #6496 from xackus/rlimit
std: implement {get, set}rlimit for linux
2020-10-05 01:54:38 -04:00
Andrew Kelley 682a29aefd ci: stop testing mingw builds
Zig supports both Linux and Windows natively. Those are the main use
cases we are focusing on. Happy to accept mingw patches if they are
non-invasive, but we will not be hampering progress on the main use
cases with failing mingw CI builds.
2020-10-04 21:51:41 -07:00
Timon Kruiper e94a06ac29 Build.zig: Skip copying files that are used internally by the compiler
Before this it was trying to copy all the files from the zig-cache dir
to the output dir, but in the current compiler architecture the cache
dir is also used for internal compiler files.
2020-10-05 00:31:21 -04:00
Felix (xq) Queißner dce74c31cc Depending on system libs only enforces libraries to require dynamic linking, but neither static libs nor object files. 2020-10-05 00:27:42 -04:00
Andrew Kelley 33bc1ebe37 build system: implement computeOutFilenames using std.zig.binNameAlloc
See #6552 #6553 #6483

Also fixes a regression introduced in
1d777e9958 of not converting an integer to
a string for a command line parameter.
2020-10-04 20:10:47 -07:00
Jan200101 d0a4110d34 Allow specifying build version using cmake 2020-10-04 21:40:48 -04:00
Alexandros Naskos 65991092f7 Correctly set uid and gid to void instead of null on wasi 2020-10-04 21:21:25 -04:00
Andrew Kelley 1d777e9958 add --image-base support
Based on #6121 by Jay Petacat.
2020-10-04 17:59:44 -07:00
Andrew Kelley da596b7e4f
Merge pull request #6255 from joachimschmidt557/stage2-arm
stage2 ARM: more instructions, return values, parameters
2020-10-04 19:49:18 -04:00
Andrew Kelley 6aa668e020
Merge pull request #6476 from kubkon/macho-exe
Link basic MachO executables with stage2
2020-10-04 19:05:45 -04:00
Andrew Kelley 302a69f127
Merge pull request #6295 from Vexu/stage2
Stage2: basic imports
2020-10-04 18:00:21 -04:00
xackus 1b4296831a simplify api and add smoke test 2020-10-04 23:57:49 +02:00
xackus 4ec26be424 implement {get, set}rlimit for linux 2020-10-04 23:56:10 +02:00
Jakub Konka c4054f8e0a Refactor flushing of MachO exe
This commit refactors free space analysis (and VM analysis) somewhat.
This is still far from perfect, but at least it's not using any
hardcoded values.

This commit also reorganizes different flushing bits here and there,
so that bit common to Exe and Obj are put in the common path, while
Exe-specific are behind an appropriate switch/if statement.
2020-10-04 15:31:47 +02:00
Jakub Konka 737a8bf204 Redo local symbols and offsets tracking to match Elf's approach 2020-10-04 15:31:47 +02:00
Jakub Konka 2ba23abd9d Add missing ensureCapacity call in codegen 2020-10-04 15:31:47 +02:00
Jakub Konka f8dd48bcd2 Fix after rebase and enable stage2 tests for macOS
Also, rewrites codegen section to store symbol address in a register
to then later invoke `callq` on the register.
2020-10-04 15:31:47 +02:00
Jakub Konka 5a7105401c First hacked together, working MachO exe! 2020-10-04 15:31:47 +02:00
Jakub Konka 635984abc7 Move writing symbol table and export trie into functions 2020-10-04 15:31:47 +02:00
Jakub Konka ccf9bba61f Write out LC_DYSYMTAB together with dyld_stub_binder undef symbol 2020-10-04 15:31:47 +02:00
Jakub Konka a927f24201 Generate more MachO exe boilerplate
* Convert draft to generate all relevant segments and sections in right places
* Do not prealloc space in text blocks until we can NOP
* Write out LC_LOAD_DYLINKER command
* Add LC_LOAD_DYLIB command in order to specify to load libSystem
* Redo update decl exports (similar to Elf globals, globals need to be contiguous in
  memory)
2020-10-04 15:31:47 +02:00
Jakub Konka 57a81bb559 Re-draft required elements for minimal MachO binary 2020-10-04 15:31:47 +02:00
Jakub Konka 0e2d858d69 Revert back to original Win CI install script
Since msys2/MSYS2-packages#2050 was fixed, we can now revert back to the
original install script.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-10-04 11:53:07 +02:00