Crosscompilation on Mac: Unterschied zwischen den Versionen
Adrian (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „# install xcode: http://itunes.apple.com/us/app/xcode/id497799835 ## install xcode command line tools: xcode-select --install ## agree to Xcode license in Termina…“) |
Adrian (Diskussion | Beiträge) |
||
Zeile 14: | Zeile 14: | ||
# change gcc.mk | # change gcc.mk | ||
## --enable-threads=posix | ## --enable-threads=posix | ||
+ | ## add winpthreads to "$(PKG)_DEPS :=" | ||
Version vom 7. Januar 2015, 18:20 Uhr
- install xcode: http://itunes.apple.com/us/app/xcode/id497799835
- install xcode command line tools: xcode-select --install
- agree to Xcode license in Terminal: sudo xcodebuild -license
- install macports
- sudo port install glib2 intltool p5-xml-parser gpatch scons wget xz
- clone repo
- git clone -b master https://github.com/mxe/mxe.git
- make build-requirements from within mxe dir
- change settings.mk for desired targets
- build gcc first time
- change gcc.mk
- --enable-threads=posix
- add winpthreads to "$(PKG)_DEPS :="
Stuff
Why doesn't mingw-w64 gcc support Dwarf-2 Exception Handling?
The Dwarf-2 EH implementation for Windows is not designed at all to work under 64-bit Windows applications. In win32 mode, the exception unwind handler cannot propagate through non-dw2 aware code, this means that any exception going through any non-dw2 aware "foreign frames" code will fail, including Windows system DLLs and DLLs built with Visual Studio. Dwarf-2 unwinding code in gcc inspects the x86 unwinding assembly and is unable to proceed without other dwarf-2 unwind information.
The SetJump LongJump method of exception handling works for most cases on both win32 and win64, except for general protection faults. Structured exception handling support in gcc is being developed to overcome the weaknesses of dw2 and sjlj. On win64, the unwind-information are placed in xdata-section and there is the .pdata (function descriptor table) instead of the stack. For win32, the chain of handlers are on stack and need to be saved/restored by real executed code.
qt-project.org/wiki/MinGW-64-bit
SJLJ (setjmp/longjmp): – available for 32 bit and 64 bit – not “zero-cost”: even if an exception isn’t thrown, it incurs a minor performance penalty (~15% in exception heavy code) – allows exceptions to traverse through e.g. windows callbacks
DWARF (DW2, dwarf-2) – available for 32 bit only – no permanent runtime overhead – needs whole call stack to be dwarf-enabled, which means exceptions cannot be thrown over e.g. Windows system DLLs.
SEH (zero overhead exception) – will be available for 64-bit GCC 4.8.