13264 Commits

Author SHA1 Message Date
Robin Voetter
5090d75e48
spirv: make load() and store() accept MemoryOptions
This struct is used to configure the load, such as to make
it volatile. Previously this was done using a single bool, but
this struct makes it shorter to write non-volatile loads (the
usual) and more clear whats going on when a volatile load is
required.
2023-10-21 17:46:52 +02:00
Robin Voetter
200bca360e
spirv: replace most use of spv.ptrType with self.ptrType
To support self-referential pointers, in the future we will
need to pass the Zig type to any pointer that is created. This
lays some ground work for that by replacing most uses of
spv.ptrType with a new ptrType function that also accepts the
Zig type. This function's contents will soon be replaced by
a version that also supports self-referential pointers.

Also fixed some bugs regarding the use of direct/indirect.
2023-10-21 17:46:50 +02:00
Jakub Konka
809e7aa4fc
Merge pull request #17638 from ziglang/elf-dwarf-fixes
dwarf: decouple DWARF formats from target pointer size + misc fixes
2023-10-21 16:14:40 +02:00
Andrew Kelley
bd1f96869e InternPool: fix incomplete hash of pointer values
There is this `common` prefix which was not getting passed in all union
tags of pointer vals, resumably making InternPool slower for pointer
values.
2023-10-20 20:02:35 -04:00
Andrew Kelley
328ec15d9c Revert "make distinct error limit configurable"
This reverts commit 78855bd21866b515018259a2194e036e4b3120df.

This commit did not replace uses of `Type.err_int` of which there are
currently 60 uses.

Re-opens #786
2023-10-20 14:03:55 -07:00
Jakub Konka
6dc45e7d31
Merge pull request #17621 from ziglang/elf-pic-pie
elf: actually check for dynamic executables
2023-10-20 22:33:44 +02:00
Andrew Kelley
7de893c085
Merge pull request #16817 from Sahnvour/shuffle-deps
std.Build: add --seed argument to randomize step dependencies spawning
2023-10-20 15:30:48 -04:00
Andrew Kelley
a361f37b1c
Merge pull request #17608 from squeek502/resinator-fixes
resinator: Fix `INCLUDE` var handling and sync with upstream
2023-10-20 03:49:14 -04:00
Michael Dusan
aa76ca2931 llvm: set PIE only for executables
closes #17575
2023-10-20 01:59:55 -04:00
Andrew Kelley
5d8bc56ab6
Merge pull request #15268 from DraagrenKirneh/feature/14475-minimum-zig-version
#14475 minimal_zig_version in build.zig.zon
2023-10-20 00:51:44 -04:00
Jacob Young
4d106076c3 link: initialize llvm before calling the llvm API 2023-10-19 16:51:11 -04:00
Jakub Konka
f4f5e9edd6 dwarf: bring back realpath resolution of include dirs 2023-10-19 22:41:59 +02:00
Jakub Konka
eb76ef58f8 dwarf: revert adding spurious and incorrect +1 to getDebugInfoEnd() 2023-10-19 21:56:47 +02:00
Jakub Konka
400faec10b dwarf: introduce Dwarf.Format to be able to select 32/64bit format at whim 2023-10-19 21:56:47 +02:00
Jakub Konka
4f66efdc7f dwarf: clean up and fix writing include dirs and files to debug line header 2023-10-19 21:56:47 +02:00
Jakub Konka
349dc05452 dwarf: remove obsolete sentinels from abbrev table 2023-10-19 21:56:47 +02:00
Andrew Kelley
10200970bb build system: fixups to --seed mechanism
* support 0x prefixed hex code for CLI seed arguments
* don't change the build summary; the printed CLI on build runner
  failure is sufficient
* use `std.crypto.random` instead of system time for entropy
2023-10-19 14:24:35 -04:00
Sahnvour
b87353a17f std.Build: add --seed argument to randomize step dependencies spawning
help detect possibly hidden dependencies on the running order of steps,
especially in -j1 mode
2023-10-19 14:24:35 -04:00
Jakub Konka
3768c95371 elf: actually check for dynamic executables 2023-10-19 15:57:58 +02:00
Jacob Young
fbbccc9d5f Builder: fix incorrect type for 32-bit systems 2023-10-19 08:06:44 -04:00
Jakub Konka
f3d23d9232
Merge pull request #17594 from ziglang/elf-atom-limit
elf: increase permissible Atom <-> input section resolution to u32 for Zig's module
2023-10-19 12:30:56 +02:00
Andrew Kelley
ae2cd5fe26 Revert "Never implicitly add rpaths for each lib dir, add NixOS libdir to rpath"
This reverts commit d7b73af8f65bb891c8700ed47777144bb6f35fe1.

I did not look at this closely enough. This is incorrect; it should not
implicitly add rpaths for every library, and it should not disable the
nice default of each_lib_path when compiling for the native OS.

See #16062 where we are working on a follow-up improvement to this.
2023-10-18 23:37:47 -07:00
Jakub Konka
470d887d80
Merge pull request #17593 from ziglang/elf-native-libc
elf: link against libc installation
2023-10-19 07:39:03 +02:00
Andrew Kelley
777af14b57 Package.Manifest: fix bitrotted unit tests 2023-10-18 18:59:13 -07:00
DraagrenKirneh
1882ff95e7 Package.Manifest: add minimum_zig_version field 2023-10-18 18:58:58 -07:00
Ryan Liptak
8ec04b567e Error if an .rc file uses the 'preprocess only' or 'no preprocess' flags 2023-10-18 18:30:32 -07:00
Ryan Liptak
81a61c8ecd Sync resinator with upstream and fix INCLUDE env var handling
The INCLUDE variable being used during `.rc` preprocessing was an accidental regression in https://github.com/ziglang/zig/pull/17412.
Closes #17585.

