This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
libtool upgrade broke libstdc++-v3 on Solaris
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Subject: libtool upgrade broke libstdc++-v3 on Solaris
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 27 Mar 2001 21:52:24 -0300
- Cc: Mark Mitchell <mark at codesourcery dot com>, Zack Weinberg <zackw at stanford dot edu>, rth at redhat dot com, bkoz at redhat dot com
- Organization: GCC Team, Red Hat
The libtool upgrade also backed out a patch by Mark Mitchell that
arranged for libtool to use gcc instead of ld to link C code. Why
does this affect libstdc++-v3? Because libstdc++-v3 used to be linked
pretending it was C, because using g++ would attempt to link libstdc++
in, which obviously wouldn't work.
Instead of re-installing Mark Mitchell's patch, I decided the whole
approach of pretending libstdc++-v3 was C was wrong, and deemed to
break on other platforms.
The fix I chose was to get libstdc++ configured to use xgcc instead of
g++ as the C++ compiler driver, so as to not link libstdc++ in, and
then adjust libstdc++'s work-arounds so as to use CXX to link a C++
library. This was tested on sparc-sun-solaris2.7, GCC 3.0 branch.
I'm checking this in the branch and in the trunk.
Index: ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* configure.in (CXX_FOR_TARGET): Use xgcc for libstdc++-v3.
Index: libstdc++-v3/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* libsupc++/Makefile.am (CXXLINK): Use CXX again, and choose
CXX tag explicitly.
* src/Makefile.am (CXXLINK): Likewise.
* libsupc++/Makefile.in, src/Makefile.in: Rebuilt.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/configure.in,v
retrieving revision 1.90.2.4
diff -u -p -r1.90.2.4 configure.in
--- configure.in 2001/03/10 00:18:10 1.90.2.4
+++ configure.in 2001/03/27 21:46:08
@@ -1456,7 +1456,7 @@ fi
if test "x${CXX_FOR_TARGET+set}" = xset; then
:
elif test -d ${topsrcdir}/gcc; then
- CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
+ CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3) echo xgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
elif test "$host" = "$target"; then
CXX_FOR_TARGET='$(CXX)'
else
Index: libstdc++-v3/libsupc++/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/Makefile.am,v
retrieving revision 1.19.2.1
diff -u -p -r1.19.2.1 Makefile.am
--- libstdc++-v3/libsupc++/Makefile.am 2001/02/17 18:13:08 1.19.2.1
+++ libstdc++-v3/libsupc++/Makefile.am 2001/03/27 21:46:08
@@ -133,11 +133,13 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --ta
--mode=compile $(CXX) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
-# 3) We have a problem when building the shared libstdc++ object if
-# the rules automake generates would be used. We cannot allow CXX to
-# be used in libtool since this would add -lstdc++ to the link line
-# which of course is problematic at this point.
-CXXLINK = $(LIBTOOL) --mode=link "$(CC)" \
+# 3) We'd have a problem when building the shared libstdc++ object if
+# the rules automake generates would be used. We cannot allow g++ to
+# be used since this would add -lstdc++ to the link line which of
+# course is problematic at this point. So, we get the top-level
+# directory to configure libstdc++-v3 to use gcc as the C++
+# compilation driver.
+CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
@OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
Index: libstdc++-v3/src/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.71.2.3
diff -u -p -r1.71.2.3 Makefile.am
--- libstdc++-v3/src/Makefile.am 2001/02/28 06:45:36 1.71.2.3
+++ libstdc++-v3/src/Makefile.am 2001/03/27 21:46:10
@@ -343,9 +343,11 @@ AM_CXXFLAGS = \
LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
-# 3) We have a problem when building the shared libstdc++ object if
-# the rules automake generates would be used. We cannot allow CXX to
-# be used in libtool since this would add -lstdc++ to the link line
-# which of course is problematic at this point.
-CXXLINK = $(LIBTOOL) --mode=link "$(CC)" \
+# 3) We'd have a problem when building the shared libstdc++ object if
+# the rules automake generates would be used. We cannot allow g++ to
+# be used since this would add -lstdc++ to the link line which of
+# course is problematic at this point. So, we get the top-level
+# directory to configure libstdc++-v3 to use gcc as the C++
+# compilation driver.
+CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
@OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me