Closed david4r4 closed 6 months ago
I've been able to reproduce this with a similarly large pre-built static library, on macOS M3, using a slightly older Zig version:
0.12.0-dev.3180+83e578a18
Steps to reproduce with the above Zig version:
git clone https://github.com/hexops/mach-gpu-dawn
cd mach-gpu-dawn/
git checkout sg/static-library-overflow
zig build
download_dir: /Volumes/data/hexops/tmp/mach-gpu-dawn/zig-cache/mach/gpu-dawn/release-cdd4a1a/aarch64-macos-none/release-fast/download
info(mach_gpu_dawn): downloading https://github.com/hexops/mach-gpu-dawn/releases/download/release-cdd4a1a/libdawn_aarch64-macos-none_release-fast.a.gz
info(mach_gpu_dawn): finished
info(mach_gpu_dawn): extracting /Volumes/data/hexops/tmp/mach-gpu-dawn/zig-cache/mach/gpu-dawn/release-cdd4a1a/aarch64-macos-none/release-fast/download/compressed.gz
info(mach_gpu_dawn): finished
info(mach_gpu_dawn): downloading https://github.com/hexops/mach-gpu-dawn/releases/download/release-cdd4a1a/headers.json.gz
info(mach_gpu_dawn): finished
install
└─ install mach-gpu-dawn-lib
└─ zig build-lib mach-gpu-dawn-lib Debug native failure
error: error: Overflow
error: the following command exited with error code 1:
/Users/slimsag/zig/0.12.0-dev.3180+83e578a18/files/zig build-lib -ldawn -lobjc -ODebug -iframework /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/Frameworks -isystem /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/include -I /Volumes/data/hexops/tmp/mach-gpu-dawn/zig-cache/mach/gpu-dawn/release-cdd4a1a/include -I /Volumes/data/hexops/tmp/mach-gpu-dawn/src/dawn -iframework /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/Frameworks -isystem /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/include -iframework /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/Frameworks -isystem /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/include -iframework /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/Frameworks -isystem /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/include -L /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/lib -L /Volumes/data/hexops/tmp/mach-gpu-dawn/zig-cache/mach/gpu-dawn/release-cdd4a1a/aarch64-macos-none/release-fast -L /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/lib -L /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/lib -L /Users/slimsag/.cache/zig/p/122010c1a745ea06dee3012fbd3b311bd3d75ec39ded6bf566b36ebe3cd8da482347/lib -Mroot=/Volumes/data/hexops/tmp/mach-gpu-dawn/zig-cache/o/30002037093dd2fc6999af4c2f599c8a/empty.c -framework Foundation -framework Metal -framework CoreGraphics -framework IOKit -framework IOSurface -framework QuartzCore -framework CoreFoundation -framework CoreImage -framework CoreVideo -lc++ --cache-dir /Volumes/data/hexops/tmp/mach-gpu-dawn/zig-cache --global-cache-dir /Users/slimsag/.cache/zig --name mach-gpu-dawn-lib -static --listen=-
Build Summary: 2/5 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install mach-gpu-dawn-lib transitive failure
└─ zig build-lib mach-gpu-dawn-lib Debug native failure
error: the following build command failed with exit code 1:
/Volumes/data/hexops/tmp/mach-gpu-dawn/zig-cache/o/858dc668c47581a652742ce73c5a60e8/build /Users/slimsag/zig/0.12.0-dev.3180+83e578a18/files/zig /Volumes/data/hexops/tmp/mach-gpu-dawn /Volumes/data/hexops/tmp/mach-gpu-dawn/zig-cache /Users/slimsag/.cache/zig --seed 0x93446939 -Z897b19a522970a87
Running the build-lib
command at the end of the output above, I was able to confirm that is the command that produces error: Overflow
.
Note that I am phasing out / deprecating this project in a month or two, so I will probably not be able to re-test this. I thought the info was still useful however.
According to the information above, this is a minimal reproducible repository. zig-link-overflow.tar.gz
Note: If compiled under Windows it will run out of memory.
zig build -Dtarget=aarch64-macos
According to the information above, this is a minimal reproducible repository. zig-link-overflow.tar.gz
Using this, I can reproduce the overflow error with both zig 0.12.0 and 0.13.0-dev.35+e8f28cda9 on MacOS M3.
Zig Version
0.13.0-dev.7+40118c769
Steps to Reproduce and Observed Behavior
I am using a fork of zig-bootstrap and when I try to link LLVM in debug mode I get the following error: The fork used: https://github.com/birth-software/zig-bootstrap/tree/make-script-more-configurable
Expected Behavior
To link successfully.