This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

collect2/ld/g++ problem on alphaev5-dec-osf4.0d


Platform: DEC AlphaStation 500/333
OS:       Digital UNIX 4.0D with BL11 jumbo patchkit
EGCS version: gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)

Background:
I was trying to build mimelib in kdesupport.  It uses libtool to handle
library stuff.  libtool breaks when I try to link libmimelib.so.

Problem:
While trying to build a shared library with egcs, I found that collect2 is
passing bad arguments to ld.

Here's the original command line:  (I deleted a few .o files for brevity)

g++ -v -shared -Wl,-v -Wl,-expect_unresolved -Wl,\* -Wl,-soname -Wl,"libmime
lib.so" -Wl,-set_version -Wl,1.0.0:1.0 -o .libs/libmimelib.so.1.0.0
protocol.o address.o -lc

which becomes:

/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0d/egcs-2.91.66/collect2 -G
8 -O1 -shared -o
.libs/libmimelib.so.1.0.0 -L/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0d/egcs
-2.91.66 -L/usr/local/alphaev5-dec-osf4.0d/lib -L/usr/lib/cmplrs/cc -L/usr/l
ocal/lib -v -expect_unresolved * -soname libmimelib.so -set_version
1.0.0:1.0 protocol.o address.o -lstdc++ -lm -lc -lgcc -lc -lgcc

which becomes:

/bin/ld -G 8 -O1 -shared -o
.libs/libmimelib.so.1.0.0 -L/usr/local/lib/gcc-lib/alphaev5-dec-osf4.0d/egcs
-2.91.66 -L/usr/local/alphaev5-dec-osf4.0d/lib -L/usr/lib/cmplrs/cc -L/usr/l
ocal/lib -v -expect_unresolved * -soname /tmp/ccmis9dS.o
libmimelib.so -set_version 1.0.0:1.0 protocol.o
address.o -lstdc++ -lm -lc -lgcc -lc -lgcc -init
_GLOBAL__FI_libmimelib_so -fini _GLOBAL__FD_libmimelib_so

Whoa!  Why was "/tmp/ccmis9ds.o" inserted between the linker options
"-soname" and "libmimelib.so"?  This causes ld to break, obviously.

Is there something wrong with the way the original linker arguments are
passed?  Is this a bug in collect2?  Is this the right mailing list for
collect2 problems?  (I got collect2 with egcs-1.1.2, so I figured I'd try
here first.)

If anyone wants to see the full output of collect2 -v, I'll be happy to mail
it privately; it's far too large for this list.  I excerpted the interesting
parts above.

Thanks for any help.

Pat McCormick
pmccormi@mit.edu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]