24659 Commits

Author SHA1 Message Date
Jakub Konka
7b5bd3a93f
Merge pull request #16097 from ziglang/macho-faster-uuid
macho: parallelize UUID hash calculation at the expense of full compatibility with ld64
2023-06-21 00:03:52 +02:00
d18g
939e4d81e1 Update objcopy.zig
Fix `--only-section=` handling
2023-06-20 13:12:19 -07:00
begly
da1f457e3b Fix Typo in langref.html.in 2023-06-20 11:51:11 -07:00
Jacob Young
9eb008717b std: prevent random CI failures 2023-06-20 10:56:23 -07:00
Jacob Young
51cbb081e9 wasm: fix decl alignment 2023-06-20 11:36:50 -04:00
Jakub Konka
eb1050b83a macho: fix 32bit compilation issues 2023-06-20 10:08:54 +02:00
Andrew Kelley
a72d634b73
Merge pull request #16046 from BratishkaErik/issue-6128
Renaming `@xtoy` to `@YfromX`
2023-06-19 22:36:24 -07:00
dweiller
c6e2e1ae4b std.fmt: fix error set of formatDuration 2023-06-19 15:20:49 -07:00
Jacob Young
8bd07fb1be Sema: fix type in a @floatToInt safety check
Unblocks #15981
2023-06-19 13:53:44 -07:00
Jakub Konka
22540e5402 macho: exclude code signature padding from uuid calculation 2023-06-19 22:50:08 +02:00
Andrew Kelley
7d6fcf0831
Merge pull request #15012 from xxxbxxx/objcpy-elf-compress
objcopy: add support for --compress-debug-sections
2023-06-19 13:15:40 -07:00
Jacob Young
8fcc28d302 Module: add support for multiple global asm blocks per decl
Closes #16076
2023-06-19 13:12:04 -07:00
Eric Joldasov
a4d1edac8d stage1: update zig1.wasm after renaming "@XtoY" to "YfromX"
Note from Andrew: I re-ran update-zig1 on my pc and replaced this
commit.

Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
Signed-off-by: Andrew Kelley <andrew@ziglang.org>
2023-06-19 12:45:01 -07:00
Eric Joldasov
50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00
Eric Joldasov
a6c8ee5231 compiler: rename "@XToY" to "@YFromX", zig fmt: rewrite them
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:24 -07:00
Andrew Kelley
e6e8cacab9 std.mem.order: use for loop syntax
Not only does it look nicer, it's a performance enhancement for debug
builds since the safety checks are eliminated.
2023-06-19 12:07:32 -07:00
Jakub Konka
ef9d6331fc macho: clean up hasher interface 2023-06-19 20:33:27 +02:00
Josh Wolfe
32cb9462ff
std: Support user-provided jsonParse method. Unify json.Parser and json.parse* (#15705) 2023-06-19 11:21:37 -04:00
Jakub Konka
8087c134db macho: calculate UUID chunk size based on available thread count 2023-06-19 12:53:26 +02:00
Jakub Konka
c2554cf0f1 link-test: remove now obsolete UUID test for MachO 2023-06-19 11:33:06 +02:00
Jakub Konka
10aaf2983d macho: hash the entire file contents for UUID but calc in parallel 2023-06-19 11:26:56 +02:00
Jakub Konka
b3a2ab3fed macho: extract parallel hasher into a generic helper struct 2023-06-19 10:29:39 +02:00
Xavier Bouchoux
c39191a086 objcopy: add support for --compress-debug-sections 2023-06-19 08:51:03 +02:00
Xavier Bouchoux
5eacddce99 objcopy: support some more elf file variants
"SHT_NOBITS" sections can be easily moved around in the file, they can be anywhere since there is no data...

and remove logic about the categorization of symbol tables:
  I don't understand or remember why it was needed,
  and, in my tests, it works fine without...

It previouly failed to strip an exe linked with `mold`
2023-06-19 07:29:39 +02:00
Manlio Perillo
423d7b848b test/src/Cases: fix incorrect code to find zig_lib_directory
The runCases function incorrectly called the introspect.findZigLibDir
function, causing a possible error, depending on the location of the
local cache directory, since the current executable is check-case.

Use findZigLibDirFromSelfExe, passing the zig_exe_path argument.

The current CI scripts work correctly because ZIG_LOCAL_CACHE_DIR is set
to "$(pwd)/zig-local-cache".

Fixes #15044
2023-06-18 18:20:42 -07:00
Jan Philipp Hafer
539e0b0469 compiler_rt: fixup exports of PPC routines
PPC targets can also use the functionality-equivalent standard routine, so
unconditionally export the standard routine.

Fixup of #16054 merged in f043071cdfb956ff16b1441c9d01ce43eea9fb7b.
2023-06-18 15:27:47 -07:00
Andrew Kelley
28862dd30c
Merge pull request #16080 from squeek502/windows-vt
windows: detect ANSI support in more terminals
2023-06-18 13:36:59 -07:00
Andrew Kelley
3ef91233ca
Merge pull request #15867 from devnexen/haiku_malloc_usable_size
std.c: haiku also supports malloc_usable_size to benefit zig's heap
2023-06-18 12:44:08 -07:00
r00ster91
2839e35d1c std.math.isPowerOfTwo: add tests and doc comment and improve assert
The assert is changed from `int != 0` to `int > 0` because negative
integers always return `false`.
Python's `math.log2` does the same and errors for 0 or negative integers.
2023-06-18 10:42:03 -07:00
Arya-Elfren
c13ac52972 Fix a confusing comment in langref.html.in 2023-06-18 09:19:23 -07:00
David CARLIER
54ea0bbcdd std.c: exposing timer api 2023-06-18 08:09:42 -07:00
Loris Cro
c17a8df2fa
Merge pull request #16087 from der-teufel-programming/master
autodoc: Fix rendering of function arguments named `_`
2023-06-18 16:43:30 +02:00
Krzysztof Wolicki
e9da87866c autodoc: Fix rendering of function arguments named _ 2023-06-18 14:41:49 +00:00
Loris Cro
3180a371e8
Merge pull request #16086 from der-teufel-programming/master
autodoc: Handle more InternPool.Index types properly in Autodoc
2023-06-18 16:21:16 +02:00
Krzysztof Wolicki
e7fd70a951 autodoc: Handle more InternPool.Index types properly in Autodoc 2023-06-18 14:07:09 +00:00
Loris Cro
329a585fbe
Merge pull request #15512 from cryptocode/autodoc-searchkey
autodoc: Add / as an alternative search key
2023-06-18 09:06:51 +02:00
Loris Cro
216ef10dc4
Merge branch 'master' into autodoc-searchkey 2023-06-18 09:06:40 +02:00
Ryan Liptak
5439f36c97 Remove unnecessary isatty call from supportsAnsiEscapeCodes
isatty on Windows is implemented as a isCygwinPty call and a GetConsoleMode call, so calling isatty just duplicates the function calls we already need to do in supportsAnsiEscapeCodes.
2023-06-17 23:36:10 -07:00
Christofer Nolander
59a12cd293 windows: detect ANSI support in more terminals 2023-06-17 23:30:17 -07:00
Mizuochi Keita
729a051e9e std.http: Fix segfault while redirecting
Make to avoid releasing request's connection twice.
Change the `Request.connection` field optional. This field is null while the connection is released.

Fixes #15965
2023-06-17 21:58:33 -07:00
Andrew Kelley
e23d48e61a
Merge pull request #15511 from mikdusan/netbsd-pkgsrc
netbsd: pkgsrc
2023-06-17 14:22:43 -07:00
Andrew Kelley
e3736baddb
Merge pull request #15501 from matu3ba/win_rmwithposix
std.windows: use posix semantics to delete files, if available
2023-06-17 14:21:15 -07:00
Andrew Kelley
8d0a8c2859
Merge pull request #15265 from tiehuis/optimize-udivmod
optimize udivmod
2023-06-17 14:19:07 -07:00
Andrew Kelley
8a6c3d26c1
Merge pull request #15010 from xxxbxxx/zlib-compress
Add zlib stream writer
2023-06-17 14:14:16 -07:00
Xavier Bouchoux
67b3e07260 zlib: naming convention
Adress review comments from https://github.com/ziglang/zig/pull/13977
by using the same naming convention as zstd.

And by using `finish()` instead of `close()` for the finalisation of the compressed stream.
rationale:
  - it is not the same as how close() is usually used, since it must be called to flush and write the final bytes. And as such it may fail.
  - it is not the same `flush` in the deflate code, which allows to keep writting more bytes later, and doesn't write the final checksum.
  - it is the same name as used in the original zlib library (Z_FINISH)

Also, use a packed struct for the header, which seems a better fit.
2023-06-17 14:08:05 -07:00
dantecatalfamo
8b92354396 std: add zlib stream writer 2023-06-17 14:07:45 -07:00
Andrew Kelley
9370fb8b81
Merge pull request #14844 from perillo/fix-issue-13280
Fix issue 13280
2023-06-17 13:37:28 -07:00
Manlio Perillo
366e3c657f
Langref misc fix and improvement (#14695)
* langref: improve the Hello World section

Clarify that a Zig source file must have the .zig extension.

Fix a typo.

* langref: improve the Comments section

  - Document how doc comments are used by -femit-docs
  - Rename "Doc comments" to "Doc Comments", for consistency
  - Clarify that placing a doc comment in an unexpected place is a
    compiler error and add two incorrect examples
  - Document the current Autodoc behavior, when normal comments are
    interleaved with doc comments
  - Rewrite the documentation for top-level doc comments

* langref: improve the Zig Test section

Document that the test name can also be an identifier, in addition to a
string literal.

Update the test output for the first test.

Closes #14085
2023-06-17 16:35:50 -04:00
r00ster91
6e84f46990 std: replace builtin.Version with SemanticVersion 2023-06-17 13:17:34 -07:00
Andrew Kelley
96acc204b2
Merge pull request #16052 from mikdusan/bsd-getdents
fix bad return types for BSDs getdents and debitrot openbsd
2023-06-17 13:01:52 -07:00