在 2019/2/8 下午11:24, Maarten Verhage 写道: > Dear people of Mingw64, >
Hello. > I noticed that for the mingw64 build variant that I have: > x86_64-8.1.0-release-win32-seh-rt_v6-rev0 there aren't 32-bit libraries. But > for win32-sjlj there are. > 'win32' stands for '32-bit and 64-bit Windows' rather than '32-bit Windows' due to historical reasons. If you build for x64 then both the macros `_WIN32` and `_WIN64` are defined. In the triplet `x86_64-w64-mingw32` for x64, for example, the segment 'win32' stands for the OS, while the actual arch is designated by the first segment. > I would like to build 32bit applications as well. > If you would like to produce both 32 and 64 bit code using the same toolchain then 0) the compiler itself must have been configured with `--enable-multilib` to be able to produce different code, and 1) 32-bit and 64-bit libraries and CRT must be available. The fact that you didn't see 32-bit files means that 32-bit libraries were unavailable and the toolchain was likely not built with multilib enabled. > 1) Are there specific things in the mingw64 win32-seh source code that would > make it less suitable or less stable to offer the 32 libraries as well? > The x64 SEH is table-based. GCC may generate stack unwind tables that can be used by stack unwinding functions which are standard Windows APIs. The x86 SEH is frame-based. Upon a function's entry, special code is inserted to register the frame, and upon the function's exit additional code is inserted to unregister the frame. There used to be a patent by Borland on such mechanism, preventing everyone else from reinventing it. Although the patent has now expired, there seems to be nobody willing to implement it, largely because that the x86 SEH stack unwind code is linked into executables statically, without any publicly available APIs [1]. [1] http://mingw-w64.org/doku.php/contribute#seh_for_32bits > 2) If not, what would it take that I build myself the 32bit libraries? I > assume I can use my current win32-seh build for that, but I need to obtain > the source code. I hope there is clear documentation to see which sources > are compiled to which library. > Long story short: Use the native toolchains i.e. those whose names start with 'i686_*' to build x86 libraries. It is said that GCC can now be configured with multilib enabled, to produce x64 code with the SEH exception model and x86 code with the SJLJ exception model, but I haven't tried it yet. Back to days when this didn't work, all toolchains were native (no multilib). > Thank you very much for your attention and time! > Best regards, > Maarten Verhage > > > -- Best regards, LH_Mouse _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public