joachimschmidt557
2ad2636588
stage2 ARM: use strb + implement genBoolOp
2020-11-28 18:19:22 +01:00
joachimschmidt557
f06f0ebcda
stage2 ARM: Implement genNot
2020-11-28 18:19:22 +01:00
joachimschmidt557
85a3991a43
stage2 codegen: use switch in genBoolOp
2020-11-28 18:19:22 +01:00
joachimschmidt557
27c5c97f21
stage2 ARM: genAdd, genSub for simple cases
2020-11-28 18:19:19 +01:00
Andrew Kelley
c3b0182f31
restore sonames by default when using zig cli
...
Before this commit, the branch regressed this case:
zig build-lib foo.zig -dynamic
readelf -d libfoo.so
x000000000000000e (SONAME) Library soname: [libfoo.so]
Now it works again, but it preserves the property that using `zig cc`
has the SONAME off by default to match C compilers.
2020-11-27 17:49:55 -07:00
Jakub Konka
dd522c0c97
stage2 elf: fix glibc to always specify soname
2020-11-27 15:42:39 -07:00
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
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
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
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
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
LemonBoy
58c2bec589
stage1: Fix ICE when generating struct fields with padding
...
Make gen_const_ptr_struct_recursive aware of the possible presence of
some trailing padding by always bitcasting the pointer to its expected
type.
Not an elegant solution but makes LLVM happy and is consistent with how
the other callsites are handling this case.
Fixes #5398
2020-11-25 15:36:33 -08:00
Andrew Kelley
abc717f203
modernize the PIE patch for the latest master branch
...
This is the part of #3960 that has to be rewritten to apply to latest
master branch code.
2020-11-22 17:28:11 -07:00
Andrew Kelley
55ab50efbd
Merge branch 'piepiepie' of https://github.com/LemonBoy/zig into pie
...
Conflicts:
lib/std/dynamic_library.zig (fixed in this commit)
src/all_types.hpp
src/codegen.cpp
src/link.cpp
src/main.cpp
Will manually apply the diffs to these deleted files to the new zig
code in a followup commit.
2020-11-22 12:39:44 -07:00
Andrew Kelley
7dcda5b0e8
Merge pull request #7182 from LemonBoy/externnnn
...
Initial implementation of @extern builtin
2020-11-21 09:41:49 -08:00