resinator changes:
source_mapping: Protect against NUL bytes in #line filenames
lex: Avoid recalculating column on every tab stop within string literals
Proper error handling for failing to open cwd instead of `catch unreachable`
Use platform-specific delimiter for INCLUDE env var parsing
2023-10-18 18:30:32 -07:00
Andrew Kelley
63f9af87d3 zig env: back to json output
changed my mind I liked it better before. this reverts
053119083c2c93cb1fc4129bc647c03301f4010d.
2023-10-18 15:50:00 -07:00
Andrew Kelley
ec21da0d51 compiler: fix LTO availability logic
Before this commit, the logic would fail with a "LTO not available"
error if the user set `-fno-lto` which doesn't make sense. This commit
corrects the logic to understand when the user is explicitly requesting
to turn LTO off.
2023-10-18 17:47:57 -04:00
Andrew Kelley
f9a3413112 compiler: better default for valgrind
* Default to off when strip=true
* Report an error when explicitly enabled but not supported for the
  target
2023-10-18 17:46:29 -04:00
Andrew Kelley
39652331c9
Merge pull request #14428 from perillo/improve-zig-env
zig env: add support for line based output
2023-10-18 17:32:59 -04:00
Jacob Young
d8f7c79298 x86_64: improve inline assembly support
* C++-style comments
 * indirect call operands
 * fix misleading immediate debug formatting
2023-10-18 13:57:28 -04:00
Jakub Konka
1448d6b77c elf: store shndx to Zig module atoms out-of-band
This allows us to increase the effective resolution of `st_shndx`
from `u8` to `u32`.
2023-10-18 18:33:35 +02:00
Jakub Konka
9ced0ecbbd elf: increase resolution of Atom.input_section_index to u32 2023-10-18 17:29:19 +02:00
Jakub Konka
27d7ac88a3 elf: increase resolution of Atom.relocs_section_index to u32 2023-10-18 17:25:28 +02:00
Robin Voetter
c3120d5089
Merge pull request #17577 from alichraghi/spirv-1
spirv: switch on bool
2023-10-18 16:28:13 +02:00
Robin Voetter
24b065a6a8
Merge pull request #17561 from alichraghi/spirv-0
spirv: memcpy
2023-10-18 15:38:30 +02:00
Jakub Konka
52e0ca1312 elf: parse GNU ld script as system lib indirection 2023-10-18 13:54:43 +02:00
Andrew Kelley
149f2f8adb
Merge pull request #17524 from Vexu/aro-translate-c
Add ability to test Aro based `translate-c`
2023-10-18 00:32:59 -04:00
Andrew Kelley
09dea957ed rework zig env
Introduce introspect.EnvVar which tracks all the environment variables
that are observed by the compiler, so that we can print them with `zig
env`.

The `zig env` command now prints both the resolved values as well as all
the possibly observed environment variables.
2023-10-17 21:27:09 -07:00
Manlio Perillo
053119083c zig env: remove the json output
The current json output is not very convenient to use from the shell or
a Zig program.
An example using the shell: `zig env | jq -r .lib_dir`.

Remove the json output, and instead use the POSIX shell syntax:
  name="value"

Additionally, when args is not empty, assume each argument is the
environment variable name and print the associated value.
Unrecognized environment variables are ignored.

The new output format has been copied from `go env`, with the difference
that `go env` uses OS specific syntax for windows and plan9.

Define the environment variables in a single place, in order to avoid
possible bugs.
2023-10-17 20:10:23 -07:00
Tobias Simetsreiter
7a9500fd80
Fix rendering ast in zon mode (#17547)
Co-authored-by: Tobias Simetsreiter <tobias.simetsreiter@wabtec.com>
2023-10-17 19:04:01 -04:00
dweiller
f58811a58a package fetching: support .tar.zst archives 2023-10-17 19:02:00 -04:00
Ali Chraghi
e5d5c1d423 spirv: switch on bool 2023-10-18 02:31:16 +03:30
Jakub Konka
533e2671c9 elf: add native libc* system libraries to the invocation 2023-10-17 23:23:33 +02:00
Bogdan Romanyuk
ad168db727
Sema: disallow @intFromPtr for comptime-only types 2023-10-17 20:05:55 +00:00
Andrew Kelley
3b21c15782
Merge pull request #17562 from ziglang/fetch-symlink-normalize-sep
Package.Fetch: normalize path separators in symlinks
2023-10-17 14:35:39 -04:00
Jakub Konka
eb5276c94e
Merge pull request #17556 from ziglang/elf-link-zig-proper
elf: port 99% of zld ELF linker to Zig proper
2023-10-17 17:36:40 +02:00
Jakub Konka
742a130ce5 elf: fix use-after-move 2023-10-17 17:35:16 +02:00
Jacob Young
cfa247e53b x86_64: fix C abi argument passing in memory 2023-10-17 10:41:48 -04:00