See #5854
Some tiny tweaks too:
* Use `wasm-freestanding-musl` instead of `wasm32-freestanding-musl`,
making it pointer-size-agnostic.
* Fix trying to build non-existent wasm musl start files.
Positional shared library arguments were not being detected as causing
dynamic linking, resulting in invalid linker lines. LLD did not have an
error message for this when targeting x86_64-linux but it did emit an
error message when targeting aarch64-linux, which is how I noticed the
problem.
This surfaced an error having to do with fifo.pipe() in the cat example
which I did not diagnose but solved the issue by doing the revamp that
was already overdue for that example.
It appears that the zig-window project was exploiting the previous
behavior for it to function properly, so this prompts the question, is
there some kind of static/dynamic executable hybrid that the compiler
should recognize? Unclear - but we can discuss that in #7240.
ZigTypeIdOptional types have a different way of specifying their payload
value depending on whether the child type is a pointer or not (plus some
other special cases).
Fixes#7251
stderr_mutex may still be held when we reach the signal handler, grab
our own stderr handle to print the error messages and avoid deadlocking.
Closes#7247
Make gen_const_ptr_struct_recursive aware of the possible presence of
some trailing padding by always bitcasting the pointer to its expected
type.
Not an elegant solution but makes LLVM happy and is consistent with how
the other callsites are handling this case.
Fixes#5398
Recent versions of cmake complain about it:
<<
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
>>
We don't require anything from version 2.8.5, and version 2.8.12 was
released in 2011, so it is very unlikely that anyone still uses 2.8.5.
Make the code used to calculate the variable slot index into the frame
match what's done during the structure layout calculation.
Prevents a few nasty LLVM errors when such types are passed around.
This is andrewrk's patch from ziglang#6724 (rebased)
CMake: Fix dependency problem
I don't know whether the error was expected cmake behavior or a bug.
This change seems to fix the issue. See ziglang#6724 for details.
cmake: add the correct set of zig stage2 sources
Make it behave like the read() wrapper for unix systems.
Reading the whole buffer breaks some use-cases like buffered readers
over sockets.
Closes#7121
The mismatch between the argument slot type in the frame structure and
the one used in the store operation made the generated code write
garbage over the nearby fields.
Fixes#7104
This intentionally diverges from the unix dirname command, as well as
Python and Node.js standard libraries, which all have this edge case
return the input path, unmodified. This is a footgun, and nobody should
have ever done it this way.
Even the man page contradicts the behavior. It says:
"strip last component from file name". Now consider, if you
remove the last item from an array of length 1, then you
have now an array of length 0. After you strip the last component, there
should be no components remaining. Clearly, returning the input parameter
unmodified in this case does not match the documented behavior. This is
my justification for taking a stand on this API design.
closes#6746closes#6727closes#6584closes#6592closes#6602