Comments (6)
After updating our SDK to macOS 12.0 Monterey, it seems we face a few version incompatibilities with Zig's libc version which is on the older macOS 11 version. One example:
slimsag@hexops-ci gpu % SDK_PATH="$(pwd)/../.." zig build run-dawn-example -Dtarget=aarch64-macos
error(link): undefined reference to symbol '___isPlatformVersionAtLeast'
error(link): first referenced in '/Users/slimsag/Desktop/hexops/mach/gpu/zig-cache/o/3bd047a77c4b38019657965ff1fa5151/libdawn-native.a(/Users/slimsag/Desktop/hexops/mach/gpu/zig-cache/o/23eba02466d5f0700a75334aa5662ea4/BackendMTL.o)'
thread 7268393 panic: attempt to unwrap error: UndefinedSymbolReference
Another example:
Zig's sys/cdefs.h
on macOS targets does not define things like __kernel_ptr_semantics
as empty, which leads to type definitions in e.g. IOKit/IOTypes.h
becoming syntactically invalid (macro doesn't expand to nothing):
typedef mach_vm_address_t IOVirtualAddress __kernel_ptr_semantics;
from mach.
Curiously, even after updating Zig's libc headers to reflect macOS 12 in ziglang/zig#10200 - the linking failure did not go away:
error(link): undefined reference to symbol '___isPlatformVersionAtLeast'
error(link): first referenced in '/Users/slimsag/Desktop/hexops/mach/gpu/zig-cache/o/a4898ce0dd88be1c63f03f62251f9adb/libdawn-native.a(/Users/slimsag/Desktop/hexops/mach/gpu/zig-cache/o/22c50fc6233f5284bfe9a440d8943d61/BackendMTL.o)'
thread 7413503 panic: attempt to unwrap error: UndefinedSymbolReference
isPlatformVersionAtLeast
is referenced in every Dawn/WebGPU binary compiled with Zig natively, but is not found when cross-compiling.
isPlatformVersionAtLeast
is not defined in Dawn's source code, nor in any framework in the macOS 12 SDK so far as I can see. I've searched all source files and binaries, it's not there. Where does this thing come from?
from mach.
Looks like LLVM inserts it: https://reviews.llvm.org/D90367
Speculating, I suspect that when compiling natively clang's compiler-rt (which defines this symbol) is linked in - while when cross compiling Zig's port of compiler-rt does not have this as it was a relatively recent addition (Oct 2020) ziglang/zig#1504
Maybe we need to port this to Zig's compiler-rt library.
from mach.
Filed ziglang/zig#10227 and working on a PR for Zig
from mach.
from mach.
Confirmed fixed.
from mach.
Related Issues (20)
- Ability to turn off logging HOT 1
- gpu: gpu-dawn crashes JVM on Windows 11 HOT 3
- build problem only use mach-core: update to Zig 2024.5.0-mach, hit build problem HOT 1
- Investigate d3d12 vs. metal alignment/padding differences in sysgpu HOT 4
- Resizing a window on Windows / D3D12 using sysgpu fails HOT 2
- core: app crashes when resizing the window on linux/nvidia
- Sprite example fails to run on D3D12 with a discrete GPU HOT 2
- Underscore vs Dash in module references HOT 1
- website: broken example links
- vulkan_zig_generated documentation is outdated
- core: mach triangle example project segfaults (PopOS)
- Add mouse capture mode
- sysgpu: expected type 'sysgpu.sysgpu.main.BackendType', found 'options.build.SysgpuBackend' HOT 2
- panic: api error, error.OutOfDateKHR HOT 2
- Offer terminating a query early HOT 3
- core: sprite example seg faults when closed on windows 11 HOT 1
- Add a format function to vector and matrix structs
- core: `printTitle` doesn't work on windows 11 HOT 2
- proposal: add more 2D collision mechanisms to math.collision HOT 4
- Text module: alpha blending of the fonts is not applied correctly in shader
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mach.