This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Re: A clue for the libstdc++ problem.


On Sun, Apr 01, 2001 at 04:40:55PM -0300, Alexandre Oliva wrote:
> On Apr  1, 2001, "H . J . Lu" <hjl@lucon.org> wrote:
> 
> > 	* ltcf-cxx.sh: Make sure we never use g++ for the shared
> > 	libstdc++-v3.
> 
> This is outrageously misleading.  BTW, you've duplicated Zack's
> investigative work, and the patch for the top-level Makefile.in I
> wrote on Friday to address his findings hasn't worked, it seems, but
> it's the Makefile.in that has to be fixed.

I am currently testing this patch.  It moves all the special logic
into the subdirectory configure scripts.  This should avoid all the
situations where 'make bootstrap' and 'make all' from the top do
different things.  The only downside I see is that each target library
that needs to link with C++, needs to know to pick up libstdc++.FLAGS
itself.  Since the only one right now is libjava, that's not such a
huge burden.

zw

top level:
	* configure.in (libstdcxx_version, libstdcxx_flags): Expunge.
	(CXX_FOR_TARGET): Always use g++.
libjava:
	* configure.in: Add the contents of ../libstdc++-v3/src/libstdc++.FLAGS
	to $CXX.
	* configure: Regenerate.
libstdc++:
	* configure.in: Change g++ to xgcc in $CXX.
	* configure: Regenerate.
	* src/Makefile.am: Generate libstdc++.FLAGS not
	libstdc++.INC.  Add -L$(top_builddir)/src
	-L$(top_builddir)/src/.libs to its contents.
	* src/Makefile.in: Regenerate.

===================================================================
Index: configure.in
--- configure.in	2001/03/28 01:18:00	1.96
+++ configure.in	2001/04/01 19:58:18
@@ -48,10 +48,6 @@ if [ "${enable_gdbgui}" = "yes" ] ; then
 	host_libs="${host_libs} libgui"
 fi
 
-libstdcxx_version="target-libstdc++-v3"
-# Don't use libstdc++-v3's flags to configure/build itself.
-libstdcxx_flags='`case $$dir in libstdc++-v3) ;; *) cat $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/libstdc++.INC 2>/dev/null || : ;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
-
 # these tools are built for the host environment
 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
 # know that we are building the simulator.
@@ -71,7 +67,7 @@ target_libs="target-libiberty \
 		target-libgloss \
 		target-newlib \
 		target-librx \
-		${libstdcxx_version} \
+		target-libstdc++-v3 \
 		target-libf2c \
 		target-libchill \
 		${libgcj}
@@ -590,7 +586,7 @@ esac
 
 case "${target}" in
   *-*-netware)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-newlib target-libiberty target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-librx target-newlib target-libiberty target-libgloss ${libgcj}"
     ;;
   *-*-rtems*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -624,11 +620,11 @@ case "${target}" in
     noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
     noconfigdirs="$noconfigdirs expect dejagnu"
     # the C++ libraries don't build on top of CE's C libraries
-    noconfigdirs="$noconfigdirs ${libstdcxx_version}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3"
     skipdirs="$skipdirs target-newlib"
     case "${host}" in
       *-*-cygwin*) ;; # keep gdb and readline
-      *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
+      *) noconfigdirs="$noconfigdirs gdb readline target-libstdc++-v3"
 	 ;;
     esac
     ;;
@@ -654,10 +650,10 @@ case "${target}" in
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
   c4x-*-*)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-librx target-libgloss ${libgcj}"
     ;;
   c54x*-*-* | tic54x-*-*)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
     ;;
   thumb-*-coff)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -699,7 +695,7 @@ case "${target}" in
     noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
     ;;
   d10v-*-*)
-    noconfigdirs="$noconfigdirs target-librx ${libstdcxx_version} target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-librx target-libstdc++-v3 target-libgloss ${libgcj}"
     ;;
   d30v-*-*)
     noconfigdirs="${libgcj}"
@@ -712,7 +708,7 @@ case "${target}" in
     ;;
   h8300*-*-* | \
   h8500-*-*)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-librx target-libgloss ${libgcj}"
     ;;
   hppa*-*-*elf* | \
   hppa*-*-linux* | \
@@ -770,7 +766,7 @@ case "${target}" in
     esac
     ;;    
   i[3456]86-*-pe)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-librx target-libgloss ${libgcj}"
     ;;
   i[3456]86-*-sco3.2v5*)
     # The linker does not yet know about weak symbols in COFF,
@@ -927,7 +923,7 @@ case "${target}" in
   sparc-*-solaris*)
     ;;
   v810-*-*)
-    noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
     ;;
   v850-*-*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -1456,7 +1452,7 @@ fi
 if test "x${CXX_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${topsrcdir}/gcc; then
-  CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3) echo xgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
+  CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++'
 elif test "$host" = "$target"; then
   CXX_FOR_TARGET='$(CXX)'
 else
===================================================================
Index: libjava/configure.in
--- libjava/configure.in	2001/04/01 11:16:39	1.77
+++ libjava/configure.in	2001/04/01 19:58:20
@@ -18,6 +18,14 @@ LIBGCJ_CONFIGURE(.)
 
 AM_CONFIG_HEADER(include/config.h)
 
+# If we're in the unified tree, add flags to $CXX to find libstdc++
+# and its headers.
+case $CXX in
+	*'/g++ -B'*'/gcc/ '*)
+		CXX="$CXX `cat ../libstdc++-v3/src/libstdc++.FLAGS`"
+		;;
+esac
+
 # Only use libltdl for native builds.
 if test -z "${with_cross_host}"; then
    AC_LIBLTDL_CONVENIENCE
===================================================================
Index: libstdc++-v3/configure.in
--- libstdc++-v3/configure.in	2001/03/30 08:14:14	1.57
+++ libstdc++-v3/configure.in	2001/04/01 19:58:20
@@ -42,6 +42,16 @@ AC_ARG_WITH(target-subdir,
 AC_ARG_WITH(cross-host,
 [  --with-cross-host=HOST  configuring with a cross compiler])
 
+# If we're in the unified tree, the value of CXX passed down from the
+# driver Makefile is wrong: it cannot successfully link libstdc++.
+# Correct it.
+case $CXX in
+	*'/g++ -B'*'/gcc/ '*)
+		CXX=`echo $CXX | sed 's|/g++|/xgcc|'`	;;
+	*)
+		;;
+esac
+
 # Runs configure.host and configure.target. Have to run this before
 # the GLIBCPP_ENABLE_* macros below.
 GLIBCPP_CONFIGURE(.)
===================================================================
Index: libstdc++-v3/src/Makefile.am
--- libstdc++-v3/src/Makefile.am	2001/03/31 20:15:43	1.80
+++ libstdc++-v3/src/Makefile.am	2001/04/01 19:58:20
@@ -281,8 +281,8 @@ myinstallheaders: 
 
 
 # Alexandre put this in here for some libtool-related reason.
-all: libstdc++.INC
-libstdc++.INC: Makefile
+all: libstdc++.FLAGS
+libstdc++.FLAGS: Makefile
 	$(MAKE) \
 	top_builddir=`CDPATH=:. && cd $(top_builddir) && pwd` \
 	top_srcdir=`CDPATH=:. && cd $(top_srcdir) && pwd` \
@@ -290,9 +290,8 @@ libstdc++.INC: Makefile
 	-rm -f $@
 	mv tmp-$@ $@
 
-tmp-libstdc++.INC: Makefile
-	echo $(INCLUDES) > $@
-
+tmp-libstdc++.FLAGS: Makefile
+	echo $(INCLUDES) -L$(top_builddir)/src -L$(top_builddir)/src/.libs > $@
 
 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
 # modified in a per-library or per-sub-library way.  Need to manually


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]