[Top][All Lists]

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

[Bug-gnulib] vasnprintf.m4 patch for Solaris 2.5.1 wcslen problem

From: Paul Eggert
Subject: [Bug-gnulib] vasnprintf.m4 patch for Solaris 2.5.1 wcslen problem
Date: 09 Aug 2003 00:54:53 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

In <http://mail.gnu.org/archive/html/bug-coreutils/2003-08/msg00021.html>
Vin Shelton <address@hidden> writes:

> 1. On SunOS-5.5.1, configuring with --disable-nls, I cannot link 'who':
> gcc  -g -O2   -o who  who.o ../lib/libfetish.a  ../lib/libfetish.a -lgen 
> -lnsl 
> Undefined                       first referenced
>  symbol                             in file
> wcslen                              ../lib/libfetish.a(vasnprintf.o)  (symbol 
> belongs to implicit dependency /usr/lib/libw.so.1)

This problem arises because Solaris 2.5.1 puts the following functions
into /usr/lib/libw.so.1, so you need to link with -lw if you use any
of these functions:

   fgetwc fputwc getwc isenglish isideogram isnumber isphonogram isspecial
   iswalnum iswalpha iswcntrl iswctype iswdigit iswgraph iswlower iswprint
   iswpunct iswspace iswupper iswxdigit mbftowc putwc scrwidth towlower
   towupper ungetwc watoll wcscat wcschr wcscmp wcscoll wcscpy wcscspn
   wcslen wcsncat wcsncmp wcsncpy wcspbrk wcsrchr wcstod wcstok wcstol
   wcstoul wcswcs wcswidth wcsxfrm wctype wcwidth wscasecmp wscat wschr
   wscmp wscoll wscpy wscspn wslen wsncasecmp wsncat wsncmp wsncpy wspbrk
   wsrchr wstod wstok wstol wstoll wsxfrm
At the end of this message is a patch for that, which I have tested on
my Solaris 2.5.1 host.  The patch applies to both coreutils and
gnulib, so I'll CC: this to bug-gnulib.

The patch below is suboptimal, as it links every executable with -lw,
even though only 'who' needs the -lw option, since only 'who' needs
wcslen.  However, Sun stopped generating patches for Solaris 2.5.1 on
2002-09-22, so it's a dying OS version, and I don't think we need to
optimize coreutils for Solaris 2.5.1 so long as it builds and runs
correctly.  /usr/lib/libw.so.1 is part of the SUNWcsu package, so it
is a core library available on any Solaris 2.5.1 host, and we
shouldn't have to worry that it might be on the build host but not on
the run host.

I notice that other gnulib modules use the above functions.  There is
a FIXME about this in regex.m4, for example.  Quite possibly coreutils
is not using some wide-char functions that it could use on Solaris
2.5.1.  However, these problems don't prevent the coreutils build from
succeeding, so I didn't investigate this further.

2003-08-08  Paul Eggert  <address@hidden>

        * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF):
        Solaris 2.5.1 needs -lw to get the wcslen function.

--- vasnprintf.m4.~1.1.~        Thu Jul 10 04:23:31 2003
+++ vasnprintf.m4       Fri Aug  8 23:37:20 2003
@@ -51,6 +51,9 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF],
+  # Solaris 2.5.1 needs -lw to get the wcslen function.
+  AC_SEARCH_LIBS(wcslen, [w])
 # Prerequisites of lib/asnprintf.c.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]