Embrace the Path abstraction, doing more operations based on directory
handles rather than absolute file paths. Most of the diff noise here
comes from this one.
Fix sorting of crtbegin/crtend atoms. Previously it would look at all
path components for those strings.
Make the C runtime path detection partially a pure function, and move
some logic to glibc.zig where it belongs.
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
* 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>
On s390x-linux, fstat() does not have nanosecond precision, but fstatat() does.
As a result, comparing Stat structs returned from these syscalls is doomed to
fail.