-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
nimRawSetJmp default on Win: light refactoring [backport] #19924
Conversation
Default Windows setting moved to `isDefined()` in "compiler/options.nim" because that's where it's already enabled by default for BSDs. Documentation updated and a comment moved closer to the relevant code.
One more note, |
Won't hurt other compilers. It will actually improve stack unwinding performance (and implicitly exception raising) by a factor of 6: #19197 |
CI failure seems to be Azure's fault: "2022-06-24T11:39:33.5984627Z d:/a/1/s/dist/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file D:\a\1\s\tests\gc\thavlak.exe: Permission denied" |
Positive. I will rerun the failed CI after other CIs are settled. |
in general, nimRawSetJmp fails when compiling with vcc: https://github.com/status-im/nim-stew/runs/6961489500?check_suite_focus=true also, @if vcc is broken in |
RawSetJmp for VCC has been fixed here: #19899 |
This option has only meaning for |
You're confusing again "__builtin_setjmp()", which is a compiler builtin, with "_setjmp()" which is a library function. We're talking about the latter here. |
@stefantalpalaru |
Yes, I saw that. No, it's not a problem, since VCC is the only compiler that can be trusted to correctly build the undocumented second buffer for SEH. The whole point of "nimRawSetJmp", on Windows, is to pass NULL instead of a pointer to that second buffer. If VCC won't let us do that, we only lose the performance advantage, without losing any correctness. If an actual VCC user wants to try and get back that exception raising performance, he should start by benchmarking "_setjmpex(jmpbuf, NULL)" which might do the trick, but that's obviously out of scope for this trivial PR. |
Since Nim 1.6.8 (presumably caused by #19959), cross compiling on Windows to a non-Windows platform causes linker errors due to Compiler options:
Output:
Is this considered a bug, or should I be explicitly choosing the setjmp implementation with |
Please read this abandoned PR's diff. It's the wrong one for such a complaint. |
Apologies, I asked here as it seemed like this was an open follow-up PR so it would be the appropriate place to add the fix. I didn't know it was abandoned. I'll make an issue. |
@exelotl --gc:arc with --exceptions:setjmp produces terrible code and you should use --exceptions:goto instead. |
@Araq this hasn't been the case for me - I don't actually use or want any exceptions in my code at all (I just need my program to hang when an assertion or check fails so I can connect a debugger to it) but there's no way to outright disable them. Anyways, under Meanwhile I don't really know what to do about all this though:
Thanks |
You want |
This pull request is stale because it has been open for 1 year with no activity. Contribute more commits on the pull request and rebase it on the latest devel, or it will be closed in 30 days. Thank you for your contributions. |
This pull request has been marked as stale and closed due to inactivity after 395 days. |
(small refactor of #19891)
Default Windows setting moved to
isDefined()
in "compiler/options.nim" because that's where it's already enabled by default for BSDs.Documentation updated and a comment moved closer to the relevant code.