Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Crosscompiliation issue with recent releases (8.6.16/9.0.1)

Closed / Fixedcb338c130b8fba479c2848de4fcd2045c1db12b1Created 2 years agoUpdated 195 days ago
Descriptionplain2024-12-26 23:20:43
Dear TCL-Team,
since several years I crosscompile TCL/TK as part of Maxima Windows installer from Linux to Windows (using x86_64-w64-mingw32-gcc (or i686-w64-mingw32-gcc)).

This worked perfectly - including 8.6.15; the recent 8.6.16 (or 9.0.1) release breaks when using
mkdir b
cd b
../win/configure  --host=x86_64-w64-mingw32 
make
in the tcl-9.0.1 source directory with:

creating libthread.vfs/thread_library (prepare compression)
creating libthread3.0.1.zip from libthread.vfs/thread_library
rm -f tcl9thread301.dll
x86_64-w64-mingw32-gcc -shared   -o tcl9thread301.dll threadNs.o threadCmd.o threadSvCmd.o threadSpCmd.o threadPoolCmd.o psGdbm.o psLmdb.o threadSvListCmd.o threadSvKeylistCmd.o tclXkeylist.o  "/tmp/tcl9.0.1/b/libtclstub.a" -static-libgcc 
cat: libthread3.0.1.zip: No such file or directory
make[1]: *** [Makefile:311: t--enable-zipfs=nocl9thread301.dll] Error 1
make[1]: Leaving directory '/tmp/tcl9.0.1/b/pkgs/thread3.0.1'


There seems to be an issue with the (new) ZIPFS-feature, it works with the option:
--enable-zipfs=no

(and is --enable-64bit really necessary when (cross)compiling to 64 bit? (x86_64-w64-mingw32 in my case)? 64 bit should be the default nowadays??
  
Best regards, Wolfgang Dautermann
anonymous Ticket [cb338c130b]: 3 changes [History diff]2024-12-26 23:22:01
apnadkarniplain2024-12-30 15:38:11
I'll take a look at 9.0.1.

For 8.6.16, you should be using the thread 2.8.x release stream, not 3.x
apnadkarnimarkdown2024-12-30 16:45:19

Confirmed it all works in a msys environment but of course that is different from cross-compilation.

The cause is probably the fix I put in for this bug. The zip creation requires a native tclsh while I suspect in a cross-compile environment, the target tclsh is being invoked.

Possible fixes are

  1. require a native tclsh (not sure if the current autoconf build system already as a TCLSH_NATIVE defined as in the nmake system), or

  2. use the minizip from the Tcl directory.

  3. go back to the use of an external zip program.

I am not in favour of 3. In addition to the bug referenced earlier, while building with BAWT I experienced failures which Paul O. diagnosed as failures with zip's built with certain options.

  1. and 2. will require additional autoconf machinery.

Opinions from Jan or others?

BTW, this is not a Tcl core issue and should probably be moved to the thread repository but not sure as to how to do that.

apnadkarnimarkdown2025-01-07 14:53:15

A proposed solution is in branch bug-cb338c130b8f in the Thread repository.

For cross-compilation, you need to either have a Tcl9 shell in your PATH or set TCLSH_NATIVE to point to it. For example, when building the core distribution with included packages.

TCLSH_NATIVE=/home/apn/tcl/trunk/bin/tclsh9.0 make

(Above, the Tcl make invokes the pkgs configure scripts)

Or if building thread directly

TCLSH_NATIVE=/home/apn/tcl/trunk/bin/tclsh9.0 ../configure --with-tcl=/data/home/apn/src/9.0.1/tcl/win/build-mingw64 --with-tclinclude=/data/home/apn/src/9.0.1/tcl/generic --host=x86_64-w64-mingw32 --enable-shared
make

Above is for cross-compilation. Otherwise build as usual.

apnadkarnimarkdown2026-05-22 11:48:30

Moved to thread

Log in (anonymous is fine) to add a comment.