Menu

#105 configure doesn't pass LDFLAGS to libtool for 64-bit solaris

open
nobody
5
2004-01-24
2004-01-24
Anonymous
No

In order to build for 64-bit solaris, I use the following
configure line:

./configure CC=cc CXX=CC LD=CC CXXFLAGS="-pta
-instances=static -mt -xtarget=generic64 -g
-features=no%transitions -xildoff" LDFLAGS="-
xtarget=generic64 -xildoff"

During the build, however, libtool does not pass these flags
to the linker (see below). It appears that $compiler_flags is
not being set when the libtool script is generated. My
workaround is to insert LDFLAGS into the relevant
$archive_cmds in the libtool script manually.

Relevant variables/files are:

$CXXLINK in src/cppunit/Makefile
$compiler_flags in libtool
$archive_cmds in libtool (grep for -nolib)

Thanks!

--
George Coulouris
(my first name at my last name dot org)

CC -G -nolib -hlibcppunit-1.9.so.11 -o .libs/libcppunit
-1.9.so.11.0.0 .libs/AdditionalMessage.o .libs/Asserter.o
.libs/BeOsDynamicLibraryManager.o .libs/
BriefTestProgressListener.o .libs/CompilerOutputter.o .libs/
DefaultProtector.o .libs/DynamicLibraryManager.o .libs/
DynamicLibraryManagerException.o .libs/Exception.o .libs/
Message.o .libs/RepeatedTest.o .libs/PlugInManager.o .libs/
PlugInParameters.o .libs/Protector.o .libs/ProtectorChain.o
.libs/SourceLine.o .libs/StringTools.o .libs/
SynchronizedObject.o .libs/Test.o .libs/TestAssert.o .libs/
TestCase.o .libs/TestCaseDecorator.o .libs/TestComposite.o
.libs/TestDecorator.o .libs/TestFactoryRegistry.o .libs/
TestFailure.o .libs/TestLeaf.o .libs/TestNamer.o .libs/
TestPath.o .libs/TestPlugInDefaultImpl.o .libs/TestResult.o
.libs/TestResultCollector.o .libs/TestRunner.o .libs/
TestSetUp.o .libs/TestSuccessListener.o .libs/TestSuite.o
.libs/TestSuiteBuilderContext.o .libs/TextOutputter.o .libs/
TextTestProgressListener.o .libs/TextTestResult.o .libs/
TextTestRunner.o .libs/TypeInfoHelper.o .libs/
UnixDynamicLibraryManager.o .libs/
ShlDynamicLibraryManager.o .libs/XmlDocument.o .libs/
XmlElement.o .libs/XmlOutputter.o .libs/XmlOutputterHook.o
.libs/Win32DynamicLibraryManager.o
ld: fatal: file .libs/AdditionalMessage.o: wrong ELF class:
ELFCLASS64
ld: fatal: File processing errors. No output written to .libs/
libcppunit-1.9.so.11.0.0

(fails because the linker is assuming 32-bit objects [since
LDFLAGS was not passed], but the objects were compiled 64-
bit)

Discussion

  • Srinath Munireddy

    Logged In: YES
    user_id=569543

    Hi,

    I tried to compile on HP UX with 64 bit flag ,libtool was
    not created for 64 bit version , so i manulayy edited
    libtool and added the options +Da2.0W and it went well.

    BR
    Srinath

     
  • Jostein Tveit

    Jostein Tveit - 2008-03-31

    Logged In: YES
    user_id=2050537
    Originator: NO

    This issue is easily fixed by using a newer libtool to generate the build files.
    libtool-1.5.14 has been used to create the files in cppunit-1.12.0.

    I have tried generating the configuration files with libtool-1.5.22 and it does pass the LDFLAGS for 64 bits Solaris.

    The newest libtool can be downloaded from http://www.gnu.org/software/libtool/

    Please use a newer libtool for the next release.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.