Without wanting to repeat myself, I posted libtool-patches in January
about SCO 5 and -lc on shared libraries, but the problem still exists
in 1.3d and the current cvs.

Something like below (re-diffed for current libtool.m4) will be much
wanted, since it avoids seg faults if a shared library uses ctype.h
but the mainline program doesn't.  I don't have an actual explanation
for what goes wrong, but the advice from SCO is apparently "don't do
that".

--- libtool.m4.old	Fri Jan  5 07:33:48 2001
+++ libtool.m4	Fri Jan  5 07:35:32 2001
@@ -2086,6 +2086,17 @@
 ## FIXME: this should be a separate macro
 ##
 if test "$enable_shared" = yes && test "$GCC" = yes; then
+  case $host_os in
+  sco3.2v5*)
+    # On SCO 5, an explicit -lc is not wanted when making shared
+    # libraries.  It's unnecessary, and giving it makes strange things
+    # happen, like profiler mcount calls segfaulting and ctype.h
+    # macros not working (if used in a library but not the mainline).
+    # FIXME: Maybe the below code could detect -lc is unnecessary, but
+    # SCO $archive_cmds uses $LD, so it's not reached.
+    lt_cv_archive_cmds_need_lc=no
+    ;;
+  esac
   case "$archive_cmds" in
   *'~'*)
     # FIXME: we may have to deal with multi-command sequences.

Reply via email to