Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5a534e0a6200703436f1ae00d7df9163e9ed2aa8
Ticket: 219383ffffffffffffffffffffffffffffffffff
linking with tclstub8X.lib has a C-runtime flavor set at com
User & Date: nobody on 2000-10-26 05:12:04
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 6073 RFE
    Version: 8.1b3
    SubmitDate: '2000-07-28'
    LastModified: '2000-07-31'
    Severity: LOW
    Status: UnAssn
    Submitter: davidg
    ChangedBy: davidg
    OS: All Windows
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    This always bugged me.  release/dynamic flavor only.  I got in the
    habit of doing the following in my extension code:
    
    #ifdef _MSC_VER
        // mark this .obj as needing tcl's Stubs library
    #   pragma comment(lib, "tclstub84.lib")
        // the requirement for msvcrt.lib from tclstub84.lib should
        // be removed.
    #   pragma comment(linker, "/nodefaultlib:msvcrt.lib")
    #endif
    
    So here's the "strip it at the source" fix so I don't have to keep
    adding the strip at link-time for my extensions:
    
    *** tclStubLib.c1999/05/25 01:00:271.4
    --- tclStubLib.c2000/07/29 06:25:51
    ***************
    *** 29,34 ****
    --- 29,60 ----
      #include "tclPort.h"
      
      /*
    +  * Remove the C-runtime #pragmas the previous headers insert.  The runtime
    +  * flavor has no importance being encoded in the .obj and should not limit
    +  * the use of the Stubs static library it's placed into.
    +  */
    + #ifdef _MSC_VER
    + #   if defined(_MT) && defined(_DLL) && defined(_DEBUG)
    + #pragma comment (linker, "-nodefaultlib:msvcrtd.lib")
    + #   endif
    + #   if defined(_MT) && defined(_DLL) && !defined(_DEBUG)
    + #pragma comment (linker, "-nodefaultlib:msvcrt.lib")
    + #   endif
    + #   if defined(_MT) && !defined(_DLL) && defined(_DEBUG)
    + #pragma comment (linker, "-nodefaultlib:libcmtd.lib")
    + #   endif
    + #   if defined(_MT) && !defined(_DLL) && !defined(_DEBUG)
    + #pragma comment (linker, "-nodefaultlib:libcmt.lib")
    + #   endif
    + #   if !defined(_MT) && !defined(_DLL) && defined(_DEBUG)
    + #pragma comment (linker, "-nodefaultlib:libcd.lib")
    + #   endif
    + #   if !defined(_MT) && !defined(_DLL) && !defined(_DEBUG)
    + #pragma comment (linker, "-nodefaultlib:libc.lib")
    + #   endif
    + #endif
    + 
    + /*
       * Ensure that Tcl_InitStubs is built as an exported symbol.  The other stub
       * functions should be built as non-exported symbols.
       */
    
    
    
    NOT!
    
    maybe compile with no /Mxx switch so it defaults to /ML (ie. libc.lib)
    then strip that with a single #pragma in the source.  It was messing
    up my MFC project using /MD(d) striping.  Too bad there isn't a way
    to not reference ANY runtime.  This really should be neutral. 
    -- 07/29/2000 davidg
    
    This is as neutral as I can get it.  noone EVER uses libc.lib, so we'll compile tclStubLib.c for that and strip it.  This way, any of the 4
    multi-threaded flavors will not colide with it.
    
    *** generic/tclStubLib.c1999/05/25 01:00:271.4
    --- generic/tclStubLib.c2000/07/31 23:54:10
    ***************
    *** 29,34 ****
    --- 29,45 ----
      #include "tclPort.h"
    
      /*
    +  * Remove the C-runtime #pragma (windows build) the compiler inserts.
    +  * The runtime flavor has no importance being encoded in the .obj and should
    +  * not limit the use of the Stubs static library it's placed into.
    +  */
    + #ifdef _MSC_VER
    + #   if !defined(_MT) && !defined(_DLL) && !defined(_DEBUG)
    + #pragma comment (linker, "-nodefaultlib:libc.lib")
    + #   endif
    + #endif
    + 
    + /*
       * Ensure that Tcl_InitStubs is built as an exported symbol.  The other stub
       * functions should be built as non-exported symbols.
       */
    
    *** win/makefile.vc2000/07/19 18:27:451.53
    --- win/makefile.vc2000/07/31 23:57:35
    ***************
    *** 313,319 ****
      <<
    
      $(TCLSTUBLIB): $(TCLSTUBOBJS)
    ! $(lib32) /out:$@ $(TCLSTUBOBJS)
    
      $(TCLPLUGINLIB): $(TCLPLUGINDLL)
    
    --- 312,318 ----
      <<
    
      $(TCLSTUBLIB): $(TCLSTUBOBJS)
    ! $(lib32) -nologo -out:$@ $(TCLSTUBOBJS)
    
      $(TCLPLUGINLIB): $(TCLPLUGINDLL)
    
    ***************
    *** 473,479 ****
      # be built as DLL objects but none of the symbols should be exported
    
      $(TMPDIR)\tclStubLib.obj : $(GENERICDIR)\tclStubLib.c
    ! $(cc32) $(TCL_CFLAGS) -DSTATIC_BUILD -Fo$@ $?
    
      # Dedependency rules
    --- 472,478 ----
      # be built as DLL objects but none of the symbols should be exported
    
      $(TMPDIR)\tclStubLib.obj : $(GENERICDIR)\tclStubLib.c
    ! $(cc32) -c -nologo -ML -DSTATIC_BUILD -Fo$@ $?
    
      # Dedependency rules
    
    -- 07/31/2000 davidg
    
    
    
  4. foundin changed to: "obsolete: 8.1b3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "75. Tutorial"
  10. title changed to:
    linking with tclstub8X.lib has a C-runtime flavor set at com
    
  11. type changed to: "Bug"