Jonathan Marler
fd2c1d8605
Fix building aarch64-windows-gnu by adding missing libc files and compiler_rt functions ( #9555 )
...
* fix issue 9519
Added some missing files from mingw
* add missing compiler_rt functions
* finish PR
* add aarch64-windows-gnu to test targets
* add more compiler_rt
* add log2
* add pow
* add modti3
2021-09-07 19:44:21 +03:00
Jakub Konka
a2279e7e20
macho: fix commands.zig tests
2021-09-07 12:23:26 +02:00
Andrew Kelley
16c3cd3d19
langref: update link to 0.8.1 docs
2021-09-07 01:14:08 -07:00
Jakub Konka
c35f668932
macho: update max section alignment when inserting atoms
2021-09-07 10:07:09 +02:00
Jacob G-W
107e3ba3cd
add standalone test for issue #9693
2021-09-06 15:16:30 -04:00
Jacob G-W
738395f9bc
std: update event loop for recent usingnamespace changes
2021-09-06 15:16:29 -04:00
Takeshi Yoneda
34671b1d19
stdlib: fix ChildProcess.killPosix
...
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-09-06 20:10:42 +03:00
Jakub Konka
6836cc473c
macho: make sure that parsed bss atoms are zero-filled
2021-09-06 18:30:40 +02:00
Jakub Konka
81e5320973
macho: set and reset file offset to zerofill sections in flush
...
This way, there's no need to special the set/reset behaviour at
every stage of updating sections/atoms.
2021-09-06 17:43:24 +02:00
Jakub Konka
29d2e19c3e
macho: allocate sections one after the other and grow if needed
2021-09-06 17:31:20 +02:00
Jakub Konka
2914ea9e33
macho: require atom padding for machine code only
2021-09-06 11:17:20 +02:00
Jakub Konka
5e64d9745b
macho: fix noninclusion of data-in-code
...
Also, calculate non-extern, section offset based addends for SIGNED
and UNSIGNED relocations on x86_64 upfront as an offset wrt to the
target symbol representing position of the section/atom within the
final artifact.
2021-09-06 10:38:51 +02:00
Jakub Konka
61dca19107
macho: encaps logic for extract sect offset into fn
2021-09-05 23:30:06 +02:00
Jakub Konka
ea8808f87b
macho: add logic for segment expansion
2021-09-05 11:15:48 +02:00
Jakub Konka
d92b5416e8
macho: add a small routine to update section ordinals at the end
...
The actual ordinals may change when adding new sections to the segments.
2021-09-05 00:19:45 +02:00
Jakub Konka
7e87f93e06
macho: unfortunately, LINKEDIT commands NEED to be in order
...
Otherwise, Apple's tooling goes mental and reports that the executable
is malformed/fails strict validation. We absolutely have to get it
right to support tools such `codesign` which are required to
successfully launch an app on an iOS device for instance. When Zig
matures enough so that we can ditch any Apple tooling and still be
able to successfully codesign for iOS and other, we can revisit this
area. Until then however, we are stuck in having to rewrite the LINKEDIT
segment at every update run of the self-hosted.
FYI, the strict layout for the MachO binary apparently is (please,
read this with a pinch of salt as this is inferred by me):
* __TEXT segment
* __DATA_CONST segment
* __DATA segment
* __LINKEDIT segment
* dyld info (rebase, bind, weak bind, lazy bind, export)
* symbol table
* dynamic symbol table
* string table
* code signature (if expected)
2021-09-04 22:59:16 +02:00
Alex Rønne Petersen
eb5e4ac495
link: Recognize -z origin|noexecstack|now|relro linker args.
2021-09-04 12:18:38 +03:00
Jakub Konka
80e1c244b6
macho: dyld info subsections need to follow in strict order
...
MachO, why are doing this to me?
2021-09-03 17:12:39 +02:00
FnControlOption
5672ee4ed7
AstGen: use string index as key for string table
2021-09-03 06:55:38 -07:00
FnControlOption
fdf1918b39
std.hash_map: add StringIndexAdapter and StringIndexContext
2021-09-03 06:50:27 -07:00
Jakub Konka
1d2199b71c
macho: dirty export trie when adding globals
...
Similarly, dirty rebase info when adding a GOT atom.
2021-09-03 13:41:28 +02:00
Jakub Konka
7536a2f8cf
macho: minor fixes to allow the linker to output malformed stage1
2021-09-03 11:47:58 +02:00
Jakub Konka
a783f3a369
macho: remove obsolete mentions of stage1
2021-09-03 00:25:47 +02:00
Jakub Konka
4b07da7090
macho: remove all Zld codepaths
2021-09-03 00:21:45 +02:00
Jakub Konka
5af13f35f9
macho: implement basic section movement and reallocation
2021-09-02 18:19:07 +02:00
Andrew Kelley
594271f8db
Merge pull request #9618 from ziglang/std-os-reorg
...
std.os reorganization; new `usingnamespace` semantics
2021-09-02 04:51:42 -04:00
Andrew Kelley
2264fca03e
fix regression on linux with kernel_timespec
...
I incorrectly assumed that __kernel_timespec was used when not linking
libc, however that is not the case. `std.os.timespec` is used both for
libc and non-libc cases. `__kernel_timespec` is a special struct that is
used only for io_uring.
2021-09-01 17:54:07 -07:00
Andrew Kelley
21171fd71b
AstGen: update std.zig.{ast,Ast}
...
This fixes a merge conflict when rebasing against master branch.
2021-09-01 17:54:07 -07:00
Evan Haas
bbf4c25e2d
translate-c: rename import_builtin to import_c_builtin
2021-09-01 17:54:07 -07:00
Evan Haas
c0e84e3ee0
translate-c: translate valueless macros as empty strings
2021-09-01 17:54:07 -07:00
Andrew Kelley
0932b0d9b3
std.os reorg: regression fixes to stack_t, and std.Thread
2021-09-01 17:54:07 -07:00
Andrew Kelley
1a492d5156
re-apply a commit dropped in this branch due to conflicts
...
This commit reapplies 4f0aa7d639e099b18df583cb984412037fbb1dbe.
2021-09-01 17:54:07 -07:00
Andrew Kelley
5a4cc24c0e
std: dirent is not part of posix
2021-09-01 17:54:07 -07:00
Andrew Kelley
f8dd4b13d6
std.os reorg: more fixes caught by CI
2021-09-01 17:54:07 -07:00
Andrew Kelley
057f0fec33
std.os fixes to get the test suite passing again
2021-09-01 17:54:07 -07:00
Andrew Kelley
feec4b0614
langref: new usingnamespace semantics
2021-09-01 17:54:07 -07:00
Andrew Kelley
f4d3d29f92
docgen: syntax blocks don't actually run the code
2021-09-01 17:54:07 -07:00
Evan Haas
f5553bfefc
translate-c: Only consider public decls in isBuiltinDefined
2021-09-01 17:54:07 -07:00
Evan Haas
df589eecd6
translate-c: improve handling of undefined identifiers
2021-09-01 17:54:07 -07:00
Andrew Kelley
8d2acff197
disable slow scrypt tests
2021-09-01 17:54:07 -07:00
Evan Haas
89dd2b7ac2
translate-c: emit compileError for undefined identifiers in macros
2021-09-01 17:54:07 -07:00
Andrew Kelley
cca57042df
std: fix regressions from this branch
...
Also move some usingnamespace test cases from compare_output to
behavior.
2021-09-01 17:54:07 -07:00
Andrew Kelley
3940a1be18
rename std.zig.ast to std.zig.Ast; use top-level fields
2021-09-01 17:54:07 -07:00
Andrew Kelley
e41e75a486
stage2: update for new usingnamespace semantics
2021-09-01 17:54:07 -07:00
Andrew Kelley
a2ff3a13fe
std, compiler-rt: remove test names where applicable
...
Tests with no names are executed when using `zig test` regardless of the
`--test-filter` used. Non-named tests should be used when simply
importing unit tests from another file. This allows `zig test` to find
all the appropriate tests, even when using `--test-filter`.
2021-09-01 17:54:06 -07:00
Andrew Kelley
ca21cad2bf
move syntax tests out of behavior tests
...
parser_test.zig is where the syntax tests go
2021-09-01 17:54:06 -07:00
Andrew Kelley
332eafeb7f
stage2: first pass at implementing usingnamespace
...
Ran into a design flaw here which will need to get solved by having
AstGen annotate ZIR with which instructions are closed over.
2021-09-01 17:54:06 -07:00
Andrew Kelley
c05a20fc8c
std: reorganization that allows new usingnamespace semantics
...
The proposal #9629 is now accepted, usingnamespace stays but no longer
puts identifiers in scope.
2021-09-01 17:54:06 -07:00
Andrew Kelley
7884d84315
std.os.windows: reorg to avoid usingnamespace
...
Down to 19 uses of `usingnamespace`.
2021-09-01 17:54:06 -07:00
Andrew Kelley
b781ef464d
std.os: fix FILENO constants mapped to wrong values
...
yikes!
2021-09-01 17:54:06 -07:00