Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0d2ab3a7e17ecdb8628d1a53f6b2db0ed669fbc6
Ticket: 219017ffffffffffffffffffffffffffffffffff
NetBSD ELF shared libraries are not supported
User & Date: nobody on 2000-10-26 01:09:25
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3959 Bug
    Version: 8.2.3
    SubmitDate: '1999-12-29'
    LastModified: '2000-01-03'
    Severity: CRIT
    Status: Released
    Submitter: techsupp
    ChangedBy: hobbs
    OS: BSD
    OSVersion: NetBSD/SPARC 1.4, NetBSD/i386 1.4P
    Machine: Generic AMD K6-2 PC, Sun SPARCstation IPX
    FixedDate: '2000-01-03'
    FixedInVersion: 8.3b2
    ClosedDate: '2000-10-25'
    
    
    Name: Andreas Gustafsson
    
    Comments:
    Some versions of NetBSD use the a.out object format and have a
    SunOS 4 style naming scheme for shared libraries, for example,
    "libtcl82.so.1.0".  These versions are currently supported by the
    Tcl/Tk shared library build mechanisms.
    
    However, recent versions of NetBSD use the ELF object format and omit
    the version number extension from the shared library file name, as in
    "libtcl82.so".  Attempting to build Tcl/Tk on such a system will fail.
    
    The enclosed patch fixes the problem by probing for the object format
    and choosing the appropriate version numbering scheme.  It also adds a
    definition of LD_SEARCH_FLAGS for all NetBSD systems.  This is
    necessary so that the shared libraries can be found at runtime without
    any need for editing /etc/ld.so.conf or setting LD_LIBRARY_PATH.
    
    The patch needs to be applied separately to Tcl and Tk.
    Unfortunately, the aclocal.m4 file that needs to be patched is missing
    from the Tk distribution (as was reported in a separate bug report).
    Note that "autoconf" needs to be rerun after applying the patch.
    
    The patch has been tested on NetBSD/SPARC 1.4 (a.out) and
    NetBSD/i386 1.4P (ELF).
    
    ReproducibleScript:
    configure --enable-shared
    make
    
    ObservedBehavior:
    Normal configure and make output, then:
    
    ld -Bshareable -x -o libtcl82.so.1.0 regcomp.o [...]  tclLoadDl.o
    : libtcl82.so.1.0
    c -c -g -fpic -I./../generic -I.  -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1
    -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1
    -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DNO_VALUES_H=1 -DHAVE_UNISTD_H=1
    -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1
    -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_TM_GMTOFF=1
    -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DNEED_MATHERR=1
    -DRETSIGTYPE=void -DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1
    -DHAVE_SYS_FILIO_H=1 -DTCL_SHLIB_EXT=\".so\" ./../unix/tclAppInit.c cc
    tclAppInit.o -L/usr/x/itcl/tcl8.2.3/unix -ltcl82 -lm -lc -o tclsh
    /usr/bin/ld: cannot open -ltcl82: No such file or directory
    collect2: ld returned 1 exit status
    
    DesiredBehavior:
    Successful linking.
    
    Patch:
    --- /x/tcl.clean/tcl8.2.3/unix/aclocal.m4       Tue Dec 14 19:59:18 1999
    +++ ./aclocal.m4        Thu Dec 23 22:10:45 1999
    @@ -736,8 +736,18 @@
                    DL_OBJS="tclLoadDl.o"
                    DL_LIBS=""
                    LDFLAGS=""
    -               LD_SEARCH_FLAGS=""
    -               SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
    +               LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
    +               AC_MSG_CHECKING(for ELF)
    +               AC_EGREP_CPP(yes, [
    +#ifdef __ELF__
    +               yes
    +#endif
    +               ],
    +                   AC_MSG_RESULT(yes)
    +                   SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so',
    +                   AC_MSG_RESULT(no)
    +                   SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
    +               )
                ], [
                    SHLIB_CFLAGS=""
                    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
    
    PatchFiles:
    aclocal.m4
    
    
    
    Fixed in 8.3b2 tcl.m4. 
    -- 01/03/2000 hobbs
    
  4. foundin changed to: "final: 8.2.3"
  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: "NetBSD ELF shared libraries are not supported"
  11. type changed to: "Bug"