Skip to content
Tcl Source Code History Of Ticket 540229ffff
Login

History Of Ticket 540229ffff

Artifacts Associated With Ticket 540229ffff

  1. Ticket change [5510554643] (rid 94063) by dgp on 2002-04-06 15:52:06:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      >From "Krzysztof Kozminski x8291"
      <[email protected]>
      
      Here it is (for Tcl 8.0, this is as far as we got here
      in upgrading). It
      is a fairly trivial affair - almost embarassing in its
      simplicity -
      perhaps more "food for thought" than a patch-and-release...
      
      As mentioned, this works only under Solaris - perhaps
      similar things
      should be done for Windows/Mac/other Unix flavors. 
      Basically, if no 
      names
      for *_Init procedures are specified, the loader does
      not try to look 
      them
      up. In tclLoad, the extra files are loaded before the
      one that should
      contain the *_Init procedures.
      
      One feature that I did not mention previously is a
      global variable
      tcl_trace_load; if defined, it should contain the name
      of a procedure 
      that
      takes 2 arguments. The first argument is the pathname
      of the *.so being
      loaded, and the second is either 1 (if the *.so
      contains an 
      initialization
      procedure) or 0 (if the *.so is one of the additional
      arguments).  I use
      this to obtain feedback about what got loaded.
      
      KK
      ===================================================================
      RCS file: unix/RCS/tclLoadDl.c,v
      retrieving revision 1.1
      diff --ignore-matching-lines=$Id:
      --ignore-matching-lines=$Source: 
      --ignore-ma
      tching-lines=$Header: --ignore-matching-lines=$Date: 
      --ignore-matching-lines=$
      Author: --ignore-matching-lines=$Revision: -c -r1.1
      unix/tclLoadDl.c
      *** unix/tclLoadDl.c1999/09/09 03:21:551.1
      --- unix/tclLoadDl.c2000/01/05 18:40:52
      ***************
      *** 69,74 ****
      --- 69,75 ----
        {
            VOID *handle;
            Tcl_DString newName;
      +     char *fbkCall;
      
            handle = dlopen(fileName, RTLD_NOW | RTLD_GLOBAL);
            if (handle == NULL) {
      ***************
      *** 76,81 ****
      --- 77,96 ----
        "\": ", dlerror(), (char *) NULL);
        return TCL_ERROR;
            }
      +
      +     fbkCall = Tcl_GetVar(interp, "tcl_trace_load",
      TCL_GLOBAL_ONLY);
      +     if ((fbkCall != NULL) && (*fbkCall != 0)) {
      + int res = Tcl_VarEval(interp, fbkCall, " ", fileName,
      + sym1 ? " 1" : " 0", NULL);
      + if (res != TCL_OK)
      +     return res;
      +     }
      +     /*
      +      * A package comprised of multiple dynamically
      loaded libraries is
      +      * signified by passing a null pointer as the
      value of sym1.
      +      */
      +     if (sym1 == 0)
      + return TCL_OK;
      
            /*
             * Some platforms still add an underscore to the
      beginning of 
      symbol
      ===================================================================
      RCS file: generic/RCS/tclLoad.c,v
      retrieving revision 1.1
      diff --ignore-matching-lines=$Id:
      --ignore-matching-lines=$Source: 
      --ignore-ma
      tching-lines=$Header: --ignore-matching-lines=$Date: 
      --ignore-matching-lines=$
      Author: --ignore-matching-lines=$Revision: -c -r1.1
      generic/tclLoad.c
      *** generic/tclLoad.c1999/09/09 15:37:501.1
      --- generic/tclLoad.c2000/01/05 18:46:29
      ***************
      *** 108,118 ****
            int code, c, gotPkgName, namesMatch, filesMatch;
            char *p, *fullFileName, *p1, *p2;
      
      !     if ((argc < 2) || (argc > 4)) {
        Tcl_AppendResult(interp, "wrong # args: should be \"",
      argv[0],
      ! " fileName ?packageName? ?interp?\"", (char *) NULL);
        return TCL_ERROR;
            }
            fullFileName = Tcl_TranslateFileName(interp,
      argv[1], &fileName);
            if (fullFileName == NULL) {
        return TCL_ERROR;
      --- 108,133 ----
            int code, c, gotPkgName, namesMatch, filesMatch;
            char *p, *fullFileName, *p1, *p2;
      
      !     if (argc < 2) {
        Tcl_AppendResult(interp, "wrong # args: should be \"",
      argv[0],
      ! " fileName ?packageName? ?interp? ?fileName ...?\"",
      ! (char *) NULL);
        return TCL_ERROR;
            }
      +     /*
      +      * Preload libraries that must be present before
      loading the one
      +      * named in argv[1]
      +      */
      +     for (c = 4; c < argc;  c++) {
      + fullFileName = Tcl_TranslateFileName(interp, argv[c], 
      &fileName);
      + if (fullFileName != NULL) {
      +     code = TclLoadFile(interp, fullFileName, NULL,
      NULL, NULL, 
      NULL);
      + } else
      +     code = TCL_ERROR;
      + Tcl_DStringFree(&fileName);
      + if (code == TCL_ERROR)
      +     return code;
      +     }
            fullFileName = Tcl_TranslateFileName(interp,
      argv[1], &fileName);
            if (fullFileName == NULL) {
        return TCL_ERROR;
      ***************
      *** 138,144 ****
             */
      
            target = interp;
      !     if (argc == 4) {
        target = Tcl_GetSlave(interp, argv[3]);
        if (target == NULL) {
            Tcl_AppendResult(interp, "couldn't find slave
      interpreter 
      named \"",
      --- 153,159 ----
             */
      
            target = interp;
      !     if (argc >= 4) {
        target = Tcl_GetSlave(interp, argv[3]);
        if (target == NULL) {
            Tcl_AppendResult(interp, "couldn't find slave
      interpreter 
      named \"",
      
      
      
      
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "40. Dynamic Loading"
    10. title initialized to: "extend [load] for pre-load libraries"
    11. type initialized to: "RFE"