Skip to content

Commit 26b1a35

Browse files
committed
update zig sources to 0.15.0-dev.317+fa5915389
1 parent 00c52c7 commit 26b1a35

File tree

173 files changed

+15727
-1944
lines changed

Some content is hidden

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

173 files changed

+15727
-1944
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ to find and inspect the patch diffs.
1111
* LLVM, LLD, Clang 20.1.2
1212
* zlib 1.3.1
1313
* zstd 1.5.2
14-
* zig 0.15.0-dev.233+7c85dc460
14+
* zig 0.15.0-dev.317+fa5915389
1515

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

build

Lines changed: 1 addition & 1 deletion
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.15.0-dev.233+7c85dc460"
10+
ZIG_VERSION="0.15.0-dev.317+fa5915389"
1111

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

build.bat

Lines changed: 1 addition & 1 deletion
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.15.0-dev.233+7c85dc460"
38+
set ZIG_VERSION="0.15.0-dev.317+fa5915389"
3939
set JOBS_ARG=
4040

4141
pushd %ROOTDIR%

zig/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ set(ZIG_STAGE2_SOURCES
444444
lib/std/json.zig
445445
lib/std/json/stringify.zig
446446
lib/std/leb128.zig
447-
lib/std/linked_list.zig
448447
lib/std/log.zig
449448
lib/std/macho.zig
450449
lib/std/math.zig
@@ -699,6 +698,13 @@ add_library(zigcpp STATIC ${ZIG_CPP_SOURCES})
699698
target_compile_features(zigcpp PRIVATE cxx_std_17)
700699
set_target_properties(zigcpp PROPERTIES POSITION_INDEPENDENT_CODE ${ZIG_PIE})
701700

701+
if(LLVM_LINK_MODE STREQUAL "static")
702+
target_compile_definitions(zigcpp PRIVATE
703+
LLVM_BUILD_STATIC
704+
CLANG_BUILD_STATIC
705+
)
706+
endif()
707+
702708
if(NOT MSVC)
703709
if(MINGW)
704710
target_compile_options(zigcpp PRIVATE -Wno-format)

zig/bootstrap.c

Lines changed: 1 addition & 1 deletion
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.15.0-dev.233+7c85dc460";
126+
const char *zig_version = "0.15.0-dev.317+fa5915389";
127127

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

zig/build.zig

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -668,24 +668,6 @@ fn addCompilerStep(b: *std.Build, options: AddCompilerStepOptions) *std.Build.St
668668
.strip = options.strip,
669669
.sanitize_thread = options.sanitize_thread,
670670
.single_threaded = options.single_threaded,
671-
.code_model = switch (options.target.result.cpu.arch) {
672-
// NB:
673-
// For loongarch, LLVM supports only small, medium and large
674-
// code model. If we don't explicitly specify the code model,
675-
// the default value `small' will be used.
676-
//
677-
// Since zig binary itself is relatively large, using a `small'
678-
// code model will cause
679-
//
680-
// relocation R_LARCH_B26 out of range
681-
//
682-
// error when linking a loongarch32/loongarch64 zig binary.
683-
//
684-
// Here we explicitly set code model to `medium' to avoid this
685-
// error.
686-
.loongarch32, .loongarch64 => .medium,
687-
else => .default,
688-
},
689671
.valgrind = options.valgrind,
690672
});
691673

@@ -724,6 +706,9 @@ const exe_cflags = [_][]const u8{
724706
"-Wno-type-limits",
725707
"-Wno-missing-braces",
726708
"-Wno-comment",
709+
// `exe_cflags` is only used for static linking.
710+
"-DLLVM_BUILD_STATIC",
711+
"-DCLANG_BUILD_STATIC",
727712
};
728713

729714
fn addCmakeCfgOptionsToExe(

zig/cmake/Findlld.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
1414
/usr/local/llvm20/include
1515
/usr/local/opt/lld@20/include
1616
/opt/homebrew/opt/lld@20/include
17+
/home/linuxbrew/.linuxbrew/opt/lld@20/include
1718
/mingw64/include)
1819

