26069 Commits

Author SHA1 Message Date
Ryan Zezeski
68bcd7ddd4 solaris: load CA certs file 2023-09-30 11:38:56 -06:00
Ryan Zezeski
c17ebdca6a solaris: fix path component max 2023-09-30 11:38:56 -06:00
Ryan Zezeski
a0ed2c69b0 solaris: hard-code native libc paths
On illumos (and Solaris) there is, by design, only one libc.
2023-09-30 11:38:56 -06:00
Ryan Zezeski
b447441a91 solaris: link libstdc++ 2023-09-30 11:38:56 -06:00
Ryan Zezeski
ea92789c62 solaris: ld does not have stack-size option 2023-09-30 11:38:56 -06:00
Ryan Zezeski
f0724229d6 solaris: add missing registers 2023-09-30 11:38:56 -06:00
Andrew Kelley
937e8cb705
Merge pull request #17328 from ziglang/simplify-cbe-deps
C backend: remove unneeded ordering mechanism
2023-09-30 01:26:00 -07:00
Jakub Konka
873c695c41
Merge pull request #17319 from ziglang/elf-tls
elf: add basic TLS segment handling
2023-09-30 08:43:33 +02:00
Andrew Kelley
864bb5dc07 C backend: iterate decl_table via slice 2023-09-29 19:14:17 -07:00
Andrew Kelley
7c605ba62c C backend: remove ?*Decl from DeclGen
Another simplification. DeclGen already has `decl_index` which can be
used to retrieve the `*Decl` if needed.
2023-09-29 19:14:17 -07:00
Andrew Kelley
0d841e827a C backend: remove unneeded ordering mechanism
This logic to lower snippets of C code in a dependency order is no
longer needed. Simplify the logic by deleting the mechanism.
2023-09-29 19:14:17 -07:00
Andrew Kelley
101df768a0
Merge pull request #17312 from LucasSantos91/master
Fix inefficiency with ArrayList.insertSlice
2023-09-29 18:15:24 -07:00
Jakub Konka
e72fd185e0 elf: skip writing out zerofill atoms to file 2023-09-30 00:52:10 +02:00
Krzysztof Wolicki
19a82ffdba
Add include_extensions to InstallDir Options (#17300)
closes #16687
2023-09-29 18:50:37 -04:00
Andrew Kelley
9013970861 std.ArrayList: fixups for the previous commit
* Move `computeBetterCapacity` to the bottom so that `pub` stuff shows
   up first.
 * Rename `computeBetterCapacity` to `growCapacity`. Every function
   implicitly computes something; that word is always redundant in a
   function name. "better" is vague. Better in what way? Instead we
   describe what is actually happening. "grow".
 * Improve doc comments to be very explicit about when element pointers
   are invalidated or not.
 * Rename `addManyAtIndex` to `addManyAt`. The parameter is named
   `index`; that is enough.
 * Extract some duplicated code into `addManyAtAssumeCapacity` and make
   it `pub`.
 * Since I audited every line of code for correctness, I changed the
   style to my personal preference.
 * Avoid a redundant `@memset` to `undefined` - memory allocation does
   that already.
 * Fixed comment giving the wrong reason for not calling
   `ensureTotalCapacity`.
2023-09-29 13:42:38 -07:00
Jakub Konka
6c50ad6e9f elf: set sh_size to 0 for nobit sections in collision detection
`SHT_NOBITS` sections take no file space after all.
2023-09-29 22:37:59 +02:00
Jakub Konka
e5e6984652 elf: dump state for debugging after writing it all out 2023-09-29 22:29:06 +02:00
Jakub Konka
5381bfd348 elf: fix setting st_value of _end synthetic symbol 2023-09-29 22:18:38 +02:00
Lucas Santos
9d765b5ab5 std.ArrayList: insertSlice avoids extra memcpy
Includes a more robust implementation of replaceRange, which updates the
ArrayListUnmanaged if state changes in the managed part of the code
before returning an error.

Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2023-09-29 12:52:40 -07:00
Jakub Konka
8e90b41ae0 elf: set shdr/phdr file size before growing in VM 2023-09-29 21:43:01 +02:00
Jakub Konka
304d38e844 elf: simplify logic for growing non-alloc sections 2023-09-29 20:35:28 +02:00
Krzysztof Wolicki
e919fbea9f
Step.Run: fix assert of the wrong value (#17303)
closes #16866
2023-09-29 14:14:42 -04:00
Jakub Konka
0524a3c83d elf: fix calculating current allocated section size when growing alloc sections 2023-09-29 19:06:02 +02:00
Andrew Kelley
c07d6e4c17
Merge pull request #14603 from AdamGoertz/file-uris
Support relative paths in package manager
2023-09-29 00:34:07 -07:00
Adam Goertz
e07e182fc1 Extract logic for directory packages
In addition to improving readability, this also fixes a subtle bug
where the Progress node could display the wrong total number of packages to fetch.
2023-09-29 00:32:43 -07:00
AdamGoertz
4594206e72 Fix diamond dependencies with directory packages 2023-09-29 00:32:43 -07:00
AdamGoertz
c6b9205005 Purge absolute paths and remove unneeded path processing
No need to create paths with windows-specific path separators
2023-09-29 00:32:43 -07:00
Adam Goertz
2f0e5b00b0 Allow only relative paths.
This commit makes the following changes:
* Disallow file:/// URIs
* Allow only relative paths in the .path field of build.zig.zon
* Remote now-unneeded shlwapi dependency
2023-09-29 00:32:43 -07:00
Adam Goertz
b3cad98534 Support file:/// URIs and relative paths 2023-09-29 00:32:43 -07:00
Philipp Lühmann
ed19ebc360
std.math.big.int.Const.order 0 == -0 (#17299) 2023-09-29 18:09:47 +13:00
Luis Cáceres
acac685621
std.Build.ConfigHeader: override include guard option for blank style (#17310)
This commit adds an option to allow for overriding the default header guard that is generated from the output
file path.
2023-09-28 19:30:42 -04:00
Andrew Kelley
8f2f12f940 Compilation: introduce saveState()
This commit introduces `--debug-incremental` so that we can start
playing around with incremental compilation while it is still being
developed, and before it is enabled by default.

Currently it saves InternPool data, and has TODO comments for the
remaining things. Deserialization is not implemented yet, which will
require some post-processing such as to build a string map out of
null-terminated string table bytes.

The saved compiler state is stored in a file called <root-name>.zcs
alongside <root-name>.o, <root-name>.pdb, <root-name>.exe, etc. In case
of using the zig build system, these files are all in a zig-cache
directory.

For the self-hosted compiler, here is one data point on the performance
penalty of saving this data:

```
Benchmark 1 (3 runs): zig build-exe ...
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          51.1s  ±  354ms    50.7s  … 51.4s           0 ( 0%)        0%
  peak_rss           3.91GB ±  354KB    3.91GB … 3.91GB          0 ( 0%)        0%
  cpu_cycles          212G  ± 3.17G      210G  …  216G           0 ( 0%)        0%
  instructions        274G  ± 57.5M      274G  …  275G           0 ( 0%)        0%
  cache_references   13.1G  ± 97.6M     13.0G  … 13.2G           0 ( 0%)        0%
  cache_misses       1.12G  ± 24.6M     1.10G  … 1.15G           0 ( 0%)        0%
  branch_misses      1.53G  ± 1.46M     1.53G  … 1.53G           0 ( 0%)        0%
Benchmark 2 (3 runs): zig build-exe ... --debug-incremental
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          51.8s  ±  271ms    51.5s  … 52.1s           0 ( 0%)          +  1.3% ±  1.4%
  peak_rss           3.91GB ±  317KB    3.91GB … 3.91GB          0 ( 0%)          -  0.0% ±  0.0%
  cpu_cycles          213G  ±  398M      212G  …  213G           0 ( 0%)          +  0.3% ±  2.4%
  instructions        275G  ± 79.1M      275G  …  275G           0 ( 0%)          +  0.1% ±  0.1%
  cache_references   13.1G  ± 26.9M     13.0G  … 13.1G           0 ( 0%)          -  0.1% ±  1.2%
  cache_misses       1.12G  ± 5.66M     1.11G  … 1.12G           0 ( 0%)          -  0.6% ±  3.6%
  branch_misses      1.53G  ± 1.75M     1.53G  … 1.54G           0 ( 0%)          +  0.2% ±  0.2%
```

At the end of each compilation with `--debug-incremental`, we end up
with a 43 MiB `zig.zcs` file that contains all of the InternPool data
serialized.

Of course, it will necessarily be more expensive to save the state than
to not save the state. However, this data point shows just how cheap the
save state operation is, with all of the groundwork laid for using a
serialization-friendly in-memory data layout.
2023-09-28 16:28:41 -07:00
Andrew Kelley
077994abb6
Merge pull request #17318 from gh-fork-dump/linux-5.6-cachestat
Update Linux syscalls for 5.5 and add a wrapper for `cachestat`
2023-09-28 16:27:28 -07:00
Christofer Nolander
c4ad6be002
Allow empty enum to be used in EnumSet/EnumMap
Moves the check for empty fields before any access to those fields.
2023-09-28 21:48:39 +00:00
Jakub Konka
04a7051c4b elf: fix 32bit build 2023-09-28 21:42:09 +02:00
Jakub Konka
cdd4dbfe32 test: add x86_64-linux-musl-no-lld as a test target 2023-09-28 19:28:06 +02:00
Jakub Konka
89c2151a97 elf: move logic for extracing atom's code into input files 2023-09-28 18:35:26 +02:00
Karl Seguin
599641357c
std.mem: use for loop instead of while in indexOf* to reduce bound checking 2023-09-28 15:40:08 +00:00
Jakub Konka
91f2e66bf9 elf: test TLS in static programs 2023-09-28 15:13:35 +02:00
Jakub Konka
785bd270ed elf: correctly allocate TLS segment 2023-09-28 14:59:09 +02:00
Jakub Konka
1063035be6
Merge pull request #17304 from ziglang/elf-grow-vm-2
elf: grow segments in virtual memory if they exceed allocated capacity
2023-09-28 14:29:35 +02:00
Jakub Konka
af00ac53b5 elf: report fatal linker error for unhandled relocation types 2023-09-28 14:06:12 +02:00
Jakub Konka
a63ce5a37c elf: allocate .tdata and .tbss sections 2023-09-28 13:29:04 +02:00
Jonathan Marler
e0ef61d46d simplify ContainerDeclarations grammar rule
Noticed this grammar rule could be simplified using a repeating sequence
rather than recursion.
2023-09-28 14:18:54 +03:00
Emil Lerch
fcca3cd1a3
std.http: introduce options to http client to allow for raw uris
Addresses #17015 by introducing a new startWithOptions. The only option is currently is a flag
to use the provided URI as is, without modification when passed to the server. Normally, this
is not needed nor desired. However, some REST APIs may have requirements that cannot be satisfied
with the default handling.
2023-09-28 14:16:39 +03:00
Jonathan Marler
18f1db134c docs: remove unnecessary nesting in grammar
noticed this extra level of nesting in the Decl grammar that looks
unnecssary.
2023-09-28 13:58:14 +03:00
Jakub Konka
22127a8792 elf: pre-allocate TLS load segment and PT_TLS phdr 2023-09-28 12:06:21 +02:00
Jakub Konka
42011a8249 elf: remove explicit load segment alloc - we can replicate programmatically now 2023-09-28 11:46:40 +02:00
Ryan Liptak
a362d3963c resinator: Update to latest, fix for big endian arch 2023-09-28 02:25:52 -07:00
Stephen Gregoratto
bc0bf4e97a Linux: Add cachestat wrapper.
Can be tested using this program I whipped up:
https://gist.github.com/The-King-of-Toasters/aee448f5975c50f735fd1946794574f7
2023-09-28 18:58:05 +10:00