[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static compilation of "ns" and "tclcl-1.0b4"



I had the same problem in SCO OpenServer 5.0.2.
See the discussion on this matter in news comp.unix.sco.programmer
The messege is Dynamic load routines and TCL.

>From my experience:
libtcl7.6.a as well as libtcl7.6.so (the same is true for 8.0) have
references to _dlopen and other _dl* routines. This routines are located
in libc.so not in libc.a (on SCO) , and in libdl.so (there is no libdl.a) on
SUN.
When you use libtcl7.6.a and libc.a you will get that linker error
(unresolved references).
But if you use libtcl7.6.a with libc.so [libdl.so (SUN)], there will be no
such message.
The same is true about libtcl7.6.so.
You may ask how to do this.
libtcl7.6.a is static COFF library.
libc.so (libdl.so) is dymanic ELF library (which is one large object file).
Read man on ld for your system.
On SCO three is a way to  make it.
I use -L/usr/local/lib -ltcl7.6 -belf   for final linking. It waorks even if
thre is no
libtcl7.6.so library in /usr/local/lib.
For SUN I think you need to use -L/usr/local/lib -l tcl7.6 -ld -belf
or /usr/local/lib/libtcl7.6.a -ld -belf if the above will not work (I may).
The other way is to build tcl7.6 (8.0) without dynamic load using
--disable-load switch for configure.






-----Original Message-----
From: Deniz Gurkan <[email protected]>
To: [email protected] <[email protected]>
Date: 27 November 1997 �. 7:20 AM
Subject: Static compilation of "ns" and "tclcl-1.0b4"


>
>Dear ns-users,
>
>I haven't set anything about the "--enable-devel" option of configure
>files for neither "ns-2.1b1" nor "tclcl-1.0b4". But "tclcl-1.0b4" has
>default as non-static compilation and although it finds the "-ldl" in the
>library, it doesn't use it. On the other hand, "ns-2.1b1" has its default
>"--enable-devel" set to V_STATIC="-static", at least I don't give any
>option on that item, and it takes "-static" to V_STATIC env. variable..
>With that option (and without it) my "configure" for "ns-2.1b1" cannot
>find "-ldl" although it was found by both "tcl7.6" and "tclcl-1.0b4". But
>if V_STATIC="-static" "make"  tries to use dynamic loading library, at the
>creation of "ns*", it reports error that it couldn't find "dlopen", dlsym"
>and "dlerror". In the case that V_STATIC="", the linking error doesn't
>exist, as expectedi(?); but this case "ns*" will be compiled without
>"-ldl"  which doesn't seem to match (in my opinion) the constraint imposed
>on the 3305-3309 lines of "/ns-2.1b1/configure":
>
>>> #
>>> # tcl7.x needs a dynamic loading library (unless built with the
>>> # -disable-load flag).  Try to find the appropriate one.
>
>I couldn't decide on the option of "-static" and "-ldl" usage for the
>"tclcl-1.0b4" and "ns-2.1b1". Furthermore, I couldn't find the bug (if
>exists) in the "/ns-2.1b1/configure" file that prevents it from finding
>"libdl.so.1.0" (under /usr/lib of a sparc-sunOS4.1.3) :
>>> "checking for main in -ldl... (cached) no"
>
>I will be grateful if you can help me.. I will be looking forward to
>receiving a reply from you.
>
>Sincerely,
>
>Deniz GURKAN
>Research Assistant
> Bilkent University
> Electrical and Electronics Eng. Dept.
> 06533 Bilkent ANKARA / TURKEY
>e-mail: [email protected]  URL: http://www.ee.bilkent.edu.tr/~deniz/
>