[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shared libraries build on Linux, not on Solaris 10 (gcc)
From: |
Ralf Wildenhues |
Subject: |
Re: Shared libraries build on Linux, not on Solaris 10 (gcc) |
Date: |
Fri, 17 Aug 2007 01:40:03 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
* Jason Curl wrote on Fri, Aug 17, 2007 at 12:05:44AM CEST:
>
> I've just switched over to using libtool instead of using static
> libraries. I've installed autoconf-2.61, automake-1.10 and libtool-1.5.24.
>
> The library builds fine under Linux, but won't link under Solaris Sparc
> 2.10.
[...]
> /opt/sfw/bin/gcc -shared .libs/console.o .libs/file.o .libs/output.o
> .libs/profile.o .libs/queue.o .libs/serial.o .libs/strfunc.o
> .libs/tcpip.o .libs/ipcproto.o .libs/dbgmsg.o .libs/appframework.o
> .libs/confopts.o .libs/netif.o .libs/ether_ntoa.o .libs/getline.o
> .libs/strnlen.o .libs/timersub.o .libs/timeradd.o -lnsl -lsocket
> -lcurses -lc -Wl,-soname -Wl,liblogger.so.0 -o .libs/liblogger.so.0.0.0
> ld: warning: option -o appears more than once, first setting taken
> ld: fatal: file liblogger.so.0: open failed: No such file or directory
> ld: fatal: File processing errors. No output written to
> .libs/liblogger.so.0.0.0
> collect2: ld returned 1 exit status
[...]
> So I play around a little with the options.
>
> 1. Remove -wl,-soname
That won't do good unless you also remove the argument to -soname, i.e.,
remove -Wl,liblogger.so.0. Could you please try merging this, i.e.,
instead of
-Wl,-soname -Wl,liblogger.so.0
use
-Wl,-soname,liblogger.so.0
and also add -v to see whether gcc happens to reorder arguments for ld?
Just to be sure: the .libs directory does exist, no?
In another mail:
> * Cygwin 1.5.24 with stuff uses an old version too (works, static only,
> I'll deal with that later)
Typically that's because you need to add -no-undefined.
Thanks,
Ralf