10235 Commits

Author SHA1 Message Date
Jakub Konka
43b6d0e4b1
Add (empty) __TEXT segment load command
Also, link against `libSystem` by default when targeting macOS.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-24 21:18:27 +02:00
Jakub Konka
9745e7b512 Clean up draft for merging into upstream
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-24 17:59:44 +02:00
Jakub Konka
1698e6d7a7 Link against libSystem when generating Mach-O exe
This is required when generating an exe on macOS.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-24 17:59:44 +02:00
Jakub Konka
2516db9645 Specify path to dyld in Mach-O
This is required since an exec on macOS always has to link against
libSystem.dylib.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-24 17:59:44 +02:00
Vexu
c1ee9efb7c
fix error note using invalid source node
Closes #6153
2020-08-24 15:24:00 +03:00
Vexu
9589dc4c95 add error checks to @Type 2020-08-24 11:13:43 +03:00
Andrew Kelley
4d7013f7d3
Merge pull request #6146 from daurnimator/no_ctty
Use O_NOCTTY open flag
2020-08-23 23:26:58 -04:00
Andrew Kelley
385786eedc
Merge pull request #6097 from joachimschmidt557/stage2-arm
Start working on stage2 ARM backend
2020-08-23 23:07:23 -04:00
LiterallyVoid
4bbea3422a Fix unused argument error when formatting std.Target 2020-08-23 22:47:57 -04:00
Andrew Kelley
bb9c3118ed
Merge pull request #6137 from Jan200101/update/glibc-2.32
Update to glibc 2.32
2020-08-23 22:47:13 -04:00
Luna
7015d84e0c remove licensing comments from init-exe/init-lib 2020-08-23 22:45:18 -04:00
joachimschmidt557
4f2618e75b stage2: Add Hello World test for ARM backend 2020-08-23 23:13:41 +02:00
joachimschmidt557
b2254023e4 stage2: Implement setReg, call, ret, asm for ARM
These changes enable a Hello World example. However, all implemented
codegen is not yet feature-complete.

- asm only supports 'svc #0' at the moment
- call only supports leaf functions at the moment
- setReg uses a naive method at the moment
2020-08-23 22:33:47 +02:00
joachimschmidt557
1c53c07053 stage2: Implement genBreakpoint for ARM 2020-08-23 22:29:00 +02:00
joachimschmidt557
f31cee5393 Start working on stage2 ARM backend
- add codegen/arm.zig with some basic functionality (load/store,
  data processing, branching, software interrupts)
2020-08-23 22:27:46 +02:00
daurnimator
129d3e274d
std: use O_NOCTTY flag 2020-08-24 02:28:31 +10:00
daurnimator
23a81b4396
std: refactor fs.openFileZ flag handling 2020-08-24 02:27:26 +10:00
Jan200101
53a2431713
update glibc abi list for 2.32 2020-08-22 22:43:01 +02:00
Jan200101
c61ea4cdb7
update glibc headers to 2.32 2020-08-22 22:42:58 +02:00
Andrew Kelley
4e63cae369 Merge branch 'pixelherodev-spu_ii'
closes #6096
2020-08-22 13:38:54 -07:00
Andrew Kelley
54f3b0a560 stage2: clean up SPU Mk II code
* move SPU code from std to self hosted compiler
 * change std lib comments to be descriptive rather than prescriptive
 * avoid usingnamespace
 * fix case style of error codes
 * remove duplication of producer_string
 * generalize handling of less than 64 bit arch pointers
 * clean up SPU II related test harness code
