| Ticket UUID: | 448ba5cbfda349b1e71b5193a50f746c84641410 | ||
| Title: | MINGW build fails for 32bit on 64bit system | ||
| Type: | Bug | Created on: | 2015-07-10 08:16:41 |
| Submitter: | anonymous | Assigned to: | jan.nijtmans |
| Subsystem: | 53. Configuration and Build Tools | Severity: | Important |
| Priority: | 5 Medium | Last modified: | 2016-09-01 16:12:52 |
| Status: | Open | Closed by: | nobody |
| Resolution: | None | Closed on: | |
| Version: | 8.6.4 | ||
| Description: | ||||
I am building Tcl using MSYS2 and the TDM-GCC compiler. This works for 64 bit, if additionally --enable-64bit is passed, or for the static build. With this gcc version, it is also possible to build 32 bit by passing CFLAGS="-m32" LDFLAGS="-m32" to the configure script, but it fails for two reasons. 1. Linking to the precompiled zlib does not work This can be circumvented by hacking the configure script to always build zlib (ZLIB_OBJ instead of ZLIB_DLL) 2. the resource compiler creates 64bit objects. This can be solved by passing --output-format=coff --target=pe-i386 to windres. But the configure script or Makefile doesn't honour RCFLAGS, so it is impossible to do that without hacking the Makefile SUggested solution: 1. Always build the zlib objects. Why does the build system try to link with precompiled binaries? That would solve both zlib issues. 2. Insert RCFLAGS into configure.in and Makefile.in | ||||
| User Comments: | ||||
jan.nijtmans added on 2015-07-10 08:56:34:
Since, effectively, this ticket is asking for support for the TDM gcc compiler, this is not a bug but a feature request. Since everything works out-of-the box with mingw32 and mingw-w64, it could as well be considered a bug in the TDM 32-bit compiler. Was it reported to TDM-gcc as well? That said, introducing RCFLAGS looks like a good idea anyway, I'll have a look at that. But "Linking to the precompiled zlib does not work" sounds like a bug in TDM-gcc that should be reported there. Most likely, the binutils delivered by TDM doesn't support the COFF format, while binutils supplied by mingw32/mingw-w64 works just fine. There is a workaround for the binutils problem in a branch, see: http://core.tcl.tk/tcl/info/f4b66e37c780769fd29a2e7449ffa20c5ecd7818 Does that work better for you? See also bug [b5ced5865b] (this issue is probably a duplicate of that one, but I'm not sure while TDM isn't mentioned anywhere) anonymous added on 2015-07-11 09:58:35:
The issue was not reported to TDM-gcc, because I haven't seen it as a failure of that particular compiler. Nevertheless, linking to the DLL directly also seems to work for the zlib problem. Still, without RCFLAGS, it can't be possible to create 32bit builds on a 64bit standard install, because the windres call has no arguments indicating a 32bit build. Actually, all I'm trying to do is to find an installation of MSYS / MINGW that is able to compile Tcl for both 32bit and 64bit, and so far it has been a painful experience. I installed several different distributions of the mingw compiler, and all failed and different points in the build process. I'm starting afresh now. Is there a recommended download of build tools? jan.nijtmans added on 2015-07-13 08:24:13:
Here is more info from other people: http://wiki.tcl.tk/14828 I'm using either the unmodified installer from mingw.org, or I cross-compile on Cygwin or Ubuntu. Instructions are here: http://core.tcl.tk/tcl/artifact/f783ead8576ad16c?ln=14-81 If something in those instructions is not correct any more, or is not clear enough, feel free to supply suggestions how to improve it. | ||||
