Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d983ce2356535155030bf9223d455517c674cafb
Ticket: 217853ffffffffffffffffffffffffffffffffff
linux tk/tcl configure bug
User & Date: nobody on 2000-10-26 00:44:55
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1951 Bug
    Version: 8.0.4
    SubmitDate: '1999-04-27'
    LastModified: '1999-08-13'
    Severity: MED
    Status: Closed
    Submitter: pat
    ChangedBy: hobbs
    RelatedBugIDs: 957 1896 2195 1409
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '2000-10-25'
    FixedInVersion: 8.1
    ClosedDate: '1999-08-13'
    
    
    >tcl 8.0 configure bug under Linux [slackware, but
    >should be the same on all linux systems]
    >[same basic problem occurs under tk 8.0, see below]
    >
    >Short Description:
    >--------------------
    >Under Linux Configure with --enabled-shared *AND*
    >--prefix=/some/directory
    >other then a standard installation directory fails to build
    >a workable executable.
    >
    >------------------------------------------------------------
    >How to duplicate: [assume you are user duane]
    >
    ># make installation directories 
    >mkdir -p /home/duane/installed/bin
    >mkdir -p /home/duane/installed/man
    >mkdir -p /home/duane/installed/include
    >mkdir -p /home/duane/installed/lib
    >
    ># Unpack the source
    >cd /home/duane/source
    >gtar xfz tcl8.0p1.tar.gz     [also does it with p2 applied]
    >
    ># Configure, Build & Install
    >cd tk8.0/unix
    >./configure --prefix=/home/duane/installed --enabled-shared
    >make
    >make install
    >
    ># Go try it out
    >cd /home/duane/installed/bin
    >./tclsh8.0
    >
    ># ld.so complains, it cannot find library tcl8.0
    >
    >#NOTE: If it does work for you - then you may well have
    >#the tcl8.0 library installed in some common system
    >#search directory, then perform this test:
    >
    >cd /home/duane/installed/bin
    >ldd ./tclsh8.0
    >
    >It should show something like this:
    >
    >libtcl8.0.so => /home/duane/installed/lib/libtcl8.0.so
    >libdl.so.1 => /lib/libdl.so.1
    >libm.so.5 => /lib/libm.so.5
    >libc.so.5 => /lib/libc.so.5
    >
    >The first line is *VERY* important, (A) you have installed
    >THIS specific instance of tclsh8.0 built with (B) this specific
    >library that *YOU* just installed, it should be using *YOUR*
    >newly installed libtcl8.0.so file and *NOT* a previously
    >installed version.
    >
    >--------------------------------------------------
    >
    >Solution/Fix, description
    >
    >In unix/configure.in [and unix/configure]
    >
    >configure.in:755, and 762 are two parts of an
    >if/else/endif statement that sets the shell 
    >variables: LD_FLAGS and LD_SEARCH_FLAGS
    >they should specify the -rpath option as shown
    >below in the new 'if/else/endif' statement.
    >
    >if test "$have_dl" = yes; then
    >    SHLIB_LD="${CC} -shared"
    >    DL_OBJS="tclLoadDl.o"
    >    DL_LIBS="-ldl"
    >new->    LD_FLAGS='-rdynamic -Wl,-rpath,${LIB_RUNTIME_DIR}'
    >new->    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
    >else
    >    AC_CHECK_HEADER(dld.h, [
    >SHLIB_LD="ld -shared"
    >DL_OBJS="tclLoadDld.o"
    >DL_LIBS="-ldld"
    >new->LD_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
    >new->LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
    >fi
    >
    >configure [output of autoconfigure & configure.in]
    >these show up in lines 3699 (was: 755) and 3729 (was: 762)
    >
    >Note: In effect, it's the same options that are used in several of the
    >other systems right above. I am unsure about if both LD_FLAGS and
    >LD_SEARCH_FLAGS are required, I did both, and it seems ok to me. The
    
    >maintainers of this system probably know a bit more about this subject
    >then I do.
    >
    >Reading the docs for these two variables [configure.in line: 578/581]
    >It appears that *BOTH* should actually be used. I leave that decision
    >to the maintainers.
    >
    >--------------------------------------------------
    >
    >The same basic problem occurs in tk8.0/unix/configure.in
    >(and configure) but in a different way.
    >
    >In configure.in, line: 221 [configure, line: 1473]
    >The TK_LD_SEARCH_FLAGS variable is set via piping 
    >some text through sed, as such:
    >
    >TK_LD_SEARCH_FLAGS=`echo ${TK_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e
    >"s|,| |g"`
    >
    >Basically, what the above is doing is translating the GCC "-Wl" option
    >into plain-old-linker options.
    >
    >However - Under Linux [the system I'm using] the shared library linker
    >statement comes from TCL's configure script, and in my Linux case
    >SHLIB_LD is defined to be: "gcc -shared", which comes from the - you
    >guessed it, same if/else/endif statement in tcl8.0/unix/configure
    >which defines it to be: '${CC} -shared'
    >
    >Problem: In the Linux case, the 'sed' modifications should *NOT* happen
    >if left as is, gcc complains: about the unknown option "-rpath", in the
    >other [tcl] operating system cases, in some places the linker is 
    >actually specified as SHLIB_LD instead of using gcc. Just removing
    >the 'sed' portion will cause this to fail on other systems.
    >
    >In my limited world [Linux only here at home, SunOS 4.1.3 at work]
    >I've hand modified the shell script to *NOT* perform the sed step.
    >Unfortunatly, I can not offer a more general as I don't know enough
    >about the auto-configure process that is used here. Nor can I test
    >a solution that I propose.
    >
    >--------------------------------------------------
    >
    >FYI - This threw me for a loop in the beginning,
    >as I am porting a tool of ours from SunOS to Linx.
    >It worked fine under SunOS
    >
    >>From the Linux ld man page: [aka: ld - The GNU Linker]
    > 
    >    [... snip snip ...]
    >    The  -rpath  option  may also be used on SunOS.  By
    >    default, on SunOS, the linker will form  a  runtime
    >    search patch out of all the -L options it is given.
    >    [... snip snip ...]
    >
    >I mention this because this problem I'm describing may well
    >occur in other ELF enviorments that make use of the GNU Ld
    >Linker, *AND* use gcc as the 'SHLIB_LD' command.
    >
    >Thanks for a *GREAT* package!
    >
    >-Duane
    >[email protected] [work]
    >[email protected] [home]
    > 
    
    
    -Wl,-rpath have been included since 8.1
    -- 08/13/1999 hobbs 
    -- 08/13/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.0.4"
  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: "61. (unused)"
  10. title changed to: "linux tk/tcl configure bug"
  11. type changed to: "Bug"