Tcl Source Code

View Ticket
Login
Ticket UUID: 1163896
Title: dynamic loading error on LynxOS
Type: Bug Created on: 2005-03-15 17:12:42
Submitter: heidibr Assigned to: dgp
Subsystem: 40. Dynamic Loading Severity:
Priority: 8 Last modified: 2005-11-05 04:40:28
Status: Closed Closed by: dgp
Resolution: Accepted Closed on: 2005-11-04 21:40:28
Version: obsolete: 8.4.9
Description:
I'm trying to use dynamically linked Tcl/Tk (v.8.4.9) 
libraries on a LynxOS version 4.0 operating system. I 
can get the dynamically linked libraries to work using C 
functions. But I can't get them to work in Tcl. 
 
 There is a sample extension that we've been trying to 
use and we can get it to compile with the correct 
parameters (as per Welch book),  but when we try 
to "load" it we get:

dynamic loading is not currently available on this system
 
 When we use any type of command for dynamic 
loading we get this same message. Is there some global 
that needs to be set for operating systems that are not 
in your normal tcl.m4 checks?
User Comments:
kennykb added on 2005-03-16 00:44:54:
Logged In: YES 
user_id=99768

Looking at tcl.m4, it appears that nobody has
attempted a LynxOS port. 

The [case] command that begins around line 890 of tcl.m4
is the place where the options that control dynamic loading
get set.  What needs to be added is a branch for
LynxOS (or whatever 'uname -s' calls it) and code to
set the flags:

SHLIB_CFLAGS = Any extra compiler flags needed when building
code to go in shared libraries (-fPIC, for instance)

SHLIB_LD = The command to link a shared library (often ${CC}
-shared)

SHLIB_SUFFIX = The suffix for a shared library (.so for
instance)

SHLIB_LD_LIBS = The libraries to include when linking a
shared library.

DL_OBJS = Usually 'tclLoadDl.o' (use dlopen to load shared
libraries).  HPUX, AIX, and Windows all do it differently, I
hope we don't need to invent one for LynxOS

DL_LIBS = The library (libraries) needed in the base
executable for it to find 'dlopen'.

CC_SEARCH_FLAGS, LD_SEARCH_FLAGS = Flags needed to adjust
the runtime search path for shared libraries.  Often,
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
and
LD_SEARCH_FLAGS='-rpath,${LIB_RUNTIME_DIR}' 

If you come up with a combination that works, I'll be happy
to update the build system.  I don't have access to a LynxOS
system for testing, so I'll have to take your patch on faith. :)

kennykb added on 2005-04-14 03:52:07:
Logged In: YES 
user_id=99768

downgrading the priority of this until original
submitter (or someone else) can tell us what
the correct combination of flags should be.

nobody added on 2005-04-14 03:57:03:
Logged In: NO 

These aren't 100% thoroughly tested, but so far they are 
working for us.

In the tc.m4 file, around line 890, add in the following code:

Lynx*)
    SHLIB_CFLAGS="-fPIC"
    SHLIB_LD_LIBS='${LIBS}'
    SHLIB_SUFFIX=".so"
    CFLAGS_OPTIMIZE=-02
    SHLIB_LD="${CC} -shared "
    DL_OBJS="tclLoadDl.o"
    DL_LIBS="-mshared -ldl"
    LD_FLAGS="-Wl,--export-dynamic"
    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
    ;;

heidibr added on 2005-04-14 03:58:32:
Logged In: YES 
user_id=1239152

Hi Kennykb,

I just added that last comment and forgot to log in first!

Heidi

kennykb added on 2005-11-05 03:42:47:
Logged In: YES 
user_id=99768

Fixed in 8.5.  Jeff, can you backport into 8.4?

dgp added on 2005-11-05 04:40:28:
Logged In: YES 
user_id=80530


backported for 8.4.12