Commit Graph

31432 Commits

Author SHA1 Message Date
Linus Groh
f18c71ba73 std.debug: Fix defaultPanic() uefi build
lib/std/debug.zig:491:38: error: slice of non-array type 'u16'
            utf16_buffer[len_minus_3][0..3].* = .{ '\r', '\n', 0 };
            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~

lib/std/debug.zig:510:70: error: expected type '?*const anyopaque', found '[]u16'
                _ = bs.exit(uefi.handle, .Aborted, exit_msg.len + 1, exit_data);
                                                                     ^~~~~~~~~

Regressed in #21520.
2024-10-07 02:40:01 +09:00
Alex Rønne Petersen
148b5b4c78
Merge pull request #21608 from mikdusan/ppc64
ppc64: get further along into system bootstrap
2024-10-06 17:26:40 +02:00
Alex Rønne Petersen
770aa54579
std.Target: Fix cTypePreferredAlignment() to always return 1 for avr.
This matches avr-gcc's ABI.
2024-10-06 17:19:07 +02:00
Alex Rønne Petersen
ece265b1c2
Merge pull request #21605 from alexrp/ohos-stuff
`std.Target`: Introduce `Abi.ohoseabi` to distinguish the soft float case.
2024-10-06 16:26:24 +02:00
Alex Rønne Petersen
be5378b038
Merge pull request #21587 from alexrp/hexagon-porting
Some initial `hexagon-linux` port work
2024-10-06 13:35:56 +02:00
Matthew Lugg
008bb1f120
Merge pull request #21518 from mlugg/incremental-ci
incr-check enhancements, and CI for incremental test cases
2024-10-06 11:16:27 +01:00
achan1989
b01a5c6bb7 Explain why POLL_FD_READWRITE is not dangerous at sites of use 2024-10-06 09:47:12 +01:00
achan1989
1d8844dd56 Copy in WASI rights_t documentation 2024-10-06 09:44:52 +01:00
Alex Rønne Petersen
1992428044
test: Add some missing x86_64-linux-* triples to llvm_targets. 2024-10-06 10:26:00 +02:00
Alex Rønne Petersen
5e9764c512
test: Add android/androideabi triples to llvm_targets. 2024-10-06 10:24:35 +02:00
Alex Rønne Petersen
e3e60491ba
test: Add ohos/ohoseabi triples to llvm_targets. 2024-10-06 10:22:39 +02:00
Alex Rønne Petersen
516cb5a5e8
Merge pull request #21037 from alexrp/target-dyld
`std.Target`: Rewrite DynamicLinker.standard() and fill in some missing details.
2024-10-06 09:17:57 +02:00
mlugg
90db767721
std: async read into small temporary buffer between poll calls on Windows
This commit changes how `std.io.poll` is implemented on Windows. The new
implementation unfortunately incurs a little extra system call overhead,
but fixes several bugs in the old implementation:

* The `lpNumberOfBytesRead` parameter of `ReadFile` was used with
  overlapped I/O. This is explicitly disallowed by the documentation, as
  the value written to this pointer is "potentially erroneous"; instead,
  `GetOverlappedResult` must always be used, even if the operation
  immediately returns. Documentation states that `lpNumberOfBytesRead`
  cannot be passed as null on Windows 7, so for compatibility, the
  parameter is passed as a pointer to a dummy global.
* If the initial `ReadFile` returned data, and the next read returned
  `BROKEN_PIPE`, the received data was silently ignored in the sense
  that `pollWindows` did not `return`, instead waiting for data to come
  in on another file (or for all files to close).
* The asynchronous `ReadFile` calls which were left pending between
  calls to `pollWindows` pointed to a potentially unstable buffer, since
  the user of `poll` may use part of the `LinearFifo` API which rotate
  its ring buffer. This race condition was causing CI failures in some
  uses of the compiler server protocol.

These issues are all resolved. Now, `pollWindows` will queue an initial
read to a small (128-byte) stable buffer per file. When this read is
completed, reads directly into the FIFO's writable slice are performed
until one is left pending, at which point that read is cancelled (with a
check to see if it was completed between the `ReadFile` and `CancelIo`
calls) and the next read into the small stable buffer is queued. These
small buffer reads are the ones left pending between `pollWindows`
calls, avoiding the race condition described above.