1920
find_library(LLD_LIBRARY NAMES lld-20.0 lld200 lld NAMES_PER_DIR
@@ -24,6 +25,7 @@ find_library(LLD_LIBRARY NAMES lld-20.0 lld200 lld NAMES_PER_DIR
2425
/usr/local/llvm20/lib
2526
/usr/local/opt/lld@20/lib
2627
/opt/homebrew/opt/lld@20/lib
28+
/home/linuxbrew/.linuxbrew/opt/lld@20/lib
2729
)
2830
if(EXISTS ${LLD_LIBRARY})
2931
set(LLD_LIBRARIES ${LLD_LIBRARY})
@@ -39,6 +41,7 @@ else()
3941
/usr/local/llvm20/lib
4042
/usr/local/opt/lld@20/lib
4143
/opt/homebrew/opt/lld@20/lib
44+
/home/linuxbrew/.linuxbrew/opt/lld@20/lib
4245
/mingw64/lib
4346
/c/msys64/mingw64/lib
4447
c:/msys64/mingw64/lib)

zig/lib/compiler/aro/aro/Compilation.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ pub fn fixedEnumTagSpecifier(comp: *const Compilation) ?Type.Specifier {
10871087
}
10881088

10891089
pub fn getCharSignedness(comp: *const Compilation) std.builtin.Signedness {
1090-
return comp.langopts.char_signedness_override orelse comp.target.charSignedness();
1090+
return comp.langopts.char_signedness_override orelse comp.target.cCharSignedness();
10911091
}
10921092

10931093
/// Add built-in aro headers directory to system include paths

zig/lib/compiler_rt/divmodei4.zig

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,20 @@ fn divmod(q: ?[]u32, r: ?[]u32, u: []u32, v: []u32) !void {
3333
if (r) |x| if (u_sign < 0) neg(x);
3434
}
3535

36-
pub fn __divei4(r_q: [*]u32, u_p: [*]u32, v_p: [*]u32, bits: usize) callconv(.c) void {
36+
pub fn __divei4(q_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) void {
3737
@setRuntimeSafety(builtin.is_test);
38-
const u = u_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable];
39-
const v = v_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable];
40-
const q = r_q[0 .. std.math.divCeil(usize, bits, 32) catch unreachable];
38+
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
39+
const q: []u32 = @ptrCast(@alignCast(q_p[0..byte_size]));
40+
const u: []u32 = @ptrCast(@alignCast(u_p[0..byte_size]));
41+
const v: []u32 = @ptrCast(@alignCast(v_p[0..byte_size]));
4142
@call(.always_inline, divmod, .{ q, null, u, v }) catch unreachable;
4243
}
4344

44-
pub fn __modei4(r_p: [*]u32, u_p: [*]u32, v_p: [*]u32, bits: usize) callconv(.c) void {
45+
pub fn __modei4(r_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) void {
4546
@setRuntimeSafety(builtin.is_test);
46-
const u = u_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable];
47-
const v = v_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable];
48-
const r = r_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable];
47+
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
48+
const r: []u32 = @ptrCast(@alignCast(r_p[0..byte_size]));
49+
const u: []u32 = @ptrCast(@alignCast(u_p[0..byte_size]));
50+
const v: []u32 = @ptrCast(@alignCast(v_p[0..byte_size]));
4951
@call(.always_inline, divmod, .{ null, r, u, v }) catch unreachable;
5052
}

zig/lib/compiler_rt/fixdfei.zig

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
const divCeil = @import("std").math.divCeil;
2-
const common = @import("./common.zig");
3-
const bigIntFromFloat = @import("./int_from_float.zig").bigIntFromFloat;
1+
const std = @import("std");
2+
const builtin = @import("builtin");
3+
const common = @import("common.zig");
4+
const bigIntFromFloat = @import("int_from_float.zig").bigIntFromFloat;
45

56
pub const panic = common.panic;
67

78
comptime {
89
@export(&__fixdfei, .{ .name = "__fixdfei", .linkage = common.linkage, .visibility = common.visibility });
910
}
1011

11-
pub fn __fixdfei(r: [*]u32, bits: usize, a: f64) callconv(.c) void {
12-
return bigIntFromFloat(.signed, r[0 .. divCeil(usize, bits, 32) catch unreachable], a);
12+
pub fn __fixdfei(r: [*]u8, bits: usize, a: f64) callconv(.c) void {
13+
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
14+
return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a);
1315
}

0 commit comments

Comments
 (0)