2020-08-22 13:36:08 -07:00
Noam Preil
24efbf5ddf Codegen: Move REX assert to comptime 2020-08-22 12:45:29 -07:00
Noam Preil
ad9df43e49 Tests: limit SPU-II cycle count 2020-08-22 12:45:29 -07:00
Noam Preil
f448b518f8 SPU-II: use undefined1 as breakpoint 2020-08-22 12:45:29 -07:00
Noam Preil
222e23c678 Linker: make defaults read-only 2020-08-22 12:45:29 -07:00
Noam Preil
096c5d5e4b Tests: implement SPU-II harness 2020-08-22 12:45:29 -07:00
Noam Preil
fa1d18a155 Linker: fix GOT production on 16-bit targets 2020-08-22 12:45:29 -07:00
Noam Preil
f2796239ba SPU-II: Fix logging in interp, remove JIT-compat code 2020-08-22 12:45:29 -07:00
Noam Preil
3a9af0c88b SPU-II: Ignore @breakpoint for now 2020-08-22 12:45:29 -07:00
Noam Preil
f2fef240a1 SPU-II: Test harness skeleton 2020-08-22 12:45:29 -07:00
Noam Preil
f18636fa58 SPU-II: Add common definitions 2020-08-22 12:45:29 -07:00
Noam Preil
8c321f0cf5 SPU-II: Fix linking 2020-08-22 12:45:29 -07:00
Noam Preil
cdefc6acba SPU-II: Implement function calls 2020-08-22 12:45:29 -07:00
Noam Preil
d005ff16c6 SPU-II: undefined0 inline asm 2020-08-22 12:45:29 -07:00
Noam Preil
803a1025bb Targets: add SPU Mark II architecture 2020-08-22 12:45:29 -07:00
Andrew Kelley
29051a0674 stage2: codegen: fix crash
I forgot to do -Denable-qemu -Denable-wasmtime when testing yesterday,
sorry about that.

In reuseOperand, the code assumed a re-used register would be tracked in
the register table but that is not always the case.
2020-08-22 12:44:45 -07:00
Frank Denis
2d402157d9 Improve documentation on siphash recommended parameters 2020-08-22 15:12:54 -04:00
Frank Denis
f540dc1b7e cache_hash: hash function change
This makes the `cache_hash` hash function easier to replace.

BLAKE3 would be a natural fit for hashing large files, but:
- second preimage resistance is not necessary for the cache_hash use cases
- our BLAKE3 implementation is currently very slow

Switch to SipHash128, which gives us an immediate speed boost.
2020-08-22 15:10:33 -04:00
Matthew Knight
0fa3cfdb4a
Bpf: move under os/linux instead of bits (#6126)
* moved bpf syscall, added some bpf instructions and tests

* had to move bpf out of bits so that a freestanding target could import it

* removed line

* fixed imports
2020-08-22 15:08:01 -04:00
Jan200101
9605e5363b update update_glibc and process_headers to latest zig 2020-08-22 16:38:03 +03:00
Jakub Konka
69de1a51cd Add entry_point_command struct to Mach-O definitions
The `entry_point_command` is a replacement for `thread_command`, and
is used for main executables to specify the location of `main()`
entry point.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-22 04:14:27 -04:00
Andrew Kelley
55d7c399c1
Merge pull request #6119 from tadeokondrak/@Type(.Enum)
Implement @Type for Enum
2020-08-22 03:21:46 -04:00
Tadeo Kondrak
a049c31f21 Remove TypeInfo.Error.value 2020-08-22 03:20:12 -04:00
Frank Denis
e919744c7a Promote hash/siphash to crypto/siphash
SipHash *is* a cryptographic function, with a 128-bit security level.

However, it is not a regular hash function: a secret key is required,
and knowledge of that key allows collisions to be quickly computed offline.

SipHash is therefore more suitable to be used as a MAC.

The same API as other MACs was implemented in addition to functions directly
returning an integer.

The benchmarks have been updated accordingly.

No changes to the SipHash implementation itself.
2020-08-22 02:47:50 -04:00
Isaac Freund
9ab4281856 std: remove init functions from linked list nodes
These functions are rather useless and redundant as initializing the
struct directly is just as easy:

var node = TailQueue(u32).Node{ .data = 42 };
2020-08-22 02:47:39 -04:00
Andrew Kelley
f18b92ef3a stage2: implement spilling registers to the stack 2020-08-21 23:36:21 -07:00
Tadeo Kondrak
351701bcad
@Type for Enum fix: use correct decls_scope 2020-08-21 17:45:30 -06:00
Tadeo Kondrak
c31e8701d7
Update compile-errors test for @Type(.Enum) changes 2020-08-21 15:00:23 -06:00
Andrew Kelley
dad7af0b37
Merge pull request #6116 from jedisct1/polyfast
Make poly1305 faster
2020-08-21 16:52:33 -04:00
Tadeo Kondrak
5a5956bd20
Implement @Type for Enum 2020-08-21 14:31:24 -06:00