bug-libtool
[Top][All Lists]
Advanced

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

1.4.x: library creation fails with SGI's CC (mips)


From: Sir Oliver
Subject: 1.4.x: library creation fails with SGI's CC (mips)
Date: Fri, 14 Dec 2001 10:54:46 -0500

NOTE: eventhough the symptom is visible when creating c++ libraries involving templates, the problem is unrelated to c++ templates. It is due to a libtool test that erroneously succeeds on SGI. Many thanks to Steve Crocket from SGI who figured out the problem with lt_cv_compiler_o_lo.
 

Symptom:

When a shared library is built that contains code that uses c++ template classes, the template classes are not instantiated.  This is manifested in the absence of a prelink stage to the library creation.
 

Problem:

Libtool 1.4.x makes ./configure test the compiler during configuration to see if compiler supports the direct creation of .lo files (instead of .o files), like gcc/g++ seem to do.  The macro (in aclocal.m4) does this by getting the compiler to create a .lo file instead of a .o file and assumes that if compiler doesn't support .lo files, it will complain.  Unfortunately, MipsPro CC on SGI doesn't care about the extension, ie "CC -c -o bad.garblygoop test.cc" will succeed eventhough the ".garblygoop" extension is meaningless.  Hence, "CC -c -otest.lo test.cc" succeeds as well, and ./configure thinks that .lo's can be created by CC.  The variable lt_cv_compiler_o_lo is wrongly set to yes.

The line in aclocal.m4 for libtool 1.4.2 where macro starts is

AC_MSG_CHECKING([if $compiler supports -c -o file.lo])


(Note that in an alpha version of libtool that we have here, this test was not performed, which is why we never had problems until we upgraded to 1.4)
 

Temporary solution:

Instead of "./configure ...", do "/bin/sh lt_cv_compiler_c_lo=no configure ...", which by-passes the test and just assumes it is no possible.
 

Possible real solution (not implemented):

Make the macro use a different criterion to see if a compiler supports the creation of .lo files.  For instance, test the content of the .lo created for some special text that it should contain. Alternately, when c++ compiler is being used, ie the linker is the compiler rather than ld, the test should not be done and assumed to be false.

Oliver


reply via email to

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