bug-automake
[Top][All Lists]
Advanced

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

overriding cxxld?


From: Karl Berry
Subject: overriding cxxld?
Date: Sun, 14 Aug 2005 23:35:34 +0200

Hi folks,

Question: is it possible to override CXXLD as an environment variable (I
didn't see it in the configure scripts I looked at), or to somehow
"fake" passing it on the command line?  If not, maybe this could be
added as a new envvar?

Background: I need to link libstdc++ (but not libc, libgcc, etc.)
statically (see below).  So far, the best way I've found to do that is
to use a one-line script (say it's called cxxhack):
  exec gcc "$@" -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm

Normally, I think I could say configure CXXLD=cxxhack, or maybe
configure && make CXXLD=cxxhack, or some such.  Unfortunately, in my
case, I'm configuring the package that needs this as part of a much
larger product (again, see below if you care), and there is no easy way
to pass these settings down through all the levels, for various reasons
that aren't worth going into here.

If I could change the configure.ac or Makefile.am source in the
subproduct to change the setting of CXXLD in the final generated
Makefile, that would work.  I could not see how to do this.  Or maybe
there is some other different approach which would achieve the same
result.  Any advice would be appreciated ...

Thanks,
Karl

(*) Here is all the background, in case anyone has a flash of insight,
although it's not directly relevant to the question.  This is for TeX
Live (http://tug.org/texlive), which includes lcdf-typetools
(http://www.lcdf.org/~eddietwo/type), which is written in C++.  We
distribute ready-to-run binaries as part of TL.

In the past, we have dynamically linked against libstdc++, but with the
advent of gcc4 and the usual ABI incompatibility (argh) this is no
longer a good option.  If we link against libstdc++.5 compiled with
gcc3, it will not work on new/future systems where .5 is compiled with
gcc4, or perhaps not even available at all.  Debian, Red Hat, and
probably other distributions are doing this, so it's a practical
problem.  On the other hand, if we link against libstdc++.5 compiled
with gcc4, or libstdc++.6, it will not work on current/older systems.

Static linking is certainly not ideal, and may have problems
(http://www.trilithium.com/johan/2005/06/static-libstdc/), but it seems
to work out in our case, and I have been unable to think of a decent
alternative.




reply via email to

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