-
Notifications
You must be signed in to change notification settings - Fork 42
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
Will other exception mode other than dwarf be provided? #4
Comments
Hi, not really. I used dwarf to standardize the compilation between 32-bit and 64-bit. |
As far as I know the one who cause performace concern is sjlj, as it introducde some overhead even in happy path. For 32-bit SEH is not avaliable for gcc (it seems due to some non-tech reasons such as patents), but for 64-bit it's OK. SEH is native windows exception model, there shouldn't be any performace problem about it. The major concern for dwarf is about compatibility. As dwarf is likely different from other compilers' (MSVC) model, application will likely to crash or not to pass exceptions correctly if an exception throwed by dwarf code is passing throw non-dwarf codes. This could happen when you're linking with 3rd party binary libs. So for best performace, it is suggested to use dwarf for 32-bit and SEH for 64-bit. |
Good job, but it would be better if you provide TIA. |
I'm open to suggestions. |
Note: the patent on SEH seems to have expired, see: https://patents.google.com/patent/US5628016 |
I guess so. According to this: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-gcc/PKGBUILD:
case "${CARCH}" in
i686)
local _conf="--disable-sjlj-exceptions --with-dwarf2"
LDFLAGS+=" -Wl,--large-address-aware"
local _arch=i686
;;
x86_64)
local _arch=x86-64
local _conf=""
;;
esac So, For 32-bits:There are two options And, for 64-bits:There are two options too Also take a look here: |
Just did a first attempt with gcc configure options
returned: |
Now I compiled the while environment again with this first attempt build and I get this result (on 64-bit):
Is it possible this compiler supports both SJLJ and SEH? Note that the earlier dwarf builds also already defined SEH. Were they supporting both dwarf and SEH? I'm not an exception handling expert so this is a bit confusing to me. Do you think I should publish my latest SJLJ build attempt based on the above information? |
I'm not an expert of it either. I guess although theoretically a compiler can support generating both SJLJ and SEH, but at least there should be command line argument or sth passed to it to tell it which one is chosen. In this case there's no such thing, so I don't think these 2 binaries are using different exception mode. Perhaps we can compile a short demo with exception and output assembly instructions to check what exactly is done for it. |
I'm more of a C programmer than C++ and exceptions are not really my thing. I have just published my SJLJ build here in case you want to give it a go: |
Normally you should issue:
I don't think so, it the one or the other.
May be they are leftovers from the previous build. Note:DWARF is only for I gave your builds a try, they seems And using So, what |
Hi,
64-bit:
In 64-bit My initial thought was to only provide one version, as it's confusing to many people what to use (win32 or posix threads, dwarf/SEH or SJLJ exceptions). |
Good, progress.
Idon't know about this.
The most used threading model is
So, as a summary:For And |
I don't have intention of mixing MSVC with GCC as I generally think its a bad idea that should be avoided. My goal is to make a large repository with packages all built in the same environment. I understand that if I want a single choice, your recommendation is:
|
If there's no intention of MSVC/GCC mixing maybe it will be better to choose dwarf for 32 bit. As SJLJ will introduce overhead in happy path while dwarf won't. |
Ok, so the final conclusion for me is:
|
Yeah, thank you. Maybe we need to be aware of configure for future releases to prevent confusing version information. PS C:\mingw\winlibs\mingw64\bin> .\gcc.exe --version This release is actually an SEH version. |
Good point. I changed my build script so the next release will be correct. |
Thanks a lot for your hard work first. As far as I know for x86_64, it seems SEH is more widely used and doesn't have major week points compared to dwarf. Is there a reason to choose dwarf and not privde an SEH version?
The text was updated successfully, but these errors were encountered: