zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "Zsh hackers list" <zsh-workers@sunsite.dk>
Subject: RE: PATCH: RE: termcap moodule problem on Cygwin
Date: Wed, 31 Jan 2001 15:42:42 +0300	[thread overview]
Message-ID: <002801c08b83$4d6fe7d0$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <Tc0a8890c51710abe9d@mailsweeper01.cambridgesiliconradio.com>

>
> This turns the linking on SunOS 5.6 from dynamic to static for the two
> modules.  It was working OK before with dynamic.  However, the curses
> library which is linked in does appear to be static.  On the other hand,
> our new server with SunOS 5.8 appears to have a dynamic curses library, but
> the test still fails, although:
>   % nm /lib/libcurses.so | grep tgetent
>   [1176]  |     95876|      52|FUNC |GLOB |0    |9      |tgetent
> The libraries used are `-lsocket -ldl -lnsl -lcurses -lm -lc'.
>

Yes, test was broken, sorry. Try this patch (on top of previous).

The situation looks a bit more complicated. On my system name resolution in
shared modules happens at runtime (unless you override it) so all modules pick
up just one copy of curses library linked into main executable. Cool.

-andrej

--- aczsh.m4.old        Wed Jan 31 13:31:38 2001
+++ aczsh.m4    Wed Jan 31 15:31:46 2001
@@ -111,6 +111,38 @@


 dnl
+dnl zsh_SHARED_FUNCTION
+dnl   Check whether symbol is available in static or shared library
+dnl
+dnl   On some systems, static modifiable library symbols (such as environ)
+dnl   may appear only in statically linked libraries.  If this is the case,
+dnl   then two shared libraries that reference the same symbol, each linked
+dnl   with the static library, could be given distinct copies of the symbol.
+dnl
+dnl Usage: zsh_SHARED_FUNCTION(name)
+dnl Sets zsh_cv_shared_$1 cache variable to yes/no
+dnl
+
+AC_DEFUN(zsh_SHARED_FUNCTION,
+[zsh_SHARED_SYMBOL($1, [char *$1()], [$1])])
+
+dnl
+dnl zsh_SHARED_VARIABLE
+dnl   Check whether symbol is available in static or shared library
+dnl
+dnl   On some systems, static modifiable library symbols (such as environ)
+dnl   may appear only in statically linked libraries.  If this is the case,
+dnl   then two shared libraries that reference the same symbol, each linked
+dnl   with the static library, could be given distinct copies of the symbol.
+dnl
+dnl Usage: zsh_SHARED_VARIABLE(name,type)
+dnl Sets zsh_cv_shared_$1 cache variable to yes/no
+dnl
+
+AC_DEFUN(zsh_SHARED_VARIABLE,
+[zsh_SHARED_SYMBOL($1, [ $2 $1], [&$1])])
+
+dnl
 dnl zsh_SHARED_SYMBOL
 dnl   Check whether symbol is available in static or shared library
 dnl
@@ -119,7 +151,7 @@
 dnl   then two shared libraries that reference the same symbol, each linked
 dnl   with the static library, could be given distinct copies of the symbol.
 dnl
-dnl Usage: zsh_SHARED_SYMBOL(ident,type)
+dnl Usage: zsh_SHARED_SYMBOL(name,declaration)
 dnl Sets zsh_cv_shared_$1 cache variable to yes/no
 dnl

@@ -132,9 +164,12 @@
     us=
 fi
 echo '
-       extern $2 **$1;
-       void *symlist1[[]] = {
-               (void *)&$1,
+#ifdef __CYGWIN__
+       __attribute__((__dllimport__))
+#endif
+       extern $2;
+       void *symlist[[]] = {
+               (void *)$3,
                (void *)0
        };
 ' > conftest1.c
@@ -179,8 +214,8 @@
     if(!handle1) exit(1);
     handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
     if(!handle2) exit(1);
-    symlist1 = (void **) dlsym(handle1, "${us}symlist1");
-    symlist2 = (void **) dlsym(handle2, "${us}symlist2");
+    symlist1 = (void **) dlsym(handle1, "${us}symlist");
+    symlist2 = (void **) dlsym(handle2, "${us}symlist");
     if(!symlist1 || !symlist2) exit(1);
     for(; *symlist1; symlist1++, symlist2++)
        if(*symlist1 != *symlist2)
bor@itsrm2% gdiff -u configure.in.old configure.in
--- configure.in.old    Wed Jan 31 14:45:05 2001
+++ configure.in        Wed Jan 31 15:32:05 2001
@@ -1619,17 +1619,16 @@
 fi

 if test "x$dynamic" = xyes; then
-  zsh_SHARED_SYMBOL([environ], [char **])
+  zsh_SHARED_VARIABLE([environ], [char **])
   test "$zsh_cv_shared_environ" = yes || dynamic=no
 dnl  test "$zsh_cv_sys_dynamic_broken" = no || dynamic=no
   if test "$ac_cv_func_tgetent" = yes; then
-    zsh_SHARED_SYMBOL([tgetent], [(void (*)())])
+    zsh_SHARED_FUNCTION([tgetent])
   fi
   if test "$ac_cv_func_tigetstr" = yes; then
-    zsh_SHARED_SYMBOL([tigetstr], [(void (*)())])
+    zsh_SHARED_FUNCTION([tigetstr])
   fi
 fi
-    zsh_SHARED_SYMBOL([socket], [(void (*)())])

 if test "x$dynamic" = xyes; then
   zsh_SYS_DYNAMIC_CLASH


  reply	other threads:[~2001-01-31 12:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-29 14:55 Andrej Borsenkow
2001-01-29 15:10 ` Peter Stephenson
2001-01-30  8:25   ` Andrej Borsenkow
2001-01-30 10:34     ` Peter Stephenson
2001-01-31  8:50       ` Somebody with gcc knowledge here? (Was: termcap moodule problem on Cygwin ) Andrej Borsenkow
2001-01-31 10:37       ` PATCH: RE: termcap moodule problem on Cygwin Andrej Borsenkow
2001-01-31 11:30         ` Peter Stephenson
2001-01-31 12:42           ` Andrej Borsenkow [this message]
2001-01-31 13:49             ` Peter Stephenson
2001-02-05 15:31               ` Andrej Borsenkow
2001-02-13 14:36                 ` Andrej Borsenkow
2001-01-29 16:48 ` Zefram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002801c08b83$4d6fe7d0$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).