Skip to content

Commit fa20865

Browse files
authored
Merge branch 'ziglang:master' into mlockall
2 parents 8557c0e + 8e7d9af commit fa20865

File tree

324 files changed

+25255
-38672
lines changed

Some content is hidden

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

324 files changed

+25255
-38672
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ lib/libcxx/** linguist-vendored
1212
lib/libcxxabi/** linguist-vendored
1313
lib/libunwind/** linguist-vendored
1414
lib/tsan/** linguist-vendored
15-
deps/** linguist-vendored
15+
lib/compiler/aro/** linguist-vendored

.github/CODEOWNERS

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Autodoc
2-
/src/Autodoc.zig @kristoff-it
3-
/src/autodoc/* @kristoff-it
4-
/lib/docs/* @kristoff-it
5-
61
# std.json
72
/lib/std/json* @thejoshwolfe
83

.github/ISSUE_TEMPLATE/autodoc-issue.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ jobs:
1414
runs-on: [self-hosted, Linux, x86_64]
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
- name: Build and Test
1919
run: sh ci/x86_64-linux-debug.sh
2020
x86_64-linux-release:
2121
timeout-minutes: 420
2222
runs-on: [self-hosted, Linux, x86_64]
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
- name: Build and Test
2727
run: sh ci/x86_64-linux-release.sh
2828
aarch64-linux-debug:
2929
timeout-minutes: 480
3030
runs-on: [self-hosted, Linux, aarch64]
3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
- name: Build and Test
3535
run: sh ci/aarch64-linux-debug.sh
3636
aarch64-linux-release:
3737
timeout-minutes: 480
3838
runs-on: [self-hosted, Linux, aarch64]
3939
steps:
4040
- name: Checkout
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
4242
- name: Build and Test
4343
run: sh ci/aarch64-linux-release.sh
4444
x86_64-macos-release:
@@ -47,7 +47,7 @@ jobs:
4747
ARCH: "x86_64"
4848
steps:
4949
- name: Checkout
50-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
5151
- name: Build and Test
5252
run: ci/x86_64-macos-release.sh
5353
aarch64-macos-debug:
@@ -56,7 +56,7 @@ jobs:
5656
ARCH: "aarch64"
5757
steps:
5858
- name: Checkout
59-
uses: actions/checkout@v3
59+
uses: actions/checkout@v4
6060
- name: Build and Test
6161
run: ci/aarch64-macos-debug.sh
6262
aarch64-macos-release:
@@ -65,7 +65,7 @@ jobs:
6565
ARCH: "aarch64"
6666
steps:
6767
- name: Checkout
68-
uses: actions/checkout@v3
68+
uses: actions/checkout@v4
6969
- name: Build and Test
7070
run: ci/aarch64-macos-release.sh
7171
x86_64-windows-debug:
@@ -74,7 +74,7 @@ jobs:
7474
ARCH: "x86_64"
7575
steps:
7676
- name: Checkout
77-
uses: actions/checkout@v3
77+
uses: actions/checkout@v4
7878
- name: Build and Test
7979
run: ci/x86_64-windows-debug.ps1
8080
x86_64-windows-release:
@@ -83,7 +83,7 @@ jobs:
8383
ARCH: "x86_64"
8484
steps:
8585
- name: Checkout
86-
uses: actions/checkout@v3
86+
uses: actions/checkout@v4
8787
- name: Build and Test
8888
run: ci/x86_64-windows-release.ps1
8989
aarch64-windows:
@@ -92,6 +92,6 @@ jobs:
9292
ARCH: "aarch64"
9393
steps:
9494
- name: Checkout
95-
uses: actions/checkout@v3
95+
uses: actions/checkout@v4
9696
- name: Build and Test
9797
run: ci/aarch64-windows.ps1

CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,7 @@ set(ZIG_STAGE2_SOURCES
235235
"${CMAKE_SOURCE_DIR}/lib/std/elf.zig"
236236
"${CMAKE_SOURCE_DIR}/lib/std/fifo.zig"
237237
"${CMAKE_SOURCE_DIR}/lib/std/fmt.zig"
238-
"${CMAKE_SOURCE_DIR}/lib/std/fmt/errol.zig"
239-
"${CMAKE_SOURCE_DIR}/lib/std/fmt/errol/enum3.zig"
240-
"${CMAKE_SOURCE_DIR}/lib/std/fmt/errol/lookup.zig"
238+
"${CMAKE_SOURCE_DIR}/lib/std/fmt/ryu128.zig"
241239
"${CMAKE_SOURCE_DIR}/lib/std/fmt/parse_float.zig"
242240
"${CMAKE_SOURCE_DIR}/lib/std/fs.zig"
243241
"${CMAKE_SOURCE_DIR}/lib/std/fs/AtomicFile.zig"
@@ -291,7 +289,8 @@ set(ZIG_STAGE2_SOURCES
291289
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/errno/generic.zig"
292290
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/x86_64.zig"
293291
"${CMAKE_SOURCE_DIR}/lib/std/os/linux.zig"
294-
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/io_uring.zig"
292+
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/IoUring.zig"
293+
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/io_uring_sqe.zig"
295294
"${CMAKE_SOURCE_DIR}/lib/std/os/linux/x86_64.zig"
296295
"${CMAKE_SOURCE_DIR}/lib/std/os/windows.zig"
297296
"${CMAKE_SOURCE_DIR}/lib/std/os/windows/ntstatus.zig"
@@ -597,6 +596,7 @@ set(ZIG_STAGE2_SOURCES
597596
"${CMAKE_SOURCE_DIR}/src/link/Elf/relocatable.zig"
598597
"${CMAKE_SOURCE_DIR}/src/link/Elf/relocation.zig"
599598
"${CMAKE_SOURCE_DIR}/src/link/Elf/synthetic_sections.zig"
599+
"${CMAKE_SOURCE_DIR}/src/link/Elf/thunks.zig"
600600
"${CMAKE_SOURCE_DIR}/src/link/MachO.zig"
601601
"${CMAKE_SOURCE_DIR}/src/link/MachO/Archive.zig"
602602
"${CMAKE_SOURCE_DIR}/src/link/MachO/Atom.zig"
@@ -905,8 +905,6 @@ else()
905905
endif()
906906

907907
# -Dno-langref is currently hardcoded because building the langref takes too damn long
908-
# -Dno-autodocs is currently hardcoded because the C backend generates a miscompilation
909-
# that prevents it from working.
910908
# To obtain these two forms of documentation, run zig build against stage3 rather than stage2.
911909
set(ZIG_BUILD_ARGS
912910
--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"
@@ -916,7 +914,6 @@ set(ZIG_BUILD_ARGS
916914
${ZIG_STATIC_ARG}
917915
${ZIG_NO_LIB_ARG}
918916
"-Dno-langref"
919-
"-Dno-autodocs"
920917
${ZIG_SINGLE_THREADED_ARG}
921918
${ZIG_PIE_ARG}
922919
"-Dtarget=${ZIG_TARGET_TRIPLE}"

build.zig

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn build(b: *std.Build) !void {
3131
const test_step = b.step("test", "Run all the tests");
3232
const skip_install_lib_files = b.option(bool, "no-lib", "skip copying of lib/ files and langref to installation prefix. Useful for development") orelse false;
3333
const skip_install_langref = b.option(bool, "no-langref", "skip copying of langref to the installation prefix") orelse skip_install_lib_files;
34-
const skip_install_autodocs = b.option(bool, "no-autodocs", "skip copying of standard library autodocs to the installation prefix") orelse skip_install_lib_files;
34+
const std_docs = b.option(bool, "std-docs", "include standard library autodocs") orelse false;
3535
const no_bin = b.option(bool, "no-bin", "skip emitting compiler binary") orelse false;
3636

3737
const docgen_exe = b.addExecutable(.{
@@ -55,17 +55,19 @@ pub fn build(b: *std.Build) !void {
5555
b.getInstallStep().dependOn(&install_langref.step);
5656
}
5757

58-
const autodoc_test = b.addTest(.{
58+
const autodoc_test = b.addObject(.{
59+
.name = "std",
5960
.root_source_file = .{ .path = "lib/std/std.zig" },
6061
.target = target,
6162
.zig_lib_dir = .{ .path = "lib" },
63+
.optimize = .Debug,
6264
});
6365
const install_std_docs = b.addInstallDirectory(.{
6466
.source_dir = autodoc_test.getEmittedDocs(),
6567
.install_dir = .prefix,
6668
.install_subdir = "doc/std",
6769
});
68-
if (!skip_install_autodocs) {
70+
if (std_docs) {
6971
b.getInstallStep().dependOn(&install_std_docs.step);
7072
}
7173

@@ -101,6 +103,7 @@ pub fn build(b: *std.Build) !void {
101103
const skip_non_native = b.option(bool, "skip-non-native", "Main test suite skips non-native builds") orelse false;
102104
const skip_libc = b.option(bool, "skip-libc", "Main test suite skips tests that link libc") orelse false;
103105
const skip_single_threaded = b.option(bool, "skip-single-threaded", "Main test suite skips tests that are single-threaded") orelse false;
106+
const skip_translate_c = b.option(bool, "skip-translate-c", "Main test suite skips translate-c tests") orelse false;
104107
const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse false;
105108

106109
const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false;
@@ -453,7 +456,10 @@ pub fn build(b: *std.Build) !void {
453456
}).step);
454457

455458
const test_cases_step = b.step("test-cases", "Run the main compiler test cases");
456-
try tests.addCases(b, test_cases_step, test_filters, check_case_exe, .{
459+
try tests.addCases(b, test_cases_step, test_filters, check_case_exe, target, .{
460+
.skip_translate_c = skip_translate_c,
461+
.skip_run_translated_c = skip_run_translated_c,
462+
}, .{
457463
.enable_llvm = enable_llvm,
458464
.llvm_has_m68k = llvm_has_m68k,
459465
.llvm_has_csky = llvm_has_csky,
@@ -525,11 +531,6 @@ pub fn build(b: *std.Build) !void {
525531
test_step.dependOn(tests.addStackTraceTests(b, test_filters, optimization_modes));
526532
test_step.dependOn(tests.addCliTests(b));
527533
test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filters, optimization_modes));
528-
test_step.dependOn(tests.addTranslateCTests(b, test_filters));
529-
if (!skip_run_translated_c) {
530-
test_step.dependOn(tests.addRunTranslatedCTests(b, test_filters, target));
531-
}
532-
533534
test_step.dependOn(tests.addModuleTests(b, .{
534535
.test_filters = test_filters,
535536
.root_src = "lib/std/std.zig",
@@ -854,7 +855,7 @@ fn addCMakeLibraryList(exe: *std.Build.Step.Compile, list: []const u8) void {
854855
}
855856

856857
const CMakeConfig = struct {
857-
llvm_linkage: std.Build.Step.Compile.Linkage,
858+
llvm_linkage: std.builtin.LinkMode,
858859
cmake_binary_dir: []const u8,
859860
cmake_prefix_path: []const u8,
860861
cmake_static_library_prefix: []const u8,

0 commit comments

Comments
 (0)