Skip to content

Commit a234f00

Browse files
committed
update zig sources to 0.14.0-dev.1499+0006b56f4
1 parent 079310b commit a234f00

File tree

856 files changed

+102083
-91962
lines changed

Some content is hidden

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

856 files changed

+102083
-91962
lines changed

README.md

+1-1
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-rc4
1212
* zlib 1.3.1
1313
* zstd 1.5.2
14-
* zig 0.14.0-dev.1390+cb0e6d8aa
14+
* zig 0.14.0-dev.1499+0006b56f4
1515

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

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.1390+cb0e6d8aa"
10+
ZIG_VERSION="0.14.0-dev.1499+0006b56f4"
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.1390+cb0e6d8aa"
38+
set ZIG_VERSION="0.14.0-dev.1499+0006b56f4"
3939
set JOBS_ARG=
4040

4141
pushd %ROOTDIR%

zig/CMakeLists.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ else()
137137
set(ZIG_SYSTEM_LIBCXX "stdc++" CACHE STRING "system libcxx name for build.zig")
138138
endif()
139139

140-
find_package(llvm 18)
141-
find_package(clang 18)
142-
find_package(lld 18)
140+
find_package(llvm 19)
141+
find_package(clang 19)
142+
find_package(lld 19)
143143

144144
if(ZIG_STATIC_ZLIB)
145145
if (MSVC)
@@ -600,6 +600,7 @@ set(ZIG_STAGE2_SOURCES
600600
src/link/Elf.zig
601601
src/link/Elf/Archive.zig
602602
src/link/Elf/Atom.zig
603+
src/link/Elf/AtomList.zig
603604
src/link/Elf/LdScript.zig
604605
src/link/Elf/LinkerDefined.zig
605606
src/link/Elf/Object.zig

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.1390+cb0e6d8aa";
126+
const char *zig_version = "0.14.0-dev.1499+0006b56f4";
127127

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

zig/build.zig

+22
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,24 @@ fn addCompilerStep(b: *std.Build, options: AddCompilerStepOptions) *std.Build.St
647647
.strip = options.strip,
648648
.sanitize_thread = options.sanitize_thread,
649649
.single_threaded = options.single_threaded,
650+
.code_model = switch (options.target.result.cpu.arch) {
651+
// NB:
652+
// For loongarch, LLVM supports only small, medium and large
653+
// code model. If we don't explicitly specify the code model,
654+
// the default value `small' will be used.
655+
//
656+
// Since zig binary itself is relatively large, using a `small'
657+
// code model will cause
658+
//
659+
// relocation R_LARCH_B26 out of range
660+
//
661+
// error when linking a loongarch64 zig binary.
662+
//
663+
// Here we explicitly set code model to `medium' to avoid this
664+
// error.
665+
.loongarch64 => .medium,
666+
else => .default,
667+
},
650668
});
651669
exe.root_module.valgrind = options.valgrind;
652670
exe.stack_size = stack_size;
@@ -1081,6 +1099,8 @@ const clang_libs = [_][]const u8{
10811099
"clangToolingCore",
10821100
"clangExtractAPI",
10831101
"clangSupport",
1102+
"clangInstallAPI",
1103+
"clangAST",
10841104
};
10851105
const lld_libs = [_][]const u8{
10861106
"lldMinGW",
@@ -1102,6 +1122,7 @@ const llvm_libs = [_][]const u8{
11021122
"LLVMTextAPIBinaryReader",
11031123
"LLVMCoverage",
11041124
"LLVMLineEditor",
1125+
"LLVMSandboxIR",
11051126
"LLVMXCoreDisassembler",
11061127
"LLVMXCoreCodeGen",
11071128
"LLVMXCoreDesc",
@@ -1237,6 +1258,7 @@ const llvm_libs = [_][]const u8{
12371258
"LLVMDWARFLinkerParallel",
12381259
"LLVMDWARFLinkerClassic",
12391260
"LLVMDWARFLinker",
1261+
"LLVMCodeGenData",
12401262
"LLVMGlobalISel",
12411263
"LLVMMIRParser",
12421264
"LLVMAsmPrinter",

zig/cmake/Findclang.cmake

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
1717
if(${LLVM_LINK_MODE} STREQUAL "shared")
1818
find_library(CLANG_LIBRARIES
1919
NAMES
20-
libclang-cpp.so.18
21-
libclang-cpp.so.18.1
22-
clang-cpp-18.0
23-
clang-cpp180
20+
libclang-cpp.so.19
21+
libclang-cpp.so.19.1
22+
clang-cpp-19.0
23+
clang-cpp190
2424
clang-cpp
2525
NAMES_PER_DIR
2626
HINTS "${LLVM_LIBDIRS}"
@@ -68,6 +68,8 @@ else()
6868
FIND_AND_ADD_CLANG_LIB(clangToolingCore)
6969
FIND_AND_ADD_CLANG_LIB(clangExtractAPI)
7070
FIND_AND_ADD_CLANG_LIB(clangSupport)
71+
FIND_AND_ADD_CLANG_LIB(clangInstallAPI)
72+
FIND_AND_ADD_CLANG_LIB(clangAST)
7173
endif()
7274

7375
if (MSVC)

zig/cmake/Findlld.cmake

+16-16
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
1010
HINTS ${LLVM_INCLUDE_DIRS}
1111
PATHS
12-
/usr/lib/llvm-18/include
13-
/usr/local/llvm180/include
14-
/usr/local/llvm18/include
15-
/usr/local/opt/llvm@18/include
16-
/opt/homebrew/opt/llvm@18/include
12+
/usr/lib/llvm-19/include
13+
/usr/local/llvm190/include
14+
/usr/local/llvm19/include
15+
/usr/local/opt/llvm@19/include
16+
/opt/homebrew/opt/llvm@19/include
1717
/mingw64/include)
1818

19-
find_library(LLD_LIBRARY NAMES lld-18.0 lld180 lld NAMES_PER_DIR
19+
find_library(LLD_LIBRARY NAMES lld-19.0 lld190 lld NAMES_PER_DIR
2020
HINTS ${LLVM_LIBDIRS}
2121
PATHS
22-
/usr/lib/llvm-18/lib
23-
/usr/local/llvm180/lib
24-
/usr/local/llvm18/lib
25-
/usr/local/opt/llvm@18/lib
26-
/opt/homebrew/opt/llvm@18/lib
22+
/usr/lib/llvm-19/lib
23+
/usr/local/llvm190/lib
24+
/usr/local/llvm19/lib
25+
/usr/local/opt/llvm@19/lib
26+
/opt/homebrew/opt/llvm@19/lib
2727
)
2828
if(EXISTS ${LLD_LIBRARY})
2929
set(LLD_LIBRARIES ${LLD_LIBRARY})
@@ -34,11 +34,11 @@ else()
3434
HINTS ${LLVM_LIBDIRS}
3535
PATHS
3636
${LLD_LIBDIRS}
37-
/usr/lib/llvm-18/lib
38-
/usr/local/llvm180/lib
39-
/usr/local/llvm18/lib
40-
/usr/local/opt/llvm@18/lib
41-
/opt/homebrew/opt/llvm@18/lib
37+
/usr/lib/llvm-19/lib
38+
/usr/local/llvm190/lib
39+
/usr/local/llvm19/lib
40+
/usr/local/opt/llvm@19/lib
41+
/opt/homebrew/opt/llvm@19/lib
4242
/mingw64/lib
4343
/c/msys64/mingw64/lib
4444
c:/msys64/mingw64/lib)

zig/cmake/Findllvm.cmake

+9-7
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ if(ZIG_USE_LLVM_CONFIG)
1717
# terminate when the right LLVM version is not found.
1818
unset(LLVM_CONFIG_EXE CACHE)
1919
find_program(LLVM_CONFIG_EXE
20-
NAMES llvm-config-18 llvm-config-18.0 llvm-config180 llvm-config18 llvm-config NAMES_PER_DIR
20+
NAMES llvm-config-19 llvm-config-19.0 llvm-config190 llvm-config19 llvm-config NAMES_PER_DIR
2121
PATHS
2222
"/mingw64/bin"
2323
"/c/msys64/mingw64/bin"
2424
"c:/msys64/mingw64/bin"
25-
"C:/Libraries/llvm-18.0.0/bin")
25+
"C:/Libraries/llvm-19.0.0/bin")
2626

2727
if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
2828
if (NOT LLVM_CONFIG_ERROR_MESSAGES STREQUAL "")
@@ -40,9 +40,9 @@ if(ZIG_USE_LLVM_CONFIG)
4040
OUTPUT_STRIP_TRAILING_WHITESPACE)
4141

4242
get_filename_component(LLVM_CONFIG_DIR "${LLVM_CONFIG_EXE}" DIRECTORY)
43-
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 18 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 19 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 19)
43+
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 19 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 20 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 20)
4444
# Save the error message, in case this is the last llvm-config we find
45-
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 18.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
45+
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 19.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
4646

4747
# Ignore this directory and try the search again
4848
list(APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}")
@@ -63,12 +63,12 @@ if(ZIG_USE_LLVM_CONFIG)
6363
ERROR_VARIABLE LLVM_CONFIG_ERROR
6464
ERROR_STRIP_TRAILING_WHITESPACE)
6565

66-
if (LLVM_CONFIG_ERROR)
66+
if (LLVM_CONFIG_ERROR)
6767
# Save the error message, in case this is the last llvm-config we find
6868
if (ZIG_SHARED_LLVM)
69-
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 18.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
69+
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 19.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
7070
else()
71-
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 18.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
71+
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 19.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
7272
endif()
7373

7474
# Ignore this directory and try the search again
@@ -200,6 +200,7 @@ else()
200200
FIND_AND_ADD_LLVM_LIB(LLVMTextAPIBinaryReader)
201201
FIND_AND_ADD_LLVM_LIB(LLVMCoverage)
202202
FIND_AND_ADD_LLVM_LIB(LLVMLineEditor)
203+
FIND_AND_ADD_LLVM_LIB(LLVMSandboxIR)
203204
FIND_AND_ADD_LLVM_LIB(LLVMXCoreDisassembler)
204205
FIND_AND_ADD_LLVM_LIB(LLVMXCoreCodeGen)
205206
FIND_AND_ADD_LLVM_LIB(LLVMXCoreDesc)
@@ -335,6 +336,7 @@ else()
335336
FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinkerParallel)
336337
FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinkerClassic)
337338
FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinker)
339+
FIND_AND_ADD_LLVM_LIB(LLVMCodeGenData)
338340
FIND_AND_ADD_LLVM_LIB(LLVMGlobalISel)
339341
FIND_AND_ADD_LLVM_LIB(LLVMMIRParser)
340342
FIND_AND_ADD_LLVM_LIB(LLVMAsmPrinter)

zig/doc/langref.html.in

+2
Original file line numberDiff line numberDiff line change
@@ -2138,6 +2138,7 @@ or
21382138
</p>
21392139
{#code|struct_default_field_values.zig#}
21402140

2141+
{#header_open|Faulty Default Field Values#}
21412142
<p>
21422143
Default field values are only appropriate when the data invariants of a struct
21432144
cannot be violated by omitting that field from an initialization.
@@ -2162,6 +2163,7 @@ or
21622163
without violating data invariants, then use an initialization method that accepts
21632164
those runtime values, and populates the remaining fields.</p>
21642165
{#header_close#}
2166+
{#header_close#}
21652167

21662168
{#header_open|extern struct#}
21672169
<p>An {#syntax#}extern struct{#endsyntax#} has in-memory layout matching

zig/lib/compiler/aro/aro/target.zig

+1
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
649649
.visionos => "xros",
650650
.driverkit => "driverkit",
651651
.shadermodel => "shadermodel",
652+
.bridgeos => "bridgeos",
652653
.opencl,
653654
.opengl,
654655
.vulkan,

zig/lib/compiler_rt/comparef.zig

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ pub inline fn cmpf2(comptime T: type, comptime RT: type, a: T, b: T) RT {
6161
}
6262

6363
pub inline fn cmp_f80(comptime RT: type, a: f80, b: f80) RT {
64-
const a_rep = std.math.break_f80(a);
65-
const b_rep = std.math.break_f80(b);
64+
const a_rep = std.math.F80.fromFloat(a);
65+
const b_rep = std.math.F80.fromFloat(b);
6666
const sig_bits = std.math.floatMantissaBits(f80);
6767
const int_bit = 0x8000000000000000;
6868
const sign_bit = 0x8000;

zig/lib/compiler_rt/extendf.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub inline fn extend_f80(comptime src_t: type, a: std.meta.Int(.unsigned, @typeI
131131
}
132132

133133
dst.exp |= sign;
134-
return std.math.make_f80(dst);
134+
return dst.toFloat();
135135
}
136136

137137
test {

zig/lib/compiler_rt/extendxftf2.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn __extendxftf2(a: f80) callconv(.C) f128 {
1818
const dst_min_normal = @as(u128, 1) << dst_sig_bits;
1919

2020
// Break a into a sign and representation of the absolute value
21-
var a_rep = std.math.break_f80(a);
21+
var a_rep = std.math.F80.fromFloat(a);
2222
const sign = a_rep.exp & 0x8000;
2323
a_rep.exp &= 0x7FFF;
2424
var abs_result: u128 = undefined;

zig/lib/compiler_rt/subxf3.zig

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ comptime {
88
}
99

1010
fn __subxf3(a: f80, b: f80) callconv(.C) f80 {
11-
var b_rep = std.math.break_f80(b);
11+
var b_rep = std.math.F80.fromFloat(b);
1212
b_rep.exp ^= 0x8000;
13-
const neg_b = std.math.make_f80(b_rep);
13+
const neg_b = b_rep.toFloat();
1414
return a + neg_b;
1515
}

zig/lib/compiler_rt/truncf.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub inline fn trunc_f80(comptime dst_t: type, a: f80) dst_t {
121121
const dst_nan_mask = dst_qnan - 1;
122122

123123
// Break a into a sign and representation of the absolute value
124-
var a_rep = std.math.break_f80(a);
124+
var a_rep = std.math.F80.fromFloat(a);
125125
const sign = a_rep.exp & 0x8000;
126126
a_rep.exp &= 0x7FFF;
127127
a_rep.fraction &= 0x7FFFFFFFFFFFFFFF;

zig/lib/compiler_rt/trunctfxf2.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ pub fn __trunctfxf2(a: f128) callconv(.C) f80 {
6464
}
6565

6666
res.exp |= sign;
67-
return math.make_f80(res);
67+
return res.toFloat();
6868
}

zig/lib/include/__clang_cuda_intrinsics.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ inline __device__ unsigned int __activemask() {
215215
#if CUDA_VERSION < 9020
216216
return __nvvm_vote_ballot(1);
217217
#else
218-
unsigned int mask;
219-
asm volatile("activemask.b32 %0;" : "=r"(mask));
220-
return mask;
218+
return __nvvm_activemask();
221219
#endif
222220
}
223221

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*===---- __stdarg_header_macro.h ------------------------------------------===
2+
*
3+
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
* See https://llvm.org/LICENSE.txt for license information.
5+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
*
7+
*===-----------------------------------------------------------------------===
8+
*/
9+
10+
#ifndef __STDARG_H
11+
#define __STDARG_H
12+
#endif
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*===---- __stddef_header_macro.h ------------------------------------------===
2+
*
3+
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
* See https://llvm.org/LICENSE.txt for license information.
5+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
*
7+
*===-----------------------------------------------------------------------===
8+
*/
9+
10+
#ifndef __STDDEF_H
11+
#define __STDDEF_H
12+
#endif

0 commit comments

Comments
 (0)