Commit Graph

11757 Commits (master)

Author SHA1 Message Date
Jakub Konka 375bab8460 stage2 elf: refactor override_soname to soname 2020-11-27 15:42:39 -07:00
Jakub Konka 12efefeba5 stage2 elf: make -soname an opt-in and not opt-out
As discussed with LemonBoy, it makes more sense to have the `-soname`
an opt-in option rather than opt-out, which is especially true if
we are to align `zig cc` with `cc` to a greater degree.
2020-11-27 15:42:39 -07:00
Andrew Kelley 9e4360c335
Merge pull request #7198 from LemonBoy/freebsd-lock
std: Fix file locking logic for BSD targets
2020-11-27 14:35:30 -08:00
LemonBoy f91df39ad2 stage1: Fix crash in *[N]T to []T conversion with zst
Prevent the crash by not making the codegen try to access the
non-existing ptr field in the slice.

Closes #6951
2020-11-27 14:33:26 -08:00
Jakub Konka 3bc1c719bd
Merge pull request #7231 from kubkon/stage2-arm-macos
stage2: Hello, Silicon!\n
2020-11-27 21:49:06 +01:00
Jakub Konka 5ed76268c9 stage2 macho: apply more review comments 2020-11-27 20:55:34 +01:00
Jakub Konka 02baaac506
Update src/codegen.zig
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2020-11-27 20:31:26 +01:00
Koakuma 41c40f4bbe Fix fork() on Linux/sparc64
fork() on Linux/sparc64 seems to return its result in two registers,
with %o0 always holding the current process' PID, and the parent/child
status returned in %o1. Add some glue code to convert those into
the libc-style return value.
2020-11-27 23:02:22 +07:00
Koakuma cf2ee4ae2c Add sparc64 long double mapping 2020-11-27 18:51:50 +07:00
g-w1 daf6c0da5b CONTRIBUTING: src-self-hosted -> src 2020-11-26 16:40:57 -08:00
Jakub Konka ebb2f20815 stage2 macho: Dir.copyFile does the rename for us! 2020-11-26 21:12:20 +01:00
Jakub Konka a8f8d82215 stage2 macho: use Dir.copyFile instead of manual create+copy 2020-11-26 20:21:53 +01:00
LemonBoy 21c488ce68 stage1: Force union member types to be resolved
No test case because I couldn't reduce the huuuge test case.
Fixes the problem discovered by @ifreund.
2020-11-26 10:49:47 -08:00
Jakub Konka f125c4f5c7 stage2 macho: enable end-to-end incremental linking tests on aarch64 2020-11-26 11:50:09 +01:00
Jakub Konka 7e8f7da3ec stage2 macho: rename inodes to prevent SIGKILL 2020-11-26 11:50:09 +01:00
Jakub Konka 64eae8f392 stage2 macho: move PIE fixups to link file; fix tests 2020-11-26 11:50:09 +01:00
Jakub Konka c749b78df5 stage2 macho: add orr and orn instructions 2020-11-26 11:50:09 +01:00
Jakub Konka 10942e3f86 stage2 macho: Hello, Silicon! 2020-11-26 11:50:09 +01:00
Jakub Konka 2cd84b1b3f stage2 macho: refactor PIE generation on x86_64 2020-11-26 11:50:09 +01:00
Jakub Konka ef5132c508 stage2 macho: first, rough draft at trampolining 2020-11-26 11:50:09 +01:00
Jakub Konka 80b1041c21 stage2 macho: use RIP-relative for memory-set regs x86_64 2020-11-26 11:50:09 +01:00
Jakub Konka 59fe3d447d stage2 macho: make file structure compatible with codesign tool 2020-11-26 11:50:09 +01:00
Jakub Konka e7db372864 stage2 macho: cleanup logs 2020-11-26 11:50:09 +01:00
Jakub Konka cd79c6dda1 stage2 macho: fix issues with codesigning 2020-11-26 11:50:09 +01:00
Jakub Konka a6e93da717 stage2 macho: generate a code sig (not valid yet) 2020-11-26 11:50:09 +01:00
Jakub Konka 9dcf7ee9c9 stage2 macho: add info about __TEXT segment 2020-11-26 11:50:09 +01:00
Jakub Konka 79381dc4fb stage2 macho: add empty CodeDirectory blob 2020-11-26 11:50:09 +01:00
Jakub Konka d14cd59ef0 stage2 macho: move code signature logic into struct 2020-11-26 11:50:09 +01:00
Jakub Konka 3ac804628f stage2 macho: write out constants in CS 2020-11-26 11:50:09 +01:00
Jakub Konka 2bd963ad6a stage2 macho: don't pad out holes between sections 2020-11-26 11:50:09 +01:00
Jakub Konka 403dc50ff7 stage2 macho: preallocate empty code sig space 2020-11-26 11:50:09 +01:00
Jakub Konka bbc4ee3f17 stage2 macho: refactor 2020-11-26 11:50:09 +01:00
Jakub Konka a2e0e33249 stage2 macho: bring back incremental symbol commits 2020-11-26 11:50:09 +01:00
Jakub Konka e1b65ff8d2 stage2 macho: cleanup minimum version command 2020-11-26 11:50:09 +01:00
Jakub Konka be0d5571d2 stage2 macho: revert required alignment always at 4 2020-11-26 11:50:09 +01:00
Jakub Konka e8dd62accd stage2 macho: fix incorrect rebase 2020-11-26 11:50:09 +01:00
Jakub Konka 2972f630a4 stage2 macho: start reverting some tweaks 2020-11-26 11:50:09 +01:00
Jakub Konka 4e3520a2f7 stage2 macho: make page size target cpu arch dependent 2020-11-26 11:50:09 +01:00
Jakub Konka 8450e6f156 stage2 macho: pages need to be 16kb aligned! 2020-11-26 11:50:09 +01:00
Jakub Konka 4a3d757f3e stage2 MachO: reduce size of __TEXT segment 2020-11-26 11:50:09 +01:00
Jakub Konka 7a407246ed stage2 MachO: remove discontinuities between segments 2020-11-26 11:50:09 +01:00
Jakub Konka 6ac7e99dad Write local symbols when flushing 2020-11-26 11:50:09 +01:00
Jakub Konka b3fdfe5ca0 stage2 MachO: clean up segment protection flags 2020-11-26 11:50:09 +01:00
Jakub Konka 7dd5ce2527 stage2 macOS: make exe flagged as pie 2020-11-26 11:50:09 +01:00
Jakub Konka 1bec531cf2 stage2 MachO: add source version load cmd 2020-11-26 11:50:09 +01:00
Jakub Konka 72310db1da stage2 MachO: add min OS version load cmd 2020-11-26 11:50:09 +01:00
Isaac Freund 58365c4e79 std/os: fix prctl constants 2020-11-25 15:45:55 -08:00
Andrew Kelley a06afa4579
Merge pull request #6411 from LemonBoy/fff
More std.fmt goodness
2020-11-25 15:43:19 -08:00
daurnimator b7b3c1dfae std: use mem.asBytes in Ip4Address.parse so it works at comptime 2020-11-25 15:40:46 -08:00
Frank Denis 83abb32247 std/crypto - edwards25519 precomp: prefer doublings over adds
Doublings are a little bit faster than additions, so use them half
the time during precomputations.
2020-11-25 15:37:43 -08:00