Cross Building Tcl Using Mingw32-gcc (4.9.2)

Home » CentOS » Cross Building Tcl Using Mingw32-gcc (4.9.2)
CentOS 1 Comment

I posted this to the comp.lang.tcl newsgroup, but it might relate to a possible bug in the Mingw32 cross-build environment under CentOS 6 (or EPEL).

Forwarded Message:

From: Robert Heller
Subject: Cross Building Tcl using Mingw32-gcc (4.9.2)
Newsgroups: comp.lang.tcl Message-ID:
Date: Mon, 27 Apr 2015 10:32:01 -0500

I am trying to cross-build Tcl (8.5.8) and I have encounted two problems:

One I easily hacked the sources (wrapped the offending lines with #ifdefs):

./../generic/tclPosixStr.c:347:5: error: duplicate case value
case EPFNOSUPPORT: return “EPFNOSUPPORT”;
^
./../generic/tclPosixStr.c:290:5: error: previously used here
case ENOPROTOOPT: return “ENOPROTOOPT”;
^
./../generic/tclPosixStr.c: In function ‘Tcl_ErrnoMsg’:
./../generic/tclPosixStr.c:795:5: error: duplicate case value
case EPFNOSUPPORT: return “protocol family not supported”;
^
./../generic/tclPosixStr.c:738:5: error: previously used here
case ENOPROTOOPT: return “bad protocol option”;
^

The other I am not sure how to fix:

i686-w64-mingw32-gcc -c -O2 -fomit-frame-pointer -Wall -I”../../generic” -DTCL_TOMMATH -DMP_PREC=4 -I”../../libtommath” -I”..” -DPACKAGE_NAME=\”\” -DPACKAGE_TARNAME=\”\” -DPACKAGE_VERSION=\”\” -DPACKAGE_STRING=\”\” -DPACKAGE_BUGREPORT=\”\” -DSTDC_HEADERS=1 -DHAVE_NO_SEH=1 -DHAVE_NO_LPFN_DECLS=1 -DHAVE_ALLOCA_GCC_INLINE=1 -DHAVE_CAST_TO_UNION=1 -DTCL_CFGVAL_ENCODING=\”cp1252\” -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DBUILD_tcl “../tclWin32Dll.c” -o tclWin32Dll.o
./tclWin32Dll.c:65:3: error: conflicting types for ‘EXCEPTION_REGISTRATION’
} EXCEPTION_REGISTRATION;
^
In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/minwindef.h:146:0,
from /usr/i686-w64-mingw32/sys-root/mingw/include/windef.h:8,
from /usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:69,
from ../tclWinPort.h:72,
from ../../generic/tclPort.h:25,
from ../../generic/tclInt.h:3946,
from ../tclWinInt.h:17,
from ../tclWin32Dll.c:16:
/usr/i686-w64-mingw32/sys-root/mingw/include/winnt.h:3554:43: note: previous declaration of ‘EXCEPTION_REGISTRATION’ was here
typedef EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION;
^

Is there a solution possible? This looks like internal inconsistency with the header files that are part of the build toolchain.

One thought on - Cross Building Tcl Using Mingw32-gcc (4.9.2)

  • At Mon, 27 Apr 2015 11:55:20 -0400 Robert Heller wrote:

    OK, it is a CentOS 6/EPEL problem. I installed the i686-w64-mingw32 packages on a Ubuntu 12.04 VM and had no problems cross building Tcl 8.5.8.

LEAVE A COMMENT