Andrew Kelley
9c22a6b3ad
Merge pull request #20823 from alexrp/start-pie-mips-ppc
...
`std.os.linux.start_pie`: Add mips and powerpc support
2024-08-01 00:57:10 -07:00
Andrew Kelley
63aa85e7af
Merge pull request #20872 from alexrp/riscv-gp
...
start: Initialize `gp` to `__global_pointer$` on riscv.
2024-08-01 00:47:05 -07:00
Jakub Konka
8ea323822b
Merge pull request #20884 from Rexicon226/riscv
2024-08-01 07:17:40 +02:00
Andrew Kelley
eb1a199dff
Merge pull request #20885 from ziglang/simplify-tokenizer
...
std.zig.tokenizer: simplification and spec conformance
2024-07-31 19:52:34 -07:00
Andrew Kelley
059856acfc
Merge pull request #20878 from tiehuis/std-math-complex-fixes
...
std.math.complex fixes
2024-07-31 19:19:27 -07:00
Andrew Kelley
7c5ee3efde
Merge pull request #20883 from ehaas/aro-translate-c-no-panic
...
aro-translate-c improvements
2024-07-31 18:53:05 -07:00
Andrew Kelley
c2b8afcac9
tokenizer: tabs and carriage returns spec conformance
2024-07-31 16:57:42 -07:00
Andrew Kelley
a7029496d1
remove hard tabs from source code
...
these are illegal according to the spec
2024-07-31 16:57:42 -07:00
Andrew Kelley
377e8579f9
std.zig.tokenizer: simplify
...
I pointed a fuzzer at the tokenizer and it crashed immediately. Upon
inspection, I was dissatisfied with the implementation. This commit
removes several mechanisms:
* Removes the "invalid byte" compile error note.
* Dramatically simplifies tokenizer recovery by making recovery always
occur at newlines, and never otherwise.
* Removes UTF-8 validation.
* Moves some character validation logic to `std.zig.parseCharLiteral`.
Removing UTF-8 validation is a regression of #663 , however, the existing
implementation was already buggy. When adding this functionality back,
it must be fuzz-tested while checking the property that it matches an
independent Unicode validation implementation on the same file. While
we're at it, fuzzing should check the other properties of that proposal,
such as no ASCII control characters existing inside the source code.
Other changes included in this commit:
* Deprecate `std.unicode.utf8Decode` and its WTF-8 counterpart. This
function has an awkward API that is too easy to misuse.
* Make `utf8Decode2` and friends use arrays as parameters, eliminating a
runtime assertion in favor of using the type system.
After this commit, the crash found by fuzzing, which was
"\x07\xd5\x80\xc3=o\xda|a\xfc{\x9a\xec\x91\xdf\x0f\\\x1a^\xbe;\x8c\xbf\xee\xea"
no longer causes a crash. However, I did not feel the need to add this
test case because the simplified logic eradicates most crashes of this
nature.
2024-07-31 16:57:42 -07:00
David Rubin
c08effc20a
riscv: implement non-pow2 indirect loads
2024-07-31 16:57:30 -07:00
David Rubin
2b8a71489a
start: remove riscv condition
2024-07-31 13:40:00 -07:00
David Rubin
9c7aade488
riscv: fix .got
symbol loading
2024-07-31 13:39:57 -07:00
David Rubin
0008934745
riscv: implement @divExact
2024-07-31 11:44:16 -07:00
Evan Haas
1cc74f3cae
aro_translate_c: fix formatting
2024-07-31 10:33:44 -07:00
Evan Haas
aa5a1105e8
aro_translate_c: do not translate atomic types
2024-07-31 10:04:21 -07:00
Evan Haas
6c632d52f9
aro_translate_c: move noreturn test to manifest
2024-07-31 09:35:07 -07:00
Evan Haas
b3f5769930
aro_translate_c: handle opaque struct defs in prototypes
2024-07-31 09:35:07 -07:00
Evan Haas
93a502cb2f
aro_translate_c: move simple function prototype test to manifest
2024-07-31 09:35:07 -07:00
Evan Haas
6a103d87f6
aro_translate_c: basic typedef support
2024-07-31 09:35:07 -07:00
Evan Haas
055077f9dd
aro_translate_c: improve record translation
...
Move field record decl translation into `transType` instead of `transDecl`
2024-07-31 09:35:07 -07:00
Evan Haas
c57fcd1db5
aro_translate_c: demote functions with bodies to extern
...
Translating statements is currently not supported; demoting to extern is
better than crashing.
2024-07-31 09:35:07 -07:00
Evan Haas
6997f82e02
translate_c: move empty declaration test to test manifest
2024-07-31 09:35:07 -07:00
Evan Haas
4300a9c417
aro_translate_c: Make function decls public
2024-07-31 09:35:07 -07:00
Evan Haas
5cc9e18277
aro_translate_c: Translate enum types
2024-07-31 09:35:07 -07:00
Evan Haas
2f2f35105e
aro_translate_c: translate pointer types
2024-07-31 09:35:07 -07:00
Evan Haas
e32cde2568
aro_translate_c: translate incomplete arrays
2024-07-31 09:35:07 -07:00
Evan Haas
da3822f4c2
aro_translate_c: Translate array types
2024-07-31 09:35:07 -07:00
Evan Haas
236567de8d
aro_translate_c: Emit compile errors instead of panicking for var decls
2024-07-31 09:35:07 -07:00
Alex Rønne Petersen
653eb75355
start: Disable the gp initialization code for the self-hosted riscv64 backend.
2024-07-31 02:06:57 +02:00
Alex Rønne Petersen
982510f8d5
start: Initialize gp to __global_pointer$ on riscv.
2024-07-31 02:05:17 +02:00
YANG Xudong
a69d403cb2
std: fix long double size for loongarch.
2024-07-30 15:21:14 -07:00
YANG Xudong
2fb813c61f
std: set standard dynamic linker path for loongarch64 on linux. ( #20726 )
2024-07-30 15:20:56 -07:00
Jakub Konka
30b4a87db7
Merge pull request #20873 from ziglang/elf-ownership
...
elf: clean up resource ownership in the linker
2024-07-30 18:49:39 +02:00
Alex Rønne Petersen
2e719f3239
std.os.linux.start_pie: Use a 64-bit displacement for s390x.
...
Not likely to be necessary ever, but might as well be 100% correct.
2024-07-30 18:02:40 +02:00
Alex Rønne Petersen
52519f79e0
std.os.linux.start_pie: Apply MIPS local GOT relocations.
2024-07-30 18:02:36 +02:00
Alex Rønne Petersen
78e581b86f
start: Copy the mips64 comment about gp to the mips32 code.
...
Also, don't incorrectly claim that it's only needed for dynamic linking/PIC.
2024-07-30 17:58:22 +02:00
Jakub Konka
3f10217a47
elf: fix a typo in setting atom name before it's been allocated
2024-07-30 12:54:30 +02:00
Marc Tiehuis
843885512d
std.math.complex: fix cosh/tanh
2024-07-30 20:31:22 +12:00
Jakub Konka
e0c475b6b7
elf: remove now unused globalByName
2024-07-30 10:03:13 +02:00
Jakub Konka
a76ad907d0
elf: include LinkerDefined in symbol resolution
2024-07-30 10:03:13 +02:00
Jakub Konka
3618824ea3
elf: move entry tracking into LinkerDefined
2024-07-30 10:03:13 +02:00
Jakub Konka
5ceac8ebba
elf: move initializing and allocating linker-defined symbols into LinkerDefined
2024-07-30 10:03:11 +02:00
Jakub Konka
ef7bbcd80f
elf: do not store merge section output section name in strings buffer
2024-07-30 10:00:50 +02:00
Jakub Konka
801c372098
elf: init output merge sections in a separate step
2024-07-30 10:00:50 +02:00
Jakub Konka
0701646beb
elf: move merge subsections ownership into merge sections
2024-07-30 10:00:50 +02:00
Jakub Konka
24126f5382
elf: simplify output section tracking for symbols
2024-07-30 10:00:50 +02:00
Jakub Konka
e8d008a8a8
elf: atom is always assigned output section index
2024-07-30 10:00:50 +02:00
Jakub Konka
96c20adeee
elf: remove obsolete flags from atom
2024-07-30 10:00:50 +02:00
Jakub Konka
c575e3daa4
elf: resolve COMDATs in more parallel-friendly way
2024-07-30 10:00:50 +02:00
Jakub Konka
fa09276510
test/link/elf: test COMDAT elimination
2024-07-30 10:00:50 +02:00