bug-libtool
[Top][All Lists]
Advanced

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

still many problems under OpenSolaris


From: Vadim Zeitlin
Subject: still many problems under OpenSolaris
Date: Thu, 25 Feb 2010 18:55:18 +0100

 Hello,

 I've reported a problem due to as_echo being undefined under OpenSolaris
some time ago (http://thread.gmane.org/gmane.comp.gnu.libtool.bugs/7113/).
This was fixed by Ralf (thanks again) but apparently this wasn't the end of
the story because now I have a similar problem due to "echo" being
undefined.

 First let me describe my setup: I'm under OpenSolaris on i386 and I
installed now the latest versions of m4, automake and autoconf from source:

        % uname -a
        SunOS whatever 5.11 snv_111b i86pc i386 i86pc
        % m4 --version|head -n1
        m4 (GNU M4) 1.4.14
        % autoconf --version|head -n1
        autoconf (GNU Autoconf) 2.65
        % automake --version|head -n1
        automake (GNU automake) 1.11

I also use the latest libtool from git (updated 15 minutes ago) and I ran
bootstrap in libtool directory (apparently) successfully. After this I
configured libtool in the usual way except that I used "CC=suncc CXX=sunCC"
as I need to compile my code using Sun C++ compiler and not g++. I don't
actually know if CC used when building libtool itself has any relevance
here and would like to know how can I configure libtool to use Sun CC if
this is not enough.

 
 Armed with all this, I'm trying to build a 3rd party library called rlog
(http://www.arg0.net/rlog). It's not the simplest example but it doesn't
seem to do anything special. E.g. it just has the usual

        AC_LANG_CPLUSPLUS
        AC_PROG_CXX
        AC_PROG_LIBTOOL
        
in it. And its bootstrap and configure seem to run fine.

 Here is what I get when I try to build it though:

% gmake
source='/export/home/zeitlin/src/3rdparty/rlog/rlog/rlog.cpp' object='rlog.lo' 
libtool=yes \
        DEPDIR=.deps depmode=none /bin/sh 
/export/home/zeitlin/src/3rdparty/rlog/config/depcomp \
        /bin/sh ../libtool --tag=CXX   --mode=compile sunCC -DHAVE_CONFIG_H -I. 
-I/export/home/zeitlin/src/3rdparty/rlog/rlog -I..   
-I/export/home/zeitlin/src/3rdparty/rlog   -DRLOG_COMPONENT="rlog" 
-DUSE_VALGRIND=0 -g -D_REENTRANT   -c -o rlog.lo 
/export/home/zeitlin/src/3rdparty/rlog/rlog/rlog.cpp
../libtool: line 812: X--tag=CXX: not found
../libtool[845]: libtool: ignoring unknown tag : not found [No such file or 
directory]
../libtool: line 812: X--mode=compile: not found
../libtool[978]: *** Warning: inferring the mode of operation is deprecated.: 
not found [No such file or directory]
../libtool[979]: *** Future versions of Libtool will require --mode=MODE be 
specified.: not found [No such file or directory]
../libtool[1009]: libtool: warning: cannot infer operation mode from `sunCC': 
not found [No such file or directory]
../libtool[7044]: libtool: you must specify a MODE: not found [No such file or 
directory]
../libtool[7045]: Try `libtool --help' for more information.: not found [No 
such file or directory]
gmake: *** [rlog.lo] Error 1

The line 812 in libtool is

  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;

and from the error above it looks like "echo" is not defined. And, indeed,
grepping for 'echo=' doesn't find anything except in the part of libtool
which is used to generate libtool where it does seem to define echo as
qecho -- but somehow this line is missing from the libtool created by
configure. I really don't understand what is going on here but only "ECHO"
is defined (as "print -r --") in libtool in my build directory and not
"echo". Does anyone see why would this happen?


 Anyhow, I've just defined echo manually in the same way. Now I can build
objects:

% gmake rlog.lo
source='/export/home/zeitlin/src/3rdparty/rlog/rlog/rlog.cpp' object='rlog.lo' 
libtool=yes \
        DEPDIR=.deps depmode=none /bin/sh 
/export/home/zeitlin/src/3rdparty/rlog/config/depcomp \
        /bin/sh ../libtool --tag=CXX   --mode=compile sunCC -DHAVE_CONFIG_H -I. 
-I/export/home/zeitlin/src/3rdparty/rlog/rlog -I..   
-I/export/home/zeitlin/src/3rdparty/rlog   -DRLOG_COMPONENT="rlog" 
-DUSE_VALGRIND=0 -g -D_REENTRANT   -c -o rlog.lo 
/export/home/zeitlin/src/3rdparty/rlog/rlog/rlog.cpp
mkdir .libs
 sunCC -DHAVE_CONFIG_H -I. -I/export/home/zeitlin/src/3rdparty/rlog/rlog -I.. 
-I/export/home/zeitlin/src/3rdparty/rlog -DRLOG_COMPONENT=rlog -DUSE_VALGRIND=0 
-g -D_REENTRANT -c /export/home/zeitlin/src/3rdparty/rlog/rlog/rlog.cpp  -DPIC 
-o .libs/rlog.o


However notice that the command line is wrong, it's building a shared
library and -pic must be specified when using suncc, just -DPIC is not
enough. Strangely enough, pic_flag definition in the global section of
libtool does include -KPIC (which is obsolete for SPARC and the same as
-Kpic which is itself identical to -pic under x86) but pic_flag defined in
CXX section does not include it. Again, I have no idea why does this happen
so I just added -pic manually to this pic_flag definition.


 But this is still not the end of my woes... After compiling all the object
files it tries to link them into a shared library:

% gmake
...
/bin/sh ../libtool --tag=CXX   --mode=link sunCC -DRLOG_COMPONENT="rlog" 
-DUSE_VALGRIND=0 -g -D_REENTRANT   -version-info 3:4:2 -lpthread  -o librlog.la 
-rpath /export/home/zeitlin/SunOS_i86pc/lib rlog.lo rloginit.lo rloglocation.lo 
Error.lo RLogChannel.lo RLogNode.lo RLogPublisher.lo StdioNode.lo SyslogNode.lo
(cd .libs && rm -f librlog.so.1 && ln -s librlog.so.1.2.4 librlog.so.1)
(cd .libs && rm -f librlog.so && ln -s librlog.so.1.2.4 librlog.so)
creating librlog.la
(cd .libs && rm -f librlog.la && ln -s ../librlog.la librlog.la)

Unfortunately this doesn't create any library:

% ls -l .libs/lib*
lrwxrwxrwx   1 zeitlin  staff         13 Feb 25 18:42 .libs/librlog.la -> 
../librlog.la
-rw-r--r--   1 zeitlin  staff        831 Feb 25 18:42 .libs/librlog.lai
lrwxrwxrwx   1 zeitlin  staff         16 Feb 25 18:42 .libs/librlog.so -> 
librlog.so.1.2.4
lrwxrwxrwx   1 zeitlin  staff         16 Feb 25 18:42 .libs/librlog.so.1 -> 
librlog.so.1.2.4

I.e. notice that all symlinks are dangling and librlog.so.1.2.4 doesn't
exist. I guess it expects the linker to create this file but the linker
actually creates librlog.so.1 (which is the correct thing to do under
Solaris AFAIU, as it doesn't use sonames in the same way as Linux). But I
am not even sure as I can't see the exact linker command it uses (I thought
there was some way to make it show it but couldn't find it and --debug just
outputs too much to make any sense of it).

 So finally I just linked the library manually using

% sunCC -G -z text -h librlog.so -g -o .libs/librlog.so.1.2.4 .libs/*.o

and this did create a working library but this is hardly an acceptable
solution...


 To summarize, libtool is still completely broken out of the box for me
under OpenSolaris. I tried hard to not do anything non-standard this time
so I hope it's not due to something that I did again. Unfortunately I just
don't understand libtool enough to understand what's going on so all I can
do is to report these problems and hope that somebody else can explain
where do they come from and hopefully fix them.

 Thanks in advance,
VZ

Attachment: pgpfKBcsomn_E.pgp
Description: PGP signature


reply via email to

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