Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Zig 0.14.0-dev.1876+41dbd0d0d and update target triple list #197

Merged
merged 2 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ to find and inspect the patch diffs.
* LLVM, LLD, Clang 19.1.0
* zlib 1.3.1
* zstd 1.5.2
* zig 0.14.0-dev.1622+2ac543388
* zig 0.14.0-dev.1876+41dbd0d0d

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

Expand Down Expand Up @@ -102,16 +102,17 @@ is more portable across Linux distributions.
| `aarch64_be-linux-musl` | OK |
| `arm-linux-gnueabi` | [#101](https://github.com/ziglang/zig-bootstrap/issues/101) |
| `arm-linux-gnueabihf` | [#102](https://github.com/ziglang/zig-bootstrap/issues/102) |
| `arm-linux-musleabi` | [#103](https://github.com/ziglang/zig-bootstrap/issues/103) |
| `arm-linux-musleabihf` | [#183](https://github.com/ziglang/zig-bootstrap/issues/183) |
| `arm-linux-musleabi` | OK |
| `arm-linux-musleabihf` | OK |
| `armeb-linux-gnueabi` | [#96](https://github.com/ziglang/zig-bootstrap/issues/96) |
| `armeb-linux-gnueabihf` | [#97](https://github.com/ziglang/zig-bootstrap/issues/97) |
| `armeb-linux-musleabi` | [#98](https://github.com/ziglang/zig-bootstrap/issues/98) |
| `armeb-linux-musleabihf` | [#99](https://github.com/ziglang/zig-bootstrap/issues/99) |
| `armeb-linux-musleabi` | OK |
| `armeb-linux-musleabihf` | OK |
| `loongarch64-linux-gnu` | OK |
| `loongarch64-linux-gnusf` | OK |
| `loongarch64-linux-musl` | OK |
| `mips-linux-gnueabi` | OK |
| `mips-linux-gnueabihf` | OK |
| `mips-linux-gnueabi` | [#195](https://github.com/ziglang/zig-bootstrap/issues/195) |
| `mips-linux-gnueabihf` | [#196](https://github.com/ziglang/zig-bootstrap/issues/196) |
| `mips-linux-musleabi` | OK |
| `mips-linux-musleabihf` | OK |
| `mips64-linux-gnuabi64` | OK |
Expand All @@ -136,15 +137,15 @@ is more portable across Linux distributions.
| `riscv32-linux-musl` | OK |
| `riscv64-linux-gnu` | OK |
| `riscv64-linux-musl` | OK |
| `s390x-linux-gnu` | [#116](https://github.com/ziglang/zig-bootstrap/issues/116) |
| `s390x-linux-musl` | [#52](https://github.com/ziglang/bootstrap/issues/52) |
| `s390x-linux-gnu` | OK |
| `s390x-linux-musl` | OK |
| `sparc-linux-gnu` | [#117](https://github.com/ziglang/zig-bootstrap/issues/117) |
| `sparc64-linux-gnu` | [#172](https://github.com/ziglang/zig-bootstrap/issues/172) |
| `thumb-linux-musleabi` | [#176](https://github.com/ziglang/zig-bootstrap/issues/176) |
| `thumb-linux-musleabihf` | [#175](https://github.com/ziglang/zig-bootstrap/issues/175) |
| `thumb-windows-gnu` | [#105](https://github.com/ziglang/zig-bootstrap/issues/105) |
| `thumbeb-linux-musleabi` | [#180](https://github.com/ziglang/zig-bootstrap/issues/180) |
| `thumbeb-linux-musleabihf` | [#179](https://github.com/ziglang/zig-bootstrap/issues/179) |
| `thumb-linux-musleabi` | OK |
| `thumb-linux-musleabihf` | OK |
| `thumb-windows-gnu` | OK |
| `thumbeb-linux-musleabi` | OK |
| `thumbeb-linux-musleabihf` | OK |
| `x86-linux-gnu` | OK |
| `x86-linux-musl` | OK |
| `x86-windows-gnu` | OK |
Expand Down
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TARGET="$1" # Example: riscv64-linux-gnu
MCPU="$2" # Examples: `baseline`, `native`, `generic+v7a`, or `arm1176jzf_s`

ROOTDIR="$(pwd)"
ZIG_VERSION="0.14.0-dev.1622+2ac543388"
ZIG_VERSION="0.14.0-dev.1876+41dbd0d0d"

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

Expand Down
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if "%VSCMD_ARG_HOST_ARCH%"=="x86" set OUTDIR=out-win-x86

set ROOTDIR=%~dp0
set "ROOTDIR_CMAKE=%ROOTDIR:\=/%"
set ZIG_VERSION="0.14.0-dev.1622+2ac543388"
set ZIG_VERSION="0.14.0-dev.1876+41dbd0d0d"
set JOBS_ARG=

pushd %ROOTDIR%
Expand Down
6 changes: 2 additions & 4 deletions zig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ check_pie_supported(
OUTPUT_VARIABLE ZIG_PIE_SUPPORTED_BY_CMAKE
LANGUAGES C CXX
)
if(ZIG_PIE AND NOT ZIG_PIE_SUPPORTED_BY_CMAKE)
message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target")
if(ZIG_PIE AND NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target: ${ZIG_PIE_SUPPORTED_BY_CMAKE}")
endif()


Expand Down Expand Up @@ -894,9 +894,7 @@ set(BUILD_COMPILER_RT_ARGS
--name compiler_rt
-femit-bin="${ZIG_COMPILER_RT_C_SOURCE}"
-target "${ZIG_HOST_TARGET_TRIPLE}"
--dep "build_options"
"-Mroot=lib/compiler_rt.zig"
"-Mbuild_options=${ZIG_CONFIG_ZIG_OUT}"
)

add_custom_command(
Expand Down
2 changes: 1 addition & 1 deletion zig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Ensure you have the required dependencies:

* CMake >= 3.15
* System C/C++ Toolchain
* LLVM, Clang, LLD development libraries == 18.x
* LLVM, Clang, LLD development libraries == 19.x

Then it is the standard CMake build process:

Expand Down
4 changes: 1 addition & 3 deletions zig/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int main(int argc, char **argv) {
if (f == NULL)
panic("unable to open config.zig for writing");

const char *zig_version = "0.14.0-dev.1622+2ac543388";
const char *zig_version = "0.14.0-dev.1876+41dbd0d0d";

int written = fprintf(f,
"pub const have_llvm = false;\n"
Expand Down Expand Up @@ -170,9 +170,7 @@ int main(int argc, char **argv) {
"-ofmt=c", "-OReleaseSmall",
"--name", "compiler_rt", "-femit-bin=compiler_rt.c",
"-target", host_triple,
"--dep", "build_options",
"-Mroot=lib/compiler_rt.zig",
"-Mbuild_options=config.zig",
NULL,
};
print_and_run(child_argv);
Expand Down
4 changes: 4 additions & 0 deletions zig/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,10 @@ pub fn build(b: *std.Build) !void {
} else {
update_mingw_step.dependOn(&b.addFail("The -Dmingw-src=... option is required for this step").step);
}

const test_incremental_step = b.step("test-incremental", "Run the incremental compilation test cases");
try tests.addIncrementalTests(b, test_incremental_step);
test_step.dependOn(test_incremental_step);
}

fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void {
Expand Down
34 changes: 13 additions & 21 deletions zig/doc/langref.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -4218,11 +4218,10 @@ pub fn print(self: *Writer, arg0: []const u8, arg1: i32) !void {
{#header_close#}

{#header_open|Atomics#}
<p>TODO: @fence()</p>
<p>TODO: @atomic rmw</p>
<p>TODO: builtin atomic memory ordering enum</p>

{#see_also|@atomicLoad|@atomicStore|@atomicRmw|@fence|@cmpxchgWeak|@cmpxchgStrong#}
{#see_also|@atomicLoad|@atomicStore|@atomicRmw|@cmpxchgWeak|@cmpxchgStrong#}

{#header_close#}

Expand Down Expand Up @@ -4307,7 +4306,7 @@ comptime {
an integer or an enum.
</p>
<p>{#syntax#}AtomicOrder{#endsyntax#} can be found with {#syntax#}@import("std").builtin.AtomicOrder{#endsyntax#}.</p>
{#see_also|@atomicStore|@atomicRmw|@fence|@cmpxchgWeak|@cmpxchgStrong#}
{#see_also|@atomicStore|@atomicRmw||@cmpxchgWeak|@cmpxchgStrong#}
{#header_close#}

{#header_open|@atomicRmw#}
Expand All @@ -4322,7 +4321,7 @@ comptime {
</p>
<p>{#syntax#}AtomicOrder{#endsyntax#} can be found with {#syntax#}@import("std").builtin.AtomicOrder{#endsyntax#}.</p>
<p>{#syntax#}AtomicRmwOp{#endsyntax#} can be found with {#syntax#}@import("std").builtin.AtomicRmwOp{#endsyntax#}.</p>
{#see_also|@atomicStore|@atomicLoad|@fence|@cmpxchgWeak|@cmpxchgStrong#}
{#see_also|@atomicStore|@atomicLoad|@cmpxchgWeak|@cmpxchgStrong#}
{#header_close#}

{#header_open|@atomicStore#}
Expand All @@ -4335,7 +4334,7 @@ comptime {
an integer or an enum.
</p>
<p>{#syntax#}AtomicOrder{#endsyntax#} can be found with {#syntax#}@import("std").builtin.AtomicOrder{#endsyntax#}.</p>
{#see_also|@atomicLoad|@atomicRmw|@fence|@cmpxchgWeak|@cmpxchgStrong#}
{#see_also|@atomicLoad|@atomicRmw|@cmpxchgWeak|@cmpxchgStrong#}
{#header_close#}

{#header_open|@bitCast#}
Expand Down Expand Up @@ -4568,7 +4567,7 @@ comptime {
</p>
<p>{#syntax#}@typeInfo(@TypeOf(ptr)).pointer.alignment{#endsyntax#} must be {#syntax#}>= @sizeOf(T).{#endsyntax#}</p>
<p>{#syntax#}AtomicOrder{#endsyntax#} can be found with {#syntax#}@import("std").builtin.AtomicOrder{#endsyntax#}.</p>
{#see_also|@atomicStore|@atomicLoad|@atomicRmw|@fence|@cmpxchgWeak#}
{#see_also|@atomicStore|@atomicLoad|@atomicRmw|@cmpxchgWeak#}
{#header_close#}

{#header_open|@cmpxchgWeak#}
Expand Down Expand Up @@ -4600,7 +4599,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
</p>
<p>{#syntax#}@typeInfo(@TypeOf(ptr)).pointer.alignment{#endsyntax#} must be {#syntax#}>= @sizeOf(T).{#endsyntax#}</p>
<p>{#syntax#}AtomicOrder{#endsyntax#} can be found with {#syntax#}@import("std").builtin.AtomicOrder{#endsyntax#}.</p>
{#see_also|@atomicStore|@atomicLoad|@atomicRmw|@fence|@cmpxchgStrong#}
{#see_also|@atomicStore|@atomicLoad|@atomicRmw|@cmpxchgStrong#}
{#header_close#}

{#header_open|@compileError#}
Expand Down Expand Up @@ -4766,10 +4765,10 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
Converts an integer into an {#link|enum#} value. The return type is the inferred result type.
</p>
<p>
Attempting to convert an integer with no corresponding value in the enum invokes
Attempting to convert an integer with no corresponding value in the enum invokes
safety-checked {#link|Undefined Behavior#}.
Note that a {#link|non-exhaustive enum|Non-exhaustive enum#} has corresponding values for all
integers in the enum's integer tag type: the {#syntax#}_{#endsyntax#} value represents all
integers in the enum's integer tag type: the {#syntax#}_{#endsyntax#} value represents all
the remaining unnamed integers in the enum's tag type.
</p>
{#see_also|@intFromEnum#}
Expand Down Expand Up @@ -4857,15 +4856,6 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
{#see_also|@export#}
{#header_close#}

{#header_open|@fence#}
<pre>{#syntax#}@fence(order: AtomicOrder) void{#endsyntax#}</pre>
<p>
The {#syntax#}fence{#endsyntax#} function is used to introduce happens-before edges between operations.
</p>
<p>{#syntax#}AtomicOrder{#endsyntax#} can be found with {#syntax#}@import("std").builtin.AtomicOrder{#endsyntax#}.</p>
{#see_also|@atomicStore|@atomicLoad|@atomicRmw|@cmpxchgWeak|@cmpxchgStrong#}
{#header_close#}

{#header_open|@field#}
<pre>{#syntax#}@field(lhs: anytype, comptime field_name: []const u8) (field){#endsyntax#}</pre>
<p>Performs field access by a compile-time string. Works on both fields and declarations.
Expand Down Expand Up @@ -6241,11 +6231,13 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
</li>
<li>Are you linking libc? In this case, {#syntax#}std.heap.c_allocator{#endsyntax#} is likely
the right choice, at least for your main allocator.</li>
<li>
Need to use the same allocator in multiple threads? Use one of your choice
wrapped around {#syntax#}std.heap.ThreadSafeAllocator{#endsyntax#}
</li>
<li>
Is the maximum number of bytes that you will need bounded by a number known at
{#link|comptime#}? In this case, use {#syntax#}std.heap.FixedBufferAllocator{#endsyntax#} or
{#syntax#}std.heap.ThreadSafeFixedBufferAllocator{#endsyntax#} depending on whether you need
thread-safety or not.
{#link|comptime#}? In this case, use {#syntax#}std.heap.FixedBufferAllocator{#endsyntax#}.
</li>
<li>
Is your program a command line application which runs from start to end without any fundamental
Expand Down
2 changes: 1 addition & 1 deletion zig/lib/compiler/aro/aro/Compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ fn generateSystemDefines(comp: *Compilation, w: anytype) !void {
),
else => {},
}
if (comp.target.abi == .android) {
if (comp.target.isAndroid()) {
try w.writeAll("#define __ANDROID__ 1\n");
}

Expand Down
23 changes: 3 additions & 20 deletions zig/lib/compiler/aro/aro/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {
.spirv,
.spirv32,
.loongarch32,
.dxil,
.xtensa,
=> {}, // Already 32 bit

Expand All @@ -509,7 +508,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {
.arc,
.avr,
.csky,
.dxil,
.hexagon,
.kalimba,
.lanai,
Expand Down Expand Up @@ -578,7 +576,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.bpfel => "bpfel",
.bpfeb => "bpfeb",
.csky => "csky",
.dxil => "dxil",
.hexagon => "hexagon",
.loongarch32 => "loongarch32",
.loongarch64 => "loongarch64",
Expand Down Expand Up @@ -655,7 +652,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.tvos => "tvos",
.watchos => "watchos",
.driverkit => "driverkit",
.shadermodel => "shadermodel",
.visionos => "xros",
.serenity => "serenity",
.bridgeos => "bridgeos",
Expand Down Expand Up @@ -693,6 +689,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.eabi => "eabi",
.eabihf => "eabihf",
.android => "android",
.androideabi => "androideabi",
.musl => "musl",
.musleabi => "musleabi",
.musleabihf => "musleabihf",
Expand All @@ -702,22 +699,8 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.cygnus => "cygnus",
.simulator => "simulator",
.macabi => "macabi",
.pixel => "pixel",
.vertex => "vertex",
.geometry => "geometry",
.hull => "hull",
.domain => "domain",
.compute => "compute",
.library => "library",
.raygeneration => "raygeneration",
.intersection => "intersection",
.anyhit => "anyhit",
.closesthit => "closesthit",
.miss => "miss",
.callable => "callable",
.mesh => "mesh",
.amplification => "amplification",
.ohos => "openhos",
.ohos => "ohos",
.ohoseabi => "ohoseabi",
};
writer.writeAll(llvm_abi) catch unreachable;
return stream.getWritten();
Expand Down
1 change: 1 addition & 0 deletions zig/lib/compiler/fmt.zig
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ const FmtError = error{
LockViolation,
NetNameDeleted,
InvalidArgument,
ProcessNotFound,
} || fs.File.OpenError;

fn fmtPath(fmt: *Fmt, file_path: []const u8, check_mode: bool, dir: fs.Dir, sub_path: []const u8) FmtError!void {
Expand Down
Loading