libtool
[Top][All Lists]
Advanced

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

relink command needs --tag


From: Charles Wilson
Subject: relink command needs --tag
Date: Tue, 12 Aug 2003 02:42:48 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624

I'm not sure exactly where in libtool to put this, so I can't provide a patch. However, see the attached testcase...

This testcase -- and the original problem -- were discovered on a cygwin system (so you'll see references to .dll's) but the problem should also occur on linux/etc.

I stumbled on this problem trying to build ncurses with the newly-added libtool support. Ncurses uses the system libtool script and does NOT build its own copy. Further, ncurses does NOT use automake; rather it uses autoconf and hand-tooled Makefile.in's.

The issue crops up because:
  1) the system libtool "knows" that CXX should be g++
2) ncurses configury detects CXX as c++ (because old-style autoconf-2.13 searches in this order: c++ g++ ...., but new-style autoconf-2.57, used to build the system libtool, searches for g++ first.)

So, you end up with a compile command of "/usr/bin/libtool c++ ..." but where the default compiler (as far as libtool is concerned) for C++ code is 'g++'. In this circumstance, libtool requires the --tag=CXX flag.

That's fine; the hand-tooled Makefile.in's ensure that libtool gets what it wants. The problem is, when doing 'make install' the C++ library is relinked, and thus the relink_cmd is triggered.

And the relink_cmd does NOT contain --tag=CXX, even tho the original command that linked the uninstalled library in the first place DID have --tag=CXX. And so it breaks.

Somehow, the relink_cmd that is stored in the uninstalled la file must propogate the --tag argument (if any) -- but it doesn't.

You can see this by unpacking the attached test case. It is a bit contrived, and does some "bad" automake things -- but I needed to do that in order to make the test case self-contained. My test case does not use 'your' system libtool -- but demonstrates the same problem I found with ncurses+systemlibtool.

After unpacking the testcase, run the bootstrap script. Then, configure as usual. Next, do:

'make CXX=c++'

This works fine -- and you'll see that C++ files are compiled and linked using --tag=CXX. (I assume that on 'your' system, you have both g++ and c++ [where c++ could be a symlink to g++], and that autoconf is 2.57 or above. That way, the libtool thus constructed will believe that g++ is the default compiler thanks to the autoconf-2.57 compiler search order.)

Now, inspect the cxx/libcxxdll.la file -- you'll see that the relink_cmd variable does NOT contain --tag.

Finally, do:

'make install DESTDIR=/tmp'

The install fails, because of the missing --tag.

Can someone smarter than me please fix this, so that --tag=XXXX is included in relink_cmd whenever it is passed on the original --mode=link command line?

--
Chuck

Attachment: no-tag-demo.tar.bz2
Description: BZip2 compressed data


reply via email to

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