Commit Graph

3145 Commits (5f7b97e84c7e2bc7682510e97996ad30147026d0)

Author SHA1 Message Date
Luna 5f7b97e84c add AddressFamilyNotSupported to SendError 2020-12-07 16:40:03 -05:00
xackus 85dc039632 std.c: freeing null is a no-op 2020-12-07 16:33:27 -05:00
Andrew Kelley 1c5606af9f update to latest clang C headers 2020-12-04 15:39:16 -07:00
LemonBoy fd8fa55129
std: Add a few helpers for matching ascii strings (#7300)
* startsWithIgnoreCase
* endsWithIgnoreCase
2020-12-04 15:27:28 -05:00
LemonBoy ac443b941d std: Restore file locking test on Windows
Make it even more robust wrt timing problems.

Closes #7010
2020-12-04 12:24:50 -08:00
Andrew Kelley 58241364cb add more mingw-w64 .def files
closes #7268
2020-12-03 18:03:34 -07:00
Isaac Yonemoto fd18252a71 makes the implementation public 2020-12-03 15:14:59 -08:00
Isaac Yonemoto a2cd9dc3bd
Gpa mutex configurable (#7234)
* makes the mutex for the gpa configurable

* fixed logic, added test

* updates docstring; pushes logic to one place, better duck-type
2020-12-03 15:49:35 -05:00
Miles Alan 7bbd369fbb std/event: Fix import path for WaitGroup 2020-12-03 12:43:55 -08:00
Jakub Konka a8e543bd6b
Merge pull request #7280 from leecannon/master
Add `readUntilDelimiterOrEofArrayList` & `readUntilDelimiterOrEofAlloc`
2020-12-03 21:03:48 +01:00
Lee Cannon f598245836 Make zig fmt happy with multiline arguments for `readAllArrayListAligned` 2020-12-03 10:24:49 +00:00
LemonBoy cb63ecd6e9 std: Add nosuspend around stderr.print calls 2020-12-02 16:34:51 -08:00
Vexu d4c167f3cd std.build: addBuildOption special handling for SemanticVersion 2020-12-02 16:33:27 -08:00
Andrew Kelley f842327147
Merge pull request #7277 from LemonBoy/thread-posix
std: make the use of pthread_join POSIX-compliant
2020-12-02 13:47:40 -08:00
Mathieu Guay-Paquet 4c8632e244 fix the tinyest typo 2020-12-02 19:08:25 +02:00
Lee Cannon 76f3921544 Add `readUntilDelimiterOrEofArrayList` & `readUntilDelimiterOrEofAlloc` 2020-12-02 12:55:54 +00:00
LemonBoy f8cef32f27 std: make the use of pthread_join POSIX-compliant
Applications supplying their own custom stack to pthread_create are not
allowed to free the allocated memory after pthread_join returns as,
according to the specification, the thread is not guaranteed to be dead
after the join call returns.

Avoid this class of problems by avoiding the use of a custom stack
altogether, let pthread handle its own resources.

Allocations made on the child stack are now done on the C heap.

Thanks @semarie for noticing the problem on OpenBSD and suggesting a
fix.

Closes #7275
2020-12-02 10:59:35 +01:00
daurnimator db0cb54f4e
Localhost is special (#6955)
* std: always return loopback address when looking up localhost

* std: also return Ipv6 loopback

* std: remove commented out obsolete code
2020-12-01 19:13:59 -05:00
Andrew Kelley c7028ce0c6 COFF linking: fix incorrectly passing .dll instead of .lib
commit 9d1816111d used the "output path"
as the path for passing shared library artifact paths to the Zig CLI.
For Windows, this was incorrect because it would pass the .dll instead
of the .lib file. This commit passes the "output lib path" instead,
which makes it pass the .lib path in case of a .dll on Windows.

This way the linker does not complain and say, "bad file type. Did you
specify a DLL instead of an import library?"
2020-12-01 11:28:44 -07:00
Andrew Kelley 02e12ede46 update to latest fetch-them-macos-headers
commit 1efc3a7f584dd75a5783756e168af74cdf6bb727
2020-11-30 20:20:31 -08:00
Isaac Freund 92ec24f77c std/os: remove unneeded error from accept errorset
POSIX compliant fnctl cannot return EPERM when getting/setting the given
flags. See the specification here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
2020-11-30 20:00:26 -08:00
Andrew Kelley 21565ca991 restore -target wasm32-freestanding-musl for C headers
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.
2020-11-30 20:44:36 -07:00
Andrew Kelley 9d1816111d build system: pass dyn lib artifacts as positionals 2020-11-30 18:12:00 -07:00
Alexandros Naskos f7d0a32045 Switched OBJECT_NAME_INVALID handling to unreachable in faccessatW 2020-11-30 18:08:27 -07:00
Alexandros Naskos beb9d33d6d Disallow absolute paths passed as system libraries
Added OBJECT_NAME_INVALID handling in faccessatW
2020-11-30 18:08:27 -07:00
Andrew Kelley ff9798eb26 rework the bundle compiler-rt feature
* it is now -fcompiler-rt and -fno-compiler-rt to override the (quite
   reasonable) default of bundling compiler-rt only for executables and
   dynamic libraries.
   - the build.zig API is still called bundle_compiler_rt however it is
     now an optional bool instead of a bool. leaving it as `null` means
     to use the compiler default.
 * renamed some internal identifiers to make the source more readable
 * additionally support -fcompiler-rt when doing build-obj for ELF files
   since that target already supports linking multiple objects into one.
   - includes an error message when attempting this for non-ELF. in the
     future this could additionally be supported with a more advanced
     implementation that does not rely on the linker.
 * properly populate the linker cache hash
2020-11-30 16:35:00 -07:00
Andrew Kelley 51d7c14ce1 update to latest fetch-them-macos-headers
commit 09b70199e738bfa86c55cd3a848287229a207982

closes #7261
2020-11-30 13:18:34 -08:00
Andrew Kelley 50a336fff8 move std.SegmentedList to the std-lib-orphanage
I spent a long time working on this data structure, and I still think
it's a neat idea, but it has no business being in the std lib.

I'm aware of the few remaining references to SegmentedList that exist in
the std lib, but they are dead code, and so I'm leaving the dead
references as a clue that the code is dead. Cleaning up dead code will
be a separate effort that involves code coverage tools to make sure we
find it all.

std-lib-orphanage commit: 2c36a7894c689ecbaf63d5f489bb0c68773410c4

closes #7190
2020-11-30 13:04:26 -07:00
Jonathan Marler b587a42233 add std.os.shutdown function for sockets 2020-11-30 11:25:03 -08:00
Michael Freundorfer baa075ac8c Fix WindowsDynLib.openW trying to strip the \??\ prefix when it does not exist 2020-11-30 11:12:33 -08:00
Rageoholic 0369b65082
Switch to using unicode when parsing the command line on windows (#7241)
* Switch to using unicode when parsing the command line on windows

* Apply changes by LemonBoy and *hopefully* fix tests on MIPs

Co-authored-by: LemonBoy <LemonBoy@users.noreply.github.com>

* Fix up next and skip

* Move comment to more relevant place

Co-authored-by: LemonBoy <LemonBoy@users.noreply.github.com>
2020-11-30 13:47:01 -05:00
Jonathan Marler b8f09f773a fix memory leak in BufMap 2020-11-30 10:40:16 -08:00
Andrew Kelley 4808a0261f macOS headers: add memory.h
it's provided by macOS LibC and apparently there is code in the wild
that depends on it. all it does is #include <string.h>

closes #7249
2020-11-29 17:41:16 -08:00
Jonathan Marler 48660371a2 std.meta: add assumeSentinel 2020-11-29 10:36:02 -08:00
Andrew Kelley e701ac1a51
Merge pull request #7237 from koachan/sparc64-longdouble_fork
Add "long double" mapping and implement fork() on Linux/sparc64
2020-11-29 10:33:43 -08:00
LemonBoy 89ee4b8621 std: Avoid deadlock in the signal handler
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
2020-11-29 10:31:06 -08:00
Koakuma f10bff9ffb Add a comment to explain the fork return values on sparc64 2020-11-28 13:24:24 +07:00
christian-stephen abc729a5f9 Add readAllArrayListAligned to Reader which can accept an arbitrary alignment 2020-11-27 17:00:50 -08:00
Andrew Kelley 9e4360c335
Merge pull request #7198 from LemonBoy/freebsd-lock
std: Fix file locking logic for BSD targets
2020-11-27 14:35:30 -08:00
Koakuma 41c40f4bbe Fix fork() on Linux/sparc64
fork() on Linux/sparc64 seems to return its result in two registers,
with %o0 always holding the current process' PID, and the parent/child
status returned in %o1. Add some glue code to convert those into
the libc-style return value.
2020-11-27 23:02:22 +07:00
Jakub Konka a6e93da717 stage2 macho: generate a code sig (not valid yet) 2020-11-26 11:50:09 +01:00
Jakub Konka 9dcf7ee9c9 stage2 macho: add info about __TEXT segment 2020-11-26 11:50:09 +01:00
Jakub Konka 79381dc4fb stage2 macho: add empty CodeDirectory blob 2020-11-26 11:50:09 +01:00
Jakub Konka e8dd62accd stage2 macho: fix incorrect rebase 2020-11-26 11:50:09 +01:00
Jakub Konka 1bec531cf2 stage2 MachO: add source version load cmd 2020-11-26 11:50:09 +01:00
Jakub Konka 72310db1da stage2 MachO: add min OS version load cmd 2020-11-26 11:50:09 +01:00
Isaac Freund 58365c4e79 std/os: fix prctl constants 2020-11-25 15:45:55 -08:00
Andrew Kelley a06afa4579
Merge pull request #6411 from LemonBoy/fff
More std.fmt goodness
2020-11-25 15:43:19 -08:00
daurnimator b7b3c1dfae std: use mem.asBytes in Ip4Address.parse so it works at comptime 2020-11-25 15:40:46 -08:00
Frank Denis 83abb32247 std/crypto - edwards25519 precomp: prefer doublings over adds
Doublings are a little bit faster than additions, so use them half
the time during precomputations.
2020-11-25 15:37:43 -08:00