Skip to content

Commit 43bc1ce

Browse files
authored
Merge pull request #198 from alexrp/master
update zig sources to 0.14.0-dev.2246+bfcf18c5a
2 parents 66c0f7a + d53dfcb commit 43bc1ce

File tree

653 files changed

+24987
-23349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

653 files changed

+24987
-23349
lines changed

README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ to find and inspect the patch diffs.
1111
* LLVM, LLD, Clang 19.1.0
1212
* zlib 1.3.1
1313
* zstd 1.5.2
14-
* zig 0.14.0-dev.1876+41dbd0d0d
14+
* zig 0.14.0-dev.2246+bfcf18c5a
1515

1616
For other versions, check the git tags of this repository.
1717

@@ -96,16 +96,16 @@ is more portable across Linux distributions.
9696
|----------------------------|----------------|
9797
| `aarch64-linux-gnu` | OK |
9898
| `aarch64-linux-musl` | OK |
99-
| `aarch64-macos-none` | [#194](https://github.com/ziglang/zig-bootstrap/issues/194) |
99+
| `aarch64-macos-none` | OK |
100100
| `aarch64-windows-gnu` | OK |
101101
| `aarch64_be-linux-gnu` | OK |
102102
| `aarch64_be-linux-musl` | OK |
103-
| `arm-linux-gnueabi` | [#101](https://github.com/ziglang/zig-bootstrap/issues/101) |
104-
| `arm-linux-gnueabihf` | [#102](https://github.com/ziglang/zig-bootstrap/issues/102) |
103+
| `arm-linux-gnueabi` | OK |
104+
| `arm-linux-gnueabihf` | OK |
105105
| `arm-linux-musleabi` | OK |
106106
| `arm-linux-musleabihf` | OK |
107-
| `armeb-linux-gnueabi` | [#96](https://github.com/ziglang/zig-bootstrap/issues/96) |
108-
| `armeb-linux-gnueabihf` | [#97](https://github.com/ziglang/zig-bootstrap/issues/97) |
107+
| `armeb-linux-gnueabi` | OK |
108+
| `armeb-linux-gnueabihf` | OK |
109109
| `armeb-linux-musleabi` | OK |
110110
| `armeb-linux-musleabihf` | OK |
111111
| `loongarch64-linux-gnu` | OK |
@@ -158,7 +158,6 @@ is more portable across Linux distributions.
158158

159159
#### Other Notable Targets Known to Work
160160

161-
* `aarch64-macos-none` with mcpu value of `apple_a14`.
162161
* `arm-linux-musleabi` with mcpu value of `generic+v6kz`. This produces a
163162
build of Zig that runs on the RPi 1 and RPi Zero.
164163
- If you want to produce a build for this CPU exactly, use `arm1176jzf_s`.

build

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TARGET="$1" # Example: riscv64-linux-gnu
77
MCPU="$2" # Examples: `baseline`, `native`, `generic+v7a`, or `arm1176jzf_s`
88

99
ROOTDIR="$(pwd)"
10-
ZIG_VERSION="0.14.0-dev.1876+41dbd0d0d"
10+
ZIG_VERSION="0.14.0-dev.2246+bfcf18c5a"
1111

1212
TARGET_OS_AND_ABI=${TARGET#*-} # Example: linux-gnu
1313

build.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if "%VSCMD_ARG_HOST_ARCH%"=="x86" set OUTDIR=out-win-x86
3535

3636
set ROOTDIR=%~dp0
3737
set "ROOTDIR_CMAKE=%ROOTDIR:\=/%"
38-
set ZIG_VERSION="0.14.0-dev.1876+41dbd0d0d"
38+
set ZIG_VERSION="0.14.0-dev.2246+bfcf18c5a"
3939
set JOBS_ARG=
4040

4141
pushd %ROOTDIR%

zig/CMakeLists.txt

+5-17
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ set(ZIG_STAGE2_SOURCES
376376
lib/std/Target.zig
377377
lib/std/Target/Query.zig
378378
lib/std/Target/aarch64.zig
379-
lib/std/Target/amdgpu.zig
379+
lib/std/Target/amdgcn.zig
380380
lib/std/Target/arm.zig
381381
lib/std/Target/avr.zig
382382
lib/std/Target/bpf.zig
@@ -522,6 +522,7 @@ set(ZIG_STAGE2_SOURCES
522522
src/Sema.zig
523523
src/Sema/bitcast.zig
524524
src/Sema/comptime_ptr_access.zig
525+
src/ThreadSafeQueue.zig
525526
src/Type.zig
526527
src/Value.zig
527528
src/Zcu.zig
@@ -591,30 +592,25 @@ set(ZIG_STAGE2_SOURCES
591592
src/link.zig
592593
src/link/C.zig
593594
src/link/Coff.zig
594-
src/link/Coff/Atom.zig
595-
src/link/Coff/ImportTable.zig
596-
src/link/Coff/Object.zig
597-
src/link/Coff/Relocation.zig
598-
src/link/Coff/lld.zig
599595
src/link/Dwarf.zig
600596
src/link/Elf.zig
601597
src/link/Elf/Archive.zig
602598
src/link/Elf/Atom.zig
603599
src/link/Elf/AtomList.zig
604-
src/link/Elf/LdScript.zig
605600
src/link/Elf/LinkerDefined.zig
601+
src/link/Elf/Merge.zig
606602
src/link/Elf/Object.zig
607603
src/link/Elf/SharedObject.zig
608604
src/link/Elf/Symbol.zig
605+
src/link/Elf/Thunk.zig
609606
src/link/Elf/ZigObject.zig
610607
src/link/Elf/eh_frame.zig
611608
src/link/Elf/file.zig
612609
src/link/Elf/gc.zig
613-
src/link/Elf/merge_section.zig
614610
src/link/Elf/relocatable.zig
615611
src/link/Elf/relocation.zig
616612
src/link/Elf/synthetic_sections.zig
617-
src/link/Elf/Thunk.zig
613+
src/link/LdScript.zig
618614
src/link/MachO.zig
619615
src/link/MachO/Archive.zig
620616
src/link/MachO/Atom.zig
@@ -652,12 +648,9 @@ set(ZIG_STAGE2_SOURCES
652648
src/link/StringTable.zig
653649
src/link/Wasm.zig
654650
src/link/Wasm/Archive.zig
655-
src/link/Wasm/Atom.zig
656651
src/link/Wasm/Object.zig
657652
src/link/Wasm/Symbol.zig
658653
src/link/Wasm/ZigObject.zig
659-
src/link/Wasm/file.zig
660-
src/link/Wasm/types.zig
661654
src/link/aarch64.zig
662655
src/link/riscv.zig
663656
src/link/table_section.zig
@@ -834,11 +827,6 @@ else()
834827
endif()
835828
endif()
836829

837-
option(ZIG2_NO_RTLIB "Build zig2 without linking to a compiler runtime library (for `zig cc` only)" OFF)
838-
if(ZIG2_NO_RTLIB)
839-
set(ZIG2_LINK_FLAGS "${ZIG2_LINK_FLAGS} -rtlib=none")
840-
endif()
841-
842830
set(ZIG1_WASM_MODULE "${PROJECT_SOURCE_DIR}/stage1/zig1.wasm")
843831
set(ZIG1_C_SOURCE "${PROJECT_BINARY_DIR}/zig1.c")
844832
set(ZIG2_C_SOURCE "${PROJECT_BINARY_DIR}/zig2.c")

zig/bootstrap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int main(int argc, char **argv) {
123123
if (f == NULL)
124124
panic("unable to open config.zig for writing");
125125

126-
const char *zig_version = "0.14.0-dev.1876+41dbd0d0d";
126+
const char *zig_version = "0.14.0-dev.2246+bfcf18c5a";
127127

128128
int written = fprintf(f,
129129
"pub const have_llvm = false;\n"

zig/build.zig

+14-17
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,17 @@ pub fn build(b: *std.Build) !void {
3232
const skip_install_langref = b.option(bool, "no-langref", "skip copying of langref to the installation prefix") orelse skip_install_lib_files;
3333
const std_docs = b.option(bool, "std-docs", "include standard library autodocs") orelse false;
3434
const no_bin = b.option(bool, "no-bin", "skip emitting compiler binary") orelse false;
35-
const enable_tidy = b.option(bool, "enable-tidy", "Check langref output HTML validity") orelse false;
35+
const enable_superhtml = b.option(bool, "enable-superhtml", "Check langref output HTML validity") orelse false;
3636

3737
const langref_file = generateLangRef(b);
3838
const install_langref = b.addInstallFileWithDir(langref_file, .prefix, "doc/langref.html");
39-
const check_langref = tidyCheck(b, langref_file);
40-
if (enable_tidy) install_langref.step.dependOn(check_langref);
41-
// Checking autodocs is disabled because tidy gives a false positive:
42-
// line 304 column 9 - Warning: moved <style> tag to <head>! fix-style-tags: no to avoid.
43-
// I noticed that `--show-warnings no` still incorrectly causes exit code 1.
44-
// I was unable to find an alternative to tidy.
45-
//const check_autodocs = tidyCheck(b, b.path("lib/docs/index.html"));
46-
if (enable_tidy) {
39+
const check_langref = superHtmlCheck(b, langref_file);
40+
if (enable_superhtml) install_langref.step.dependOn(check_langref);
41+
42+
const check_autodocs = superHtmlCheck(b, b.path("lib/docs/index.html"));
43+
if (enable_superhtml) {
4744
test_step.dependOn(check_langref);
48-
//test_step.dependOn(check_autodocs);
45+
test_step.dependOn(check_autodocs);
4946
}
5047
if (!skip_install_langref) {
5148
b.getInstallStep().dependOn(&install_langref.step);
@@ -647,7 +644,7 @@ fn addCompilerStep(b: *std.Build, options: AddCompilerStepOptions) *std.Build.St
647644
.root_source_file = b.path("src/main.zig"),
648645
.target = options.target,
649646
.optimize = options.optimize,
650-
.max_rss = 7_500_000_000,
647+
.max_rss = 7_800_000_000,
651648
.strip = options.strip,
652649
.sanitize_thread = options.sanitize_thread,
653650
.single_threaded = options.single_threaded,
@@ -1358,11 +1355,11 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath {
13581355
return docgen_cmd.addOutputFileArg("langref.html");
13591356
}
13601357

1361-
fn tidyCheck(b: *std.Build, html_file: std.Build.LazyPath) *std.Build.Step {
1362-
const run_tidy = b.addSystemCommand(&.{
1363-
"tidy", "--drop-empty-elements", "no", "-qe",
1358+
fn superHtmlCheck(b: *std.Build, html_file: std.Build.LazyPath) *std.Build.Step {
1359+
const run_superhtml = b.addSystemCommand(&.{
1360+
"superhtml", "check",
13641361
});
1365-
run_tidy.addFileArg(html_file);
1366-
run_tidy.expectExitCode(0);
1367-
return &run_tidy.step;
1362+
run_superhtml.addFileArg(html_file);
1363+
run_superhtml.expectExitCode(0);
1364+
return &run_superhtml.step;
13681365
}

zig/doc/langref.html.in

+22-15
Original file line numberDiff line numberDiff line change
@@ -2190,6 +2190,7 @@ or
21902190
<li>An {#link|enum#} field uses exactly the bit width of its integer tag type.</li>
21912191
<li>A {#link|packed union#} field uses exactly the bit width of the union field with
21922192
the largest bit width.</li>
2193+
<li>Packed structs support equality operators.</li>
21932194
</ul>
21942195
<p>
21952196
This means that a {#syntax#}packed struct{#endsyntax#} can participate
@@ -2240,6 +2241,12 @@ or
22402241
</p>
22412242
{#code|test_aligned_struct_fields.zig#}
22422243

2244+
<p>
2245+
Equating packed structs results in a comparison of the backing integer,
2246+
and only works for the `==` and `!=` operators.
2247+
</p>
2248+
{#code|test_packed_struct_equality.zig#}
2249+
22432250
<p>
22442251
Using packed structs with {#link|volatile#} is problematic, and may be a compile error in the future.
22452252
For details on this subscribe to
@@ -4616,7 +4623,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
46164623
{#header_close#}
46174624

46184625
{#header_open|@compileLog#}
4619-
<pre>{#syntax#}@compileLog(args: ...) void{#endsyntax#}</pre>
4626+
<pre>{#syntax#}@compileLog(...) void{#endsyntax#}</pre>
46204627
<p>
46214628
This function prints the arguments passed to it at compile-time.
46224629
</p>
@@ -4872,6 +4879,13 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
48724879
</p>
48734880
{#header_close#}
48744881

4882+
{#header_open|@FieldType#}
4883+
<pre>{#syntax#}@FieldType(comptime Type: type, comptime field_name: []const u8) type{#endsyntax#}</pre>
4884+
<p>
4885+
Given a type and the name of one of its fields, returns the type of that field.
4886+
</p>
4887+
{#header_close#}
4888+
48754889
{#header_open|@floatCast#}
48764890
<pre>{#syntax#}@floatCast(value: anytype) anytype{#endsyntax#}</pre>
48774891
<p>
@@ -5054,12 +5068,12 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
50545068
{#header_close#}
50555069

50565070
{#header_open|@max#}
5057-
<pre>{#syntax#}@max(a: T, b: T) T{#endsyntax#}</pre>
5071+
<pre>{#syntax#}@max(...) T{#endsyntax#}</pre>
50585072
<p>
5059-
Returns the maximum value of {#syntax#}a{#endsyntax#} and {#syntax#}b{#endsyntax#}. This builtin accepts integers, floats, and vectors of either. In the latter case, the operation is performed element wise.
5073+
Takes two or more arguments and returns the biggest value included (the maximum). This builtin accepts integers, floats, and vectors of either. In the latter case, the operation is performed element wise.
50605074
</p>
50615075
<p>
5062-
NaNs are handled as follows: if one of the operands of a (pairwise) operation is NaN, the other operand is returned. If both operands are NaN, NaN is returned.
5076+
NaNs are handled as follows: return the biggest non-NaN value included. If all operands are NaN, return NaN.
50635077
</p>
50645078
{#see_also|@min|Vectors#}
50655079
{#header_close#}
@@ -5093,12 +5107,12 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
50935107
{#header_close#}
50945108

50955109
{#header_open|@min#}
5096-
<pre>{#syntax#}@min(a: T, b: T) T{#endsyntax#}</pre>
5110+
<pre>{#syntax#}@min(...) T{#endsyntax#}</pre>
50975111
<p>
5098-
Returns the minimum value of {#syntax#}a{#endsyntax#} and {#syntax#}b{#endsyntax#}. This builtin accepts integers, floats, and vectors of either. In the latter case, the operation is performed element wise.
5112+
Takes two or more arguments and returns the smallest value included (the minimum). This builtin accepts integers, floats, and vectors of either. In the latter case, the operation is performed element wise.
50995113
</p>
51005114
<p>
5101-
NaNs are handled as follows: if one of the operands of a (pairwise) operation is NaN, the other operand is returned. If both operands are NaN, NaN is returned.
5115+
NaNs are handled as follows: return the smallest non-NaN value included. If all operands are NaN, return NaN.
51025116
</p>
51035117
{#see_also|@max|Vectors#}
51045118
{#header_close#}
@@ -5281,13 +5295,6 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
52815295
{#see_also|Vectors#}
52825296
{#header_close#}
52835297

5284-
{#header_open|@setAlignStack#}
5285-
<pre>{#syntax#}@setAlignStack(comptime alignment: u29) void{#endsyntax#}</pre>
5286-
<p>
5287-
Ensures that a function will have a stack alignment of at least {#syntax#}alignment{#endsyntax#} bytes.
5288-
</p>
5289-
{#header_close#}
5290-
52915298
{#header_open|@setEvalBranchQuota#}
52925299
<pre>{#syntax#}@setEvalBranchQuota(comptime new_quota: u32) void{#endsyntax#}</pre>
52935300
<p>
@@ -5781,7 +5788,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
57815788
{#header_open|@TypeOf#}
57825789
<pre>{#syntax#}@TypeOf(...) type{#endsyntax#}</pre>
57835790
<p>
5784-
{#syntax#}@TypeOf{#endsyntax#} is a special builtin function that takes any (nonzero) number of expressions
5791+
{#syntax#}@TypeOf{#endsyntax#} is a special builtin function that takes any (non-zero) number of expressions
57855792
as parameters and returns the type of the result, using {#link|Peer Type Resolution#}.
57865793
</p>
57875794
<p>

zig/doc/langref/builtin.CallModifier struct.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub const CallModifier = enum {
2323
/// If this is not possible, a compile error is emitted instead.
2424
always_tail,
2525

26-
/// Guarantees that the call will inlined at the callsite.
26+
/// Guarantees that the call will be inlined at the callsite.
2727
/// If this is not possible, a compile error is emitted instead.
2828
always_inline,
2929

zig/doc/langref/enum_export_error.zig

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export fn entry(foo: Foo) void {
33
_ = foo;
44
}
55

6-
// obj=parameter of type 'enum_export_error.Foo' not allowed in function with calling convention 'C'
6+
// obj=parameter of type 'enum_export_error.Foo' not allowed in function with calling convention 'x86_64_sysv'
7+
// target=x86_64-linux
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const std = @import("std");
2+
const expect = std.testing.expect;
3+
4+
test "packed struct equality" {
5+
const S = packed struct {
6+
a: u4,
7+
b: u4,
8+
};
9+
const x: S = .{ .a = 1, .b = 2 };
10+
const y: S = .{ .b = 2, .a = 1 };
11+
try expect(x == y);
12+
}
13+
14+
// test

0 commit comments

Comments
 (0)