Artifacts Associated With Ticket 8c025f8f0d72af49
Ticket change [1f72e35faa] (rid 191162) by anonymous on 2021-01-19 16:26:15:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I am trying to get a 32bits tcl while compiling on a Linux Centos 6.9 64-bits system. I did: ./configure --disable-64bit --build=i686 -prefix=/home/xx/yy/zz/tcl8.6.11 make CFLAGS="-m32 -D_USE_32BIT_TIME_T=1" LDFLAGS="-m32" make install cd ../bin ln -s tclsh8.6 tclsh And then: [jpcaron@dev2-71 bin]$ ./tclsh % info patchlevel 8.6.11 % clock format [clock seconds] integer value too large to represent % I traced back the issue to the configure file. The configure determines the system support long for the 64-bits integer and set TCL_WIDE_INT_IS_LONG to 1 to be used by gcc. : checking for required early compiler flags... _LARGEFILE64_SOURCE checking for 64-bit integer type... using long checking whether byte ordering is bigendian... no : When the compile comes with -m32, it is too late already since TCL_WIDE_INT_IS_LONG is set (via -D on the gcc command line). Since -DTCL_WIDE_INT_IS_LONG=1, the header file will force the use of long. As a workaround, I set an environment variable before I run the configure: export tcl_cv_type_64bit="long long" When I try again... : checking for 64-bit integer type... (cached) long long : [jpcaron@dev2-71 bin]$ ./tclsh % info patchlevel 8.6.11 % clock format [clock seconds] Tue Jan 19 11:15:19 EST 2021 % Would be nice if you could either update the configure file to take the build type in consideration or the TCL core overwrite the -DTCL_WIDE_INT_IS_LONG=1 when gcc is using -m32 or document the cross-compile workaround to get the 32-bits program. Thanks.
- foundin initialized to: "8.6.11"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "3010a758e9cda4cc2dc3eda98e1142ce5e951b01"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "53. Configuration and Build Tools"
- title initialized to:
Run-time error on tcl 8.6.11 32 bits (from cross-compile Centos6.9 64-bits)
- type initialized to: "Bug"
Ticket change [3303e28cb7] (rid 191182) by jan.nijtmans on 2021-01-20 08:56:37:
- assignee changed to: "jan.nijtmans"
- icomment:
Proposed fix here: [ad9ee07264c24678]. Can you please test if this works for you? Something better has to wait for 8.7, since 8.6 still uses autoconf-2.59 with very limited cross-compile support. Thanks for the report!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Pending"
Ticket change [da3ccc0427] (rid 191266) by chw on 2021-01-22 05:28:30:
- icomment:
From the c.l.t. thread https://groups.google.com/g/comp.lang.tcl/c/SMkBjGBEUsY On CentOS 6 x86_64 with 32 bit development packages installed this sequence of commands produces a perfectly working 32 bit tclsh8.6: mkdir /tmp/tcl86 cd /tmp/tcl86 wget -c https://prdownloads.sourceforge.net/tcl/tcl8.6.11-src.tar.gz tar xzf tcl8.6.11-src.tar.gz cd tcl8.6.11/unix CC="cc -m32" ./configure --prefix=/tmp/tcl86 make && make install
- login: "chw"
- mimetype: "text/plain"
- icomment:
Ticket change [427f7e22f7] (rid 191289) by jan.nijtmans on 2021-01-22 15:43:55:
- closedate changed to: "2459237.15549788"
- closer changed to: "jan.nijtmans"
- icomment:
Thanks, Christian, for this info! Indeed, this isn't really a bug in Tcl, but it's true that the determination of TCL_WIDE_INT_IS_LONG is tricky. So, if a small change in tcl.h can correct (workaroud) a user's mistake, why not ....
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Closed"
Ticket change [de2a1db748] (rid 191319) by chw on 2021-01-23 00:08:14:
- closedate changed to: "2459237.50572565"
- closer changed to: "chw"
- icomment:
I'd prefer to present (if possible at all) an #error with some guidance on how to fix the root cause (passing problematic compiler flags after configure rendering configure lesser useful).
- login: "chw"
- mimetype: "text/plain"