[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: Jason Curl
Subject: Re: Shared libraries build on Linux, not on Solaris 10 (gcc)
Date: Fri, 17 Aug 2007 02:23:26 +0200
User-agent: Thunderbird (Windows/20070728)

Ralf Wildenhues wrote:
* 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, -o .libs/
ld: warning: option -o appears more than once, first setting taken
ld: fatal: file open failed: No such file or directory
ld: fatal: File processing errors. No output written to .libs/
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,  Could you please try merging this, i.e.,
instead of -Wl,-soname -Wl,


and also add -v to see whether gcc happens to reorder arguments for ld?

Just to be sure: the .libs directory does exist, no?
The .libs directory exists. Using the recommendation -Wl,-soname, didn't work either. but...

I'm stumped. I just recompiled, and it worked. The libtool command was the same, but the command generated by libtool changed (I added something to check for 'ld' and 'ar').

/opt/sfw/bin/gcc -shared -Wl,-h -Wl, -o .libs/ .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

I've got a very little idea how libtool works. The ordering of the -Wl,xx changed and so did a new option appear. The only thing I can think of is I did a configure and build with 'cc' and somehow recompiled with 'gcc' (looks plausible from my last post), or even configured on linux and built on solaris (I'm using NFS), which if it were the case, all bets are off of course.

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.
Well, I guess I need to add support specifically for Cygwin with AC_LIBTOOL_WIN32_DLL first.

reply via email to

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