Related: #21565
2024-10-06 07:01:12 +01:00
Alex Rønne Petersen
ac247c9943
Merge pull request #21331 from bobf/std-meta-DeclEnum-empty-struct
Prevent failure with empty struct in `std.meta.DeclEnum`
2024-10-06 02:52:20 +02:00
Alex Rønne Petersen
406e56ab69
Merge pull request #21581 from zigmd/fix-typo-in-segset_t
std: fix typo in darwin segset_t
2024-10-06 00:32:54 +02:00
mlugg
ada60616b3
incr-check: minor fixes
* fix inconsistency in global cache directory name
* don't error if spawning external executor fails
* handle CRLF correctly
2024-10-05 20:52:26 +01:00
mlugg
14ccbbef9f
test: add x86_64-windows-cbe target to incremental cases
Throw another target in there just to spice things up a little!

Running the incremental cases with the C backend is pretty slow due to
the need to recompile the whole output from scratch on every update; for
this reason, we probably don't want to keep many of these targeting CBE
long-term. However, for now, while we have relatively few tests and
things are still changing quite a lot, it's better to have this little
bit of extra test coverage.
2024-10-05 20:52:26 +01:00
mlugg
dfc0a27090
incr-check: clean up temporary directory by default
The new `--preserve-tmp` flag can be used to preserve the temporary
directory for debugging purposes.
2024-10-05 20:52:26 +01:00
mlugg
5ce962eb69
incr-check: better progress output, support external executors
If no external executor is available for a successful binary, its
execution is silently skipped. This allows the CI to test, to the
fullest extent possible, incremental cross-compilation to targets whose
binaries can't be executed on the host.
2024-10-05 20:52:25 +01:00
mlugg
f60c045cef
tests: add test-incremental step
This is contained in the `test` step, so is tested by CI.

This commit also includes some enhancements to the `incr-check` tool to
make this work correctly.
2024-10-05 20:52:25 +01:00
Michael Dusan
665d0157d5
std ppc64: add nop to start inline-asm
fixes ld.lld error: call to save_start.posixCallMainAndExit lacks nop, can't restore toc
2024-10-05 10:27:13 -04:00
Michael Dusan
f7da960a33
stage1 ppc64: remove inline-asm overlapping clobbers
Required when bootstrapping with GCC.
2024-10-05 10:26:47 -04:00
achan1989
0d85284e4d Create/open file on WASI targets should have POLL_FD_READWRITE rights 2024-10-05 15:23:00 +02:00
Alex Rønne Petersen
25ee7b0ea8
compiler: Don't require PIC for aarch64-linux-ohos.
While Clang defaults to PIC for this target, it's not actually required.
2024-10-05 15:19:14 +02:00
Alex Rønne Petersen
09efa95f48
compiler: Don't link to nonexistent libc libraries for ohos. 2024-10-05 15:14:16 +02:00
Alex Rønne Petersen
84e192c88b
std.Target: Introduce Abi.ohoseabi to distinguish the soft float case.
For the same reason as #21504.
2024-10-05 15:13:37 +02:00
Alex Rønne Petersen
9a5b0a6762
std.Target: Rewrite DynamicLinker.standard() and fill in some missing details. 2024-10-05 13:53:24 +02:00
Alex Rønne Petersen
d23db9427b
Merge pull request #21574 from alexrp/llvm-sub-arch
`llvm`: Implement sub-architecture translation in `targetTriple()`.
2024-10-05 13:49:05 +02:00
Jonathan Marler
73de620ad5 std.os.windows.ReadFile: handle ERROR_LOCK_VIOLATION
fixes #21500
2024-10-05 00:36:49 -07:00
Alex Rønne Petersen
e6fd01a949
Merge pull request #21595 from alexrp/objcopy-seg-paddr
`objcopy`: Use `p_paddr` from `PT_LOAD` even if zero.
2024-10-05 05:21:48 +02:00
Andrew Kelley
cfd3bcffec
Merge pull request #21591 from patrickwick/issue-19009
zig objcopy: support --add-section
2024-10-04 19:45:39 -07:00
Alex Rønne Petersen
98b85f72a6
Merge pull request #21593 from alexrp/dlopen-null
`std.c`: Make `dlopen()` accept null for the `path` parameter.
2024-10-05 04:05:24 +02:00
David Rubin
043b1adb8d
remove @fence (#21585)
closes #11650
2024-10-04 22:21:27 +00:00
Andrew Kelley
163d505e27 std.Target: add missing propeller switch prongs
Seems to have been an invisible merge conflict.
2024-10-04 15:03:46 -07:00
Andrew Kelley
9fca80941c
Merge pull request #21532 from marler8997/putDependencyCacheInGraph
Put dependency cache in graph
2024-10-04 14:00:15 -07:00
Felix Queißner
7c74edec8d
Adds new cpu architectures propeller1 and propeller2. (#21563)
* Adds new cpu architectures propeller1 and propeller2.

These cpu architectures allow targeting the Parallax Propeller 1 and Propeller 2, which are both very special microcontrollers with 512 registers and 8 cpu cores.

Resolves #21559

* Adds std.elf.EM.PROPELLER and std.elf.EM.PROPELLER2
* Fixes missing switch prongs in src/codegen/llvm.zig
* Fixes order in std.Target.Arch

---------

Co-authored-by: Felix "xq" Queißner <git@random-projects.net>
2024-10-04 13:53:28 -07:00
PauloCampana
3e62cb5c90
Remove old deprecated symbols in std (#21584)
Also, actually run tests inside std/tar/writer.zig
2024-10-04 13:50:25 -07:00
Alex Rønne Petersen
64b6a4ff77
objcopy: Use p_paddr from PT_LOAD even if zero.
Fix suggested by @cclin0816.

Closes #20019.
2024-10-04 22:44:49 +02:00
Alex Rønne Petersen
31d685f86f
std.c: Make dlopen() accept null for the path parameter.
Closes #21592.
2024-10-04 20:10:07 +02:00
Alex Rønne Petersen
eb363bf845
Merge pull request #21572 from alexrp/tests-llvm-targets
`test`: Rewrite the target triple list for `llvm_targets`.
2024-10-04 19:37:12 +02:00
Patrick Wickenhaeuser
c3f1ff8b0d 19009: zig objcopy: minor cleanup 2024-10-04 15:49:50 +02:00
Patrick Wickenhaeuser
19a0864e4f 19009: zig objcopy: allow --add-section, --set-section-alignment and --set-section-flags only if the target is an ELF file 2024-10-04 15:49:50 +02:00
Patrick Wickenhaeuser
182c12de69 19009: zig objcopy: fix typo in abort messages 2024-10-04 15:49:50 +02:00
Patrick Wickenhaeuser
e1d54b6d1a 19009: zig objcopy: integrate --add-section, --set-section-alignment and --set-section-flags into std.Build.Step.ObjCopy 2024-10-04 15:49:50 +02:00
Patrick Wickenhaeuser
8f55efc1af 19009: zig objcopy: integrate section flags for --set-section-flags command 2024-10-04 15:49:50 +02:00
Patrick Wickenhaeuser
8cd7a9e5fc 19009: zig objcopy: parse section flags 2024-10-04 15:49:50 +02:00
Patrick Wickenhaeuser
caa699fc68 19009: zig objcopy: implement --set-section-alignment 2024-10-04 15:49:50 +02:00
Patrick Wickenhaeuser
f72961ee30 19009: add --set-section-alignment and --set-section-flags arguments to zig objcopy 2024-10-04 15:49:50 +02:00
Patrick Wickenhaeuser
172e7161a4 19009: zig objcopy: add --add-section support 2024-10-04 15:49:50 +02:00
Alex Rønne Petersen
b23a5b56c2
Merge pull request #21578 from alexrp/s390x-porting
Get module tests passing for `s390x-linux` and add it to CI
2024-10-04 14:40:32 +02:00