-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
zig c++ does not support exceptions on macos #12992
Comments
Does still work on Ubuntu 20:
|
Works on Windows aswell:
|
It could be, but since this is a macos issue only it seems different. Exceptions works fine on Windows & Linux. That being said they are other issues on Linux itself that make zig c++ not usable in prod for us. I was investigating using zig c++ to provide a clean cross-compiler for our C++ code base with the hope of introducing zig later on - and getting the benefit of being able to compile everything with the same compiler on a single CI server in the short term. I dont have a reduced test case which is why I didn't file an issue for those, but for example backtrace() and libunwind can't match symbols at all which makes it a no-go for us since we need to print stacktrace in case of crash or run-time panic/asserts. Also we're encountering crashes in debug (-g) builds which work fine in -O1/-O2 builds (and on vanilla Clang with ASAN & GCC). Hard to say exactly what the issue is there without diving in deeper but it looks like incorrectly initialized memory issues (based on the variable & memory values in gdb). Maybe there's some global libc++ library initialization functions that aren't called - I don't know much about glibc & libc++'s internals but I know that MSVC's CRT library hooks in initialization functions that must run before everything else without which mayhem (and early crash) ensue... |
@prenaux I've been playing around with the same idea, trying Debug build problems are probably caused because Still, I think |
Are you referring to issues like these? I guess it might be worth making a proposal or meta issue to track these, idk how much issues they present. But aside from that, I think |
I'm referring to this: https://github.com/upx/upx-test-build-with-zig/actions/runs/3447041717 |
@markus-oberhumer Thanks for the pointer, indeed If that's indeed the cause I'm not convinced it is a practical default either, we do run linters, asan, valgrind and have custom memory allocators that do memory debugging and our code runs on quite a few platforms with 0 error/warnings from all of them. - Obviously that doesn't mean there's 0 issue in our code and that ASAN At the very least I would hope this to be configurable and clearly documented. |
Zig Version
0.10.0-dev.4192+c75e8f361
Steps to Reproduce
Initially tested on 0.10.0-dev.2377+71e2a56e3, same thing happens on 0.10.0-dev.4192+c75e8f361
Same issue as #9591 but for macOS arm64 (on an M1 mbp).
yikes.cpp:
Expected Behavior
With clang:
Actual Behavior
With zig c++:
The text was updated successfully, but these errors were encountered: