Commit graph

25392 commits

Author SHA1 Message Date
Andrew Kelley
aeb866687d CI: install ninja on windows
The new CI images provided by GitHub no longer provide ninja.exe, so
this commit installs it explicitly, using the suggested method from
GitHub.

See https://github.com/actions/runner-images/issues/8343 for more
details.
2024-01-29 14:41:11 -07:00
Andrew Kelley
bab328d5e8 Revert "CI: update tarballs to newest zig+llvm"
This reverts commit 83b73e1e36.

Oops. I forgot that 0.11.x is on LLVM 16, not 17.
2024-01-29 14:32:11 -07:00
Andrew Kelley
612b177201 Merge pull request #16783 from squeek502/fs-too-many-parent-dirs
Windows: Fix `TooManyParentDirs` handling for paths that shouldn't be cwd-relative
2024-01-29 14:30:36 -07:00
Andrew Kelley
1b88ce3b0c Merge pull request #16788 from xxxbxxx/objcopy-step
build/ObjCopy: strip debug info to a separate elf file
2024-01-29 14:30:26 -07:00
snoire
2d4e24dd6b Fix incorrect lib search paths in README
The README contains a typo stating 'zig/lib/' and '../zig/lib/' as the lib search paths. This should be 'lib/zig' and '../lib/zig'.
2024-01-29 14:30:16 -07:00
jaina heartles
b8565dd62f std.http.Server: use correct header for Transfer-Encoding 2024-01-29 14:29:44 -07:00
Ali Chraghi
d168579b6f Build.ConfigHeader: render identifiers 2024-01-29 14:29:34 -07:00
Xavier Bouchoux
c0fd64af03 Sema: fix coerceArrayLike() for vectors with padding
as explainded at https://llvm.org/docs/LangRef.html#vector-type :

"In general vector elements are laid out in memory in the same way as array types.
Such an analogy works fine as long as the vector elements are byte sized.
However, when the elements of the vector aren’t byte sized it gets a bit more complicated.
One way to describe the layout is by describing what happens when a vector such
as <N x iM> is bitcasted to an integer type with N*M bits, and then following the
rules for storing such an integer to memory."

"When <N*M> isn’t evenly divisible by the byte size the exact memory layout
is unspecified (just like it is for an integral type of the same size)."
2024-01-29 14:29:14 -07:00
Matt Knight
d1dd5aeb07 Compare user input for multiple dependency build variants (#16600) 2024-01-29 14:28:55 -07:00
Michael Dusan
6ef836bfff linux: search for system libc++
When linking system llvm/clang/lld, add system libc++ to the searchlist.
This is needed for certain distros (eg. chimera linux).

closes #16754
2024-01-29 14:28:32 -07:00
Andrew Kelley
9f88b3ae89 Merge pull request #16752 from jacobly0/generic-srclocs
Sema: fix issues with source locations of generic arguments
2024-01-29 14:27:17 -07:00
Andrew Kelley
baf5b4bc86 Merge pull request #16707 from marler8997/jsonStringifyBigNumbers
std.json: fix roundtrip stringify for large integers
2024-01-29 14:26:20 -07:00
Robin Voetter
eaf9ac77d6 llvm: add const addrspace cast 2024-01-29 14:24:49 -07:00
Jacob Young
aee3dd91af cbe: don't emit traps in naked functions
Closes #16680
2024-01-29 14:24:25 -07:00
none
e35271856e wyhash: keep tail bytes on iterative update
Update calls with input longer then one block must ensure that
last sixteen bytes are available when final is called.

Fixes #16695
2024-01-29 14:24:17 -07:00
Jacob Young
8c94e993e4 Sema: fix issues passing an invalid type to a generic method
Closes #16601
2024-01-29 14:20:52 -07:00
Prcuvu
c118c45125 cmake: Fix typo: elif → elseif 2024-01-29 14:20:45 -07:00
Andrew Kelley
3972c14827 update .mailmap 2024-01-29 14:20:28 -07:00
David Gonzalez Martin
199e0c8ffe debug: expose module debug info deinitialization
Before this commit, you could use readElfDebugInfo independently with
one catch: the data is not freed since the deinitialization functions
for ModuleDebugInfo are private. This change makes them public so the
    users of such function and similar can free the memory after the
    debug symbols have been used.
2024-01-29 14:20:16 -07:00
Jeremy Volkman
413a6b4096 Fix typo: headerpat -> headerpad 2024-01-29 14:19:37 -07:00
Andrew Kelley
83b73e1e36 CI: update tarballs to newest zig+llvm 2024-01-29 14:15:15 -07:00
Andrew Kelley
d947660559 CI: enable testing for 0.11.x branch 2023-08-29 13:33:03 -07:00
Andrew Kelley
3b046d76b7 start the 0.11.1 release cycle 2023-08-29 13:32:30 -07:00
Andrew Kelley
67709b6382 Release 0.11.0 2023-08-03 11:22:03 -07:00
Krzysztof Wolicki
b317ca4d6f autodoc: Added line_comment tokens to ziglexer.js tokenizer 2023-08-03 19:07:33 +02:00
Andrew Kelley
c4e62be62e
Merge pull request #16058 from ziglang/frontend-lib-paths
compiler: resolve library paths in the frontend
2023-08-03 09:53:18 -07:00
Andrew Kelley
d0fd67cffe std.zig.system.NativePaths: remove bad framework dir
This path actually has nothing useful in it.
2023-08-03 09:52:15 -07:00
Jakub Konka
f96d773d98 macho: append syslibroot to search dirs when resolving libSystem 2023-08-03 09:52:15 -07:00
Andrew Kelley
72fb58f107 CLI: fix a typo that made static/dynamic do the opposite 2023-08-03 09:52:15 -07:00
Andrew Kelley
4923e64199 Compilation: detect sysroot from libc installation 2023-08-03 09:52:15 -07:00
Andrew Kelley
4089f96def darwin: pass -iframework to clang for system frameworks 2023-08-03 09:52:15 -07:00
Andrew Kelley
9dd9aa49a5 Compilation: fix incorrect non-optional assumption 2023-08-03 09:52:15 -07:00
Andrew Kelley
7360927afe CLI: add native paths only if ABI is also native 2023-08-03 09:52:15 -07:00
Andrew Kelley
c012f5d55d std.zig.system.darwin.isSdkInstalled: fix implementation
* don't assert that the child process doesn't crash
* don't give a false negative on warnings printed to stderr

Also fix getSdk from the same file in the same way
2023-08-03 09:52:15 -07:00
Andrew Kelley
e582a3642b std.zig.system.darwin: fix redundant names 2023-08-03 09:52:15 -07:00
Andrew Kelley
da91ef5c28 zig libc: restore functionality on macOS
Regressed in 2006add849.

References to native_darwin_sdk are no longer kept in the frontend.
Instead the darwin SDK is detected as part of NativePaths and as part of
LibCInstallation.
2023-08-03 09:52:15 -07:00
Andrew Kelley
c94bbebb91 std.zig.system.NativePaths: simplify and integrate with Darwin SDK 2023-08-03 09:52:15 -07:00
Andrew Kelley
ea0e6e737b CLI: reduce code size bloat
Make a bunch of ArrayList objects use arena instead of gpa, eliminating
the `defer` expressions, which reduces code size of zig1.wasm by 1%
2023-08-03 09:52:15 -07:00
Andrew Kelley
469af67804 CLI: delete redundant logic and use null instead of undef
The `null` value here was missed in
0a4d4eb252a73555a568a532902951a13284d2ef. I hope it is the cause of the
CI failures on Windows.

The fact that libc++ depends on libc is not important for the CLI and
Compilation.create already handles that logic.
2023-08-03 09:52:15 -07:00
Andrew Kelley
d7e74f7cbf CI: fix path to output langref
Apparently tidy doesn't exit with failure status if the input file is
not found? wtf tidy
2023-08-03 09:52:15 -07:00
Andrew Kelley
6ce37845af build.zig: use InstallArtifact Options instead of mutation
I expect this to have no functional change.
2023-08-03 09:52:15 -07:00
Andrew Kelley
aef8bcf776 std.Build.Step.Compile: fine-grained system lib search control
For each library you can specify the preferred mode and search strategy.

The old way of setting global state is eliminated.
2023-08-03 09:52:15 -07:00
Andrew Kelley
a0e94ec576 CLI: add -search_paths_first_static to complete the API
There was no previous way to set preferred mode static, search strategy
paths_first.
2023-08-03 09:52:15 -07:00
Andrew Kelley
986a3d23ab frontend: make SystemLib.path optional
This can be null in two cases right now:
1. Windows DLLs that zig ships such as advapi32.
2. extern "foo" fn declarations where we find out about libraries too late
TODO: make this non-optional and resolve those two cases somehow.
2023-08-03 09:52:14 -07:00
Andrew Kelley
e565ff305a CLI: revert -l behavior
chicken out and make -l match the status quo behavior, where it looks
for dynamic libraries and then falls back to static libraries.

library resolution is still done in the CLI now though, and these
options are added:

-search_static_first           Search for static libs in all library search
                               paths, then dynamic libs.
-search_dylibs_only            Only search for dynamic libs.
-search_static_only            Only search for static libs.

this matches the already existing options below:

-search_paths_first            For each library search path, check for dynamic
                               lib then static lib before proceeding to next path.
-search_dylibs_first           Search for dynamic libs in all library search

So, it is still possible to get the strict behavior by passing
`-search_dylibs_only` or `-search_static_only`.

This commit also makes -dynamic and -static affect the preferred link
mode and search strategy.
2023-08-03 09:52:14 -07:00
Andrew Kelley
9e50f96087 MachO: put system_libs into libs not positionals
Putting them in both causes collisions because the same lib ends up
being linked in twice.

Putting them in positionals instead of libs makes their properties about
needed and weak being ignored.
2023-08-03 09:52:14 -07:00
Andrew Kelley
2725c20a72 coff: always link uuid.lib as part of mingw libc 2023-08-03 09:52:14 -07:00
Andrew Kelley
e477352af3 CLI: Windows: system DLLs no longer trigger native paths detection 2023-08-03 09:52:14 -07:00
Andrew Kelley
c65a061881 CLI: adjust order of operations of system libraries
First, system_libs are collected into a list. This is the same as
before.

Next, system_libs are filtered into external_system_libs, which is the
same list but without any libc, compiler_rt, etc.

At this point, if there are any external system libs, native library
directory paths are detected and added to lib_dirs.

Finally, extern_system_libs are filtered into resolved_system_libs,
which has full paths to all of the libraries. This is the list passed
into Compilation.

This makes the required changes noted by @ifreund in the code review for
this branch.
2023-08-03 09:52:14 -07:00
Andrew Kelley
256074428f frontend: update is_libc_lib_name for mingw-w64 crt files 2023-08-03 09:52:14 -07:00