summaryrefslogtreecommitdiff
path: root/pkg/simdutf
diff options
context:
space:
mode:
authorMitchell Hashimoto <m@mitchellh.com>2025-03-12 10:27:20 -0700
committerMitchell Hashimoto <m@mitchellh.com>2025-03-12 11:03:54 -0700
commit601acf405908b0da302b7e2d3ffe5fbd0e5ffb4a (patch)
treef84de5a68eddff32ddd50144ba53505d2c793942 /pkg/simdutf
parent7e9be00924144950ab6100cb7136e91c6abb403e (diff)
pkg/highway: upgrade to fix compilation issues on LLVM18
Diffstat (limited to 'pkg/simdutf')
-rw-r--r--pkg/simdutf/build.zig22
1 files changed, 21 insertions, 1 deletions
diff --git a/pkg/simdutf/build.zig b/pkg/simdutf/build.zig
index cbcc3ed68..40058ed78 100644
--- a/pkg/simdutf/build.zig
+++ b/pkg/simdutf/build.zig
@@ -1,8 +1,28 @@
const std = @import("std");
pub fn build(b: *std.Build) !void {
- const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
+ const target = target: {
+ var query = b.standardTargetOptionsQueryOnly(.{});
+
+ // This works around a Zig 0.14 bug where targeting an iOS
+ // simulator sets our CPU model to be "apple_a7" which is
+ // too outdated to support SIMD features and is also wrong.
+ // Simulator binaries run on the host CPU so target native.
+ //
+ // We can remove this when the following builds without
+ // issue without this line:
+ //
+ // zig build -Dtarget=aarch64-ios.17.0-simulator
+ //
+ if (query.abi) |abi| {
+ if (abi == .simulator) {
+ query.cpu_model = .native;
+ }
+ }
+
+ break :target b.resolveTargetQuery(query);
+ };
const lib = b.addStaticLibrary(.{
.name = "simdutf",