Menu

How to turn off Global Optimization and change Exception Handling model like MSVC does?

Help
Andrey
2022-06-09
2022-07-04
  • Andrey

    Andrey - 2022-06-09

    I see an important node in Boost::Coroutine2 lib (https://www.boost.org/doc/libs/1_79_0/libs/coroutine2/doc/html/coroutine2/overview.html) doc:

    Windows using fcontext_t: turn off global program optimization (/GL) and change /EHsc (compiler assumes that functions declared as extern "C" never throw a C++ exception) to /EHs (tells compiler assumes that functions declared as extern "C" may throw an exception).

    I think, it may be related to my problem: same MinGW compiled executable behaves differently being run by Wine emulator and in native Windows. Code throws exception in coroutine and has catch-block for exception immediately there.
    Being run by Wine emulator, program terminates with abnormal termination message, but being run in native Windows, thrown exception properly caught.

    Can you advise, what are equivalent parameters of MSVC's /GL and /EHs for MinGW?
    Thank you, in advance!

     
  • Andrey

    Andrey - 2022-07-04

    I could build my executable for Win32, and it works being run with Wine32. Everything is quite the same, only target platform is different.
    This solution solves my task and Win64 problem is not a priority for me now.

     

Log in to post a comment.