-
Notifications
You must be signed in to change notification settings - Fork 360
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
Static library can't use exceptions internally with GNU C++ toolchain #3893
Comments
So, weirdly, this works if you pass EDIT: Consuming the archive in a rust project still has the same uncaught exception. EDIT: |
Thank you for the reproducer, we'll try to investigate it soon. The theory about direct calls could make sens, I wonder if we can somehow prevent it. Maybe we can somehow hint LLVM to change this behaviour |
This is the backtrace I got from running a variant of the problematic code (running on 0.5.x and clang 17 to mirror the vendored libunwind) which fails with the same error. Notice on frame 9, _Unwind_Resume_or_Rethrow, is from libgcc_s rather than the vendored library.
|
I was thinking a little more and I'm convinced that we shouldn't bundle For example, I see issues like #3296 appearing on MacOS as well, even though we don't get the termination error while building the static library and linking against it. Can you think of a reason why we shouldn't strip the objects out in the sbt plugin when building a library? |
Hi, I did a bit more of an investigation since I'm trying to use Scala Native as a library. There are a few problems which I've found:
Having said that I do not see why we could not use the functions mentioned here, plus the gcc extension method I have put together a (simplified) example of the proposed changes on this branch to show it working where I:
wdyt? |
Hi,
I might not be using the correct linker flags, but I can't see to get a Scala native lib to be linked with any combination of flags which allows exceptions to be used in the underlying library.
This is on x86_64 Linux. I see the same issue on the github runners as well on
ubuntu-22.04
.Here is the repro https://github.com/yilinwei/scala-native-issue. I have tried clang versions from 14 through to 17 with no luck.
The text was updated successfully, but these errors were encountered: