Commit Graph
34717 Commits
Author SHA1 Message Date
Andrew Kelley 2e26cf83cf Merge pull request #20903 from ziglang/dwarf-reorg
std: dwarf namespace reorg + bonus commits
2024-08-01 21:25:40 -07:00
Andrew Kelley e5b46eab3b std: dwarf namespace reorg
std.debug.Dwarf is the parsing/decoding logic. std.dwarf remains the
unopinionated types and bits alone.

If you look at this diff you can see a lot less redundancy in
namespaces.
2024-08-01 13:56:12 -07:00
Andrew Kelley 377274ee9a std.debug.DebugInfo: rename to std.debug.Info
avoiding redundancy in the fully qualified namespace
2024-08-01 13:47:42 -07:00
Andrew Kelley 9c84b5cc18 build.zig: fix -Dskip-non-native
now it actually does what it says on the tin
2024-08-01 13:47:29 -07:00
Andrew Kelley 12d0c9a2fc add std.fs.Dir.Handle
mirrors std.fs.File.Handle
2024-08-01 13:47:23 -07:00
Andrew Kelley 5c6f5e6cf2 test runner: avoid spawning progress thread when instrumented
because it causes unwanted concurrent accesses to pc tracking
2024-08-01 13:47:09 -07:00
Alex Rønne Petersen 7d88bd0b9c std.simd: Fix an isARM() check to use isArmOrThumb() instead.
Thumb can have NEON instructions too.
2024-08-01 20:58:08 +02:00
Alex Rønne Petersen a9c7818512 start: Fix an isARM() check to use isArmOrThumb() instead. 2024-08-01 20:58:08 +02:00
Alex Rønne Petersen 5cd92a6b51 libunwind: Fix an isARM() check to use isArmOrThumb() instead. 2024-08-01 20:58:08 +02:00
Alex Rønne Petersen 7cc257957e glibc: Fix some target architecture checks to include thumb and powerpcle. 2024-08-01 20:58:08 +02:00
Alex Rønne Petersen f7d07b44d1 std.os.linux: Fix arm check in fadvise() to also include thumb. 2024-08-01 20:58:08 +02:00
Alex Rønne Petersen a2868147b1 std.os.linux: Fix require_aligned_register_pair to check isMIPS32().
Only 32-bit architectures need this.
2024-08-01 20:58:08 +02:00
Alex Rønne Petersen 5a97045644 std.Target: Add isMIPS32()/isMIPS64() functions. 2024-08-01 20:58:08 +02:00
Alex Rønne Petersen e5c75479c2 std.Target: Rework isPPC()/isPPC64() functions.
* Rename isPPC() -> isPowerPC32().
* Rename isPPC64() -> isPowerPC64().
* Add new isPowerPC() function which covers both.

There was confusion even in the standard library about what isPPC() meant. This
change makes these functions work how I think most people actually expect them
to work, and makes them consistent with isMIPS(), isSPARC(), etc.

I chose to rename from PPC to PowerPC because 1) it's more consistent with the
other functions, and 2) it'll cause loud rather than silent breakage for anyone
who might have been depending on isPPC() while misunderstanding it.
2024-08-01 20:58:05 +02:00
Alex Rønne Petersen 5e08d00862 std.Target: Add Arch.isLoongArch() function. 2024-08-01 13:11:21 +02:00
Alex Rønne Petersen 624fa8523a std.os.linux: Unbreak the build
Happened because I wrote #20869 before #20870.
2024-08-01 13:05:26 +02:00
Andrew Kelley 7a0da805a8 Merge pull request #20797 from alexrp/start-more-arches
`start`: Add POSIX arc, csky, and hexagon support
2024-08-01 01:34:33 -07:00
Andrew Kelley 8f7cbaa4c0 Merge pull request #20870 from alexrp/target-cleanup-3
`std.Target`: Remove more dead OS/architecture tags
2024-08-01 01:32:32 -07:00
Andrew Kelley f17f73b4fa Merge pull request #20869 from alexrp/linux-syscalls
`std.os.linux`: Add syscall enums for all remaining architectures
2024-08-01 01:21:10 -07:00
Andrew Kelley 91163b44dd Merge pull request #20857 from alexrp/tls-porting
`std.os.linux.tls`: Refactor, improve documentation, fix a bug, and port to more architectures
2024-08-01 01:15:17 -07:00
Andrew Kelley 16dde6d260 Merge pull request #20772 from alexrp/linux-audit
`std.os.linux.AUDIT`: Rewrite ARCH in terms of std.elf.EM.
2024-08-01 01:09:22 -07:00
Alex Rønne Petersen 8d5eaadb05 std.Target: Handle loongarch in Os.Tag.archName(). 2024-08-01 01:08:20 -07:00
Alex Rønne Petersen f03d54f069 std.atomic: Don't lie to the compiler about memory clobbers in spinLoopHint(). 2024-08-01 01:07:56 -07:00
Alex Rønne Petersen 604e87a958 std.Target: Use hexagonv60 as the baseline CPU model for hexagon. 2024-08-01 01:01:24 -07:00
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