Skip to content
Tcl Source Code History Of Ticket 2d7b1e257a
Login

History Of Ticket 2d7b1e257a

Artifacts Associated With Ticket 2d7b1e257a

  1. Ticket change [403aa98ba7] (rid 187006) by bll on 2020-09-25 11:09:19:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      pkg-config --libs for Tcl returns both the main tcl library and the stub
      library.  
      
      A Tcl extension will link against one or the other, not both.
      
      bll-g7:bll$ PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig pkg-config --libs tcl
      -L/home/bll/local/lib -ltcl8.6 -ltclstub8.6
      
    5. foundin initialized to: "8.6.10"
    6. is_private initialized to: "0"
    7. login: "bll"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "bll"
    13. subsystem initialized to: "- New Builtin Commands"
    14. title initialized to: "pkg config file is incorrect"
    15. type initialized to: "Bug"
  2. Ticket change [70693c242e] (rid 187019) by bll on 2020-09-25 11:42:43:

    1. login: "bll"
    2. mimetype: "text/plain"
    3. subsystem changed to: "85. tclconfig"
    4. title changed to: "pkg-config --libs returns incorrect libraries."
  3. Ticket change [218a74fbdc] (rid 187020) by jan.nijtmans on 2020-09-25 12:05:48:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      That's intentional. I don't think tclconfig has the possibility to know whether an extension is going to be compiled with stubs or not. Therefore, supplying both works always: The extension will link to whatever library (stub or not) supplies the missing symbols.
      
      So, what's the bug?
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
    5. resolution changed to: "Invalid"
    6. status changed to: "Pending"
  4. Ticket change [dddcf7d782] (rid 187027) by bll on 2020-09-25 12:30:16:

    1. icomment:
      Hmmm...I was assuming some sort of overlap between the two libraries.
      Still it gives very different results:
      
      I don't know that the first one will work on every Linux system.
      
      # with -ltcl8.6
      bll-g7:bll$ cc    -O2   -fstack-protector-strong -fstack-protector-all   -shared       -o diskspace.so  tcldiskspace.o dimain.o didiskutil.o digetentries.o digetinfo.o diquota.o display.o getoptn.o options.o realloc.o strdup.o strstr.o trimchar.o          -L/home/bll/local/lib -ltcl8.6 -ltclstub8.6
      bll-g7:bll$ ldd diskspace.so
              linux-vdso.so.1 (0x00007ffd6a7cf000)
              libtcl8.6.so => /lib/x86_64-linux-gnu/libtcl8.6.so (0x00007f8a6cec6000)
              libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8a6cd05000)
              libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8a6cd00000)
              libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f8a6cae2000)
              libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8a6cac1000)
              libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8a6c93e000)
              /lib64/ld-linux-x86-64.so.2 (0x00007f8a6d0b5000)
      
      # without -ltcl8.6
      bll-g7:bll$ cc    -O2   -fstack-protector-strong -fstack-protector-all   -shared       -o diskspace.so  tcldiskspace.o dimain.o didiskutil.o digetentries.o digetinfo.o diquota.o display.o getoptn.o options.o realloc.o strdup.o strstr.o trimchar.o          -L/home/bll/local/lib -ltclstub8.6
      bll-g7:bll$ ldd diskspace.so
              linux-vdso.so.1 (0x00007ffc2bffe000)
              libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5c068c6000)
              /lib64/ld-linux-x86-64.so.2 (0x00007f5c06ab7000)
      bll-g7:bll$
      
    2. login: "bll"
    3. mimetype: "text/plain"
  5. Ticket change [942342e8d1] (rid 187028) by jan.nijtmans on 2020-09-25 12:44:07:

    1. icomment:
      Indeed, diskspace.so is linked with libraries it doesn't import any symbol from. Many platforms already do that by default, but apparently Linux does not.
      
      Does the --as-needed linker flag (-Wl,--as-needed) help?
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [ebb07e4f9e] (rid 187029) by bll on 2020-09-25 12:55:45:

    1. icomment:
      Yes, a little surprising.
      One would think that -Wl,--as-needed would be a default.
      
      Yes, -Wl,--as-needed works and -ltcl8.6 has no effect in that case.
      
    2. login: "bll"
    3. mimetype: "text/plain"
  7. Ticket change [a1d6e6e83b] (rid 187030) by bll on 2020-09-25 13:08:52:

    1. closedate changed to: "2459118.04783013"
    2. closer changed to: "bll"
    3. login: "bll"
    4. mimetype: "text/plain"
    5. status changed to: "Closed"
  8. Ticket change [73696d276f] (rid 187031) by jan.nijtmans on 2020-09-25 13:14:12:

    1. closedate changed to: "2459118.05153534"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Change Resulution to "Works For Me", as the report is actually not Invalid (on Linux, unnecessary libraries are linked).  But there's nothing tclconfig can do about that.
      
      Thanks for the report, anyway!
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Works For Me"