Commit Graph

22107 Commits

Author SHA1 Message Date
kcbanner 0471eea0e2 build: first pass on geting stage3 building under x64_64-windows-msvc 2023-01-04 21:45:05 -05:00
kcbanner c3945d9ede cmake: output binaries to the build directory (ie. instead of Release/Debug subfolders) 2023-01-04 21:45:05 -05:00
kcbanner 4ffc2bbb5e cmake: handle llvm system libraries separately from the llvm libraries themselves, to fix path issues on windows 2023-01-04 21:45:05 -05:00
Michael Dusan ed23615638 behavior: add test for #8277
Test `@sizeOf` reified union with zero-size payload fields.

closes #8277
2023-01-04 15:48:00 -05:00
Casey Banner 09ff03a57a debug: replace RtlCaptureStackBackTrace (which was spuriously failing) with a new implementation which uses RtlVirtualUnwind instead (#12740)
windows: add RtlCaptureContext, RtlLookupFunctionEntry, RtlVirtualUnwind and supporting types
windows: fix alignment of CONTEXT structs to match winnt.h as required by RtlCaptureContext (fxsave instr)
windows aarch64: fix __chkstk being defined twice if libc is not linked on msvc

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2023-01-04 14:54:49 -05:00
Casey Banner a3e2ee0911 Fix another LockViolation case on Windows (#14162)
- Add an assert that an exclusive lock is help to writeManifest
- Only call writeManifest in updateCObject if an exclusive lock is held
- cache: fixup test to verify hits don't take an exclusive lock, instead of writing the manifest
2023-01-04 14:51:43 -05:00
Andrew Kelley 9ed4a93ae7 Merge pull request #14189 from kcbanner/cbe_fix_float_from_repr 2023-01-04 13:44:53 -05:00
Veikka Tuominen 83fd45d820 Merge pull request #13786 from ziglang/tty-detection
stage2: make --color on affect progress bar too
2023-01-04 16:54:46 +02:00
kcbanner ee9a793d83 zig.h: fixup for -Wexpansion-to-defined 2023-01-04 02:23:15 -05:00
kcbanner 6d0c921379 cbe: revert movement of zig_float_from_repr to before float typedefs 2023-01-04 01:26:02 -05:00
Maciej 'vesim' Kuliński 2b9478ce12 Sema: implement AVR address spaces
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2023-01-04 01:26:50 +02:00
Felix Queißner fd0fb26aba Implements std.ArenaAllocator.reset() (#12590)
Co-authored-by: Felix "xq" Queißner <xq@random-projects.net>
2023-01-03 15:15:20 -05:00
Andrew Kelley 8d64e5283a Merge pull request #12586 from MasterQ32/std_memory_pool
Adds std.heap.MemoryPool
2023-01-03 14:53:54 -05:00
joachimschmidt557 09122650ba stage2 AArch64: bump up alignment of stack items fitting in regs
This enables us to use more efficient loading and storing for these
small stack items
2023-01-03 19:56:09 +01:00
Michael Dusan 8032ecb730 stage3 macos: enable -headerpad_max_install_names
This pads the install names area in final (stage3) zig executable on
macos. The executable size grows by 4096 bytes, or roughly 0.002% .

closes #13388
2023-01-03 19:45:09 +01:00
Loris Cro 755f50a986 autodoc: restore generic function functionality
latest changes to zir encoding broke simple return type detection
2023-01-03 18:20:06 +01:00
Veikka Tuominen abd005f302 Sema: do not immediately destroy failed generic instantiation
Closes #12535
Closes #12765
Closes #12927
2023-01-03 18:38:15 +02:00
Loris Cro daeb992c73 Merge pull request #14166 from McSinyx/lowkey
autodoc: show binding in lowercase
2023-01-03 16:30:05 +01:00
Luuk de Gram 7935135767 Merge pull request #14157 from Luukdegram/wasm-linker-misc
wasm-linker: various fixes & improvements
2023-01-03 15:47:16 +01:00
Veikka Tuominen 95fe23f572 docgen: handle 'K' and 'D' escape codes 2023-01-03 14:03:43 +02:00
Andrew Kelley a31ff072d1 stage2: make --color on affect progress bar too
Before, --color on would affect colored compile error printing but not
affect terminal progress bar printing. It was intended for this option
to affect both; now it does.

This causes a failure when building the language reference, which
contains code for parsing terminal output and rendering HTML. Now it
must be expanded to handle 'K' and 'D' codes to simulate a terminal
cursor moving, and the CI will fail until that capability is added in a
later commit of this branch.

I extracted this change from #13560 so that the idea is not lost but we
can solve this issue separately.
2023-01-03 13:46:47 +02:00
Jordan Lewis 1ec74f1b70 math: implement absInt for integer vectors
This commit adds support to absInt for integer vectors.
2023-01-03 13:30:24 +02:00
Evin Yulo fc07e1a267 Document tuple syntax
Closes #13837
2023-01-03 13:29:27 +02:00
Guillaume Wenzek a44085dc2a add -fopt-bisect-limit 2023-01-03 13:05:09 +02:00
Lee Cannon 93bdd04e88 std.log: add functionality to check if a specific log level and scope are enabled 2023-01-03 13:02:32 +02:00
Sizhe Zhao 4fa027a3cc docs: Clarify that std.fs.path.resolve doesn't resolve relative path to
absolute path
2023-01-03 12:49:05 +02:00
Chris Boesch 1de96a2cc4 Add the two functions 'getLast' and 'getLastOrNull' to ArrayListAligned/ArrayListAlignedUnmanaged. 2023-01-03 12:48:20 +02:00
mlugg 8094fa5d48 std: add meta.FieldType
This is simply a small convenience wrapper around
'meta.fieldInfo(T, .field).type'. However, this operation is common
enough that it makes sense to have its own function for.
2023-01-03 12:47:48 +02:00
Luuk de Gram b9224c172f wasm-linker: Fix & mangle symbol name of imports
When outputting the names section, we should output the actual symbol
name rather than the import name. This makes sure that symbols with
an explicit name set have the correct name but retain the import name
too.

We also now correctly mangle the name of an extern function with an
explicit library name. This ensures that functions that have a
different library name, but the same import/function name, can be
resolved correctly with other modules and don't resolve to the
same symbol.
2023-01-03 10:02:54 +01:00
Andrew Kelley 5bd69c655d zig.h: support GCC compilers that lack __has_builtin 2023-01-03 03:21:53 -05:00
Andrew Kelley c9ef277fa7 Merge pull request #13980 from ziglang/std.net
networking: delete std.x; add std.crypto.tls and std.http.Client
2023-01-03 02:43:50 -05:00
Nguyễn Gia Phong c91adbbde7 autodoc: show binding in lowercase
<S-s> is not bound and shortcuts popup already use lowercase.
2023-01-03 15:11:44 +09:00
Andrew Kelley 8bd734d60c Merge pull request #13699 from mikdusan/bsd
give BSDs some attention
2023-01-03 00:57:25 -05:00
Andrew Kelley 7178451d62 std.crypto.tls.Client: make close_notify optional
Although RFC 8446 states:

> Each party MUST send a "close_notify" alert before closing its write
> side of the connection

In practice many servers do not do this. Also in practice, truncation
attacks are thwarted at the application layer by comparing the amount of
bytes received with the amount expected via the HTTP headers.
2023-01-02 18:27:38 -07:00
Michael Dusan 7798af7461 dragonfly: pass test: lib/std/std.zig 2023-01-02 19:18:33 -05:00
Michael Dusan 571b817abc freebsd: add std.c.arc4random_buf 2023-01-02 19:18:33 -05:00
Michael Dusan 69553d60da dragonfly: add std.c.arc4random_buf
This allows for a more optimal std.crypto.tlcsprng codepath.

Without it a an "incorrect alignment" panic is triggered from
crypto.tlcsprng which aligns a threadlocal but it's actually
not aligned, thus detected by the safety check.

It appears that LLVM-IR does attribute the storage with alignment
but it is ultimately not respected in the final binary for netbsd
and dragonfly.
2023-01-02 19:18:33 -05:00
Michael Dusan ef08894d37 build stage3: add more BSD support
- add netbsd
- add dragonfly
- fixup freebsd
2023-01-02 19:18:33 -05:00
Michael Dusan 46c3b09165 std.Target: bump semver max for BSDs
- freebsd, netbsd, openbsd, dragonfly
2023-01-02 19:18:33 -05:00
Michael Dusan e752606464 netbsd: getFdPath: F_GETPATH implementation 2023-01-02 19:18:33 -05:00
Michael Dusan 1a403383c9 dragonfly: port libc++
- https://github.com/DragonFlyBSD/DPorts/tree/master/devel/libc++/files
  for hints as to which patches are needed
2023-01-02 19:18:33 -05:00
Michael Dusan 7da9348637 dragonfly: getFdPath: F_GETPATH implementation 2023-01-02 19:18:33 -05:00
Michael Dusan 7f012eef0b freebsd: memfd_create: < 13.0 version check
- add conditional compile error
- add conditional skip test
2023-01-02 19:18:33 -05:00
Michael Dusan bd071c98a5 freebsd: getFdPath: handle NameTooLong 2023-01-02 19:18:33 -05:00
Michael Dusan 537624734c freebsd: getFdPath: < 13.1 fallback impl 2023-01-02 19:18:32 -05:00
Michael Dusan 4cdbde55b4 macos: getFdPath: handle E.NOSPC
- per darwin-xnu source, fcntl F_GETPATH will return ENOSPC when path
  exceeds either user-supplied buffer or system MAXPATHLEN
- macOS does not document this (and other) possible errno values
2023-01-02 19:18:32 -05:00
Michael Dusan e872c72c55 std.fs: add NAME_MAX for openbsd and netbsd 2023-01-02 19:18:32 -05:00
Michael Dusan 0cb8ed6b85 cmake: ignore case for TARGET ARCH/OS mapping
- first convert to lower-case then perform mappings
- effect: freebsd, netbsd and openbsd convert arch `amd64` to `x86_64`
- effect: convert `arm64` to `aarch64`
2023-01-02 19:18:32 -05:00
Michael Dusan d78a2619ba link.Elf: resolve CsuObjects TODO 2023-01-02 19:18:32 -05:00
Andrew Kelley 9ca6d67345 std.crypto.tls.Certificate: make the current time a parameter 2023-01-02 16:57:16 -07:00