Skip to content
Tcl Source Code History Of Ticket 6f22c7a1fc
Login

History Of Ticket 6f22c7a1fc

Artifacts Associated With Ticket 6f22c7a1fc

  1. Ticket change [ed76834c0d] (rid 216892) by apnadkarni on 2023-08-01 04:12:47:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      Trying to load the sampleextension into a tclsh built with MingW64, I get the following error:
      
      ```
      $ /d/tcl/mingw/wip/x64/bin/tclsh90.exe
      % load tcl9sample06.dll
      interpreter uses an incompatible stubs mechanism
      ```
      
      This works fine when built with either VC++ or with gcc on Ubuntu.
      
    5. foundin initialized to: "9.0"
    6. is_private initialized to: "0"
    7. login: "apnadkarni"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "apnadkarni"
    14. subsystem initialized to: "- New Builtin Commands"
    15. title initialized to:
      Cannot load sampleextension when built with mingw64
      
    16. type initialized to: "Bug"
  2. Ticket change [b6cdb8345f] (rid 216900) by jan.nijtmans on 2023-08-01 06:49:59:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      This can only happen if the compile somehow picked up a tcl.h header file from 8.6 or 8.7, installed somewhere in the MingW64 environment.
      
      Hopefully [3317aec2c5aef965|this] can prevent that happening again (this protection was already built into 8.7, now backported to 8.6).
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/plain"
  3. Ticket change [9d3082173a] (rid 216904) by apnadkarni on 2023-08-01 08:00:44:

    1. icomment:
      Right, I realized as much but the question is why this happens. Both Ubuntu and Mingw64 have a system Tcl installed but this error only shows up on Mingw64. In both cases `--with-tcl` specifies the Tcl9 installation and the config.log shows the correct 9.0 tclConfig.sh being picked up.
      
      Tracing through it appears this is caused by the following fragment from the `configure` script
      
      ```
      if test -n "$CONFIG_SITE"; then
        ac_site_files="$CONFIG_SITE"
      elif test "x$prefix" != xNONE; then
        ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
      else
        ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
      fi
      for ac_site_file in $ac_site_files
      do
        case $ac_site_file in #(
        */*) :
           ;; #(
        *) :
          ac_site_file=./$ac_site_file ;;
      esac
        if test -f "$ac_site_file" && test -r "$ac_site_file"; then
          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
      printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
          sed 's/^/| /' "$ac_site_file" >&5
          . "$ac_site_file" \
            || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
      ```
      
      On mingw, the system picks up /etc/config.site resulting in `prefix` being set to `/mingw64`. On Ubuntu, the equivalent site file does not exist resulting in `prefix` staying as `NONE`. Later on `includedir` is set to `$(prefix)/include` and **this is preferred over `$(TCL_PREFIX)/include` in the search for `tcl.h`**.
      
      It does not make sense to me as that the site path is given preference over the path specified via `--with-tcl` to `configure`. If that option is specified, all paths should target that directory. But then again, I know little about Unix conventions. It seems to me though, every extension writer is going to run into this and wonder if they have made some error in porting to Tcl 9. As I did.
      
      Using `--with-tclinclude` in `configure` fixes the problem but really should not be required once --with-tcl is specified.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  4. Ticket change [a856e5ed2f] (rid 216905) by jan.nijtmans on 2023-08-01 08:21:16:

    1. icomment:
      I'm also not familiar with this part of "autoconf"
      
      My recommendation would be to install Tcl 9.0 in the MingW64 environment first. Then, --with-tcl is not necessary any more. That's what most people (who don't need Tcl8 and Tcl9 alongside) - hopefully - will do.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"