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]
Other format: [Raw text]

[libstdc++] libstdc++/7691, pass -Wabi, sanity checks


1)  As noted in PR 7691, --enable-cxx-flags can no longer take multiple
options in a quoted string, like it used to, and like the documentation
says.  Quoting the argument is now defeated by the higher-level configury
at some point; the strings are just passed through too many layers of
shell expansion to survive as a single word.

I'm sure there's a quoting method that could be used, but the immediately
obvious ones (double-single-double, escaped quotes, etc) didn't work,
so I don't think the users would appreciate whatever technique /would/ work.

The simple solution is to not use whitespace-seperated flags in the argument.
Losing the quoting doesn't matter then.  I propose to require the flags to
be colon-seperated, e.g, --enable-cxx-flags="-foo:-bar-:baz".  I considered
comma-seperated instead, but that would wreak havoc when trying to pass
-Wl or -Wa or -Wp options.

2)  We now pass -Wabi all the time.

3)  Building libstdc++ has a standalone package (i.e., without the compiler)
hasn't worked in a long time, and it's not supposed to work.  This checks
to make sure that user isn't massively confused on that point.  I don't
know whether we'll continue to release libstdc++ snapshots in the future,
but if we do this might help and can't hurt in any case.


Tested on athlon_mp-pc-linux-gnu.  I'd like feedback on (1) before I apply
this to the trunk.  If nothing breaks, I'll move it to the 3.2 branch
after a time.



2002-08-28  Phil Edwards  <pme@gcc.gnu.org>

	PR libstdc++/7691
	* acinclude.m4 (GLIBCPP_ENABLE_CXX_FLAGS):  Change from space-
	separated to colon-separated arguments.
	* configure.in:  Update argument.
	* docs/html/configopts.html:  Update --enable-cxx-flags description.

	* acinclude.m4 (GLIBCPP_CONFIGURE):  Check that compiler is present.
	(GLIBCPP_EXPORT_FLAGS):  Add -Wabi to WARN_FLAGS.
	* aclocal.m4, configure:  Regenerate.


Index: acinclude.m4
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.216
diff -u -3 -p -r1.216 acinclude.m4
--- acinclude.m4	23 Aug 2002 19:33:37 -0000	1.216
+++ acinclude.m4	29 Aug 2002 02:05:47 -0000
@@ -1,5 +1,5 @@
 dnl
-dnl Initialize configure bits.
+dnl Initialize basic configure bits, set toplevel_srcdir correctly.
 dnl
 dnl GLIBCPP_TOPREL_CONFIGURE
 AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
@@ -37,12 +37,17 @@ AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
 ])
 
 dnl
-dnl Initialize configure bits.
+dnl Initialize the rest of the configury.
 dnl
 dnl GLIBCPP_CONFIGURE
 AC_DEFUN(GLIBCPP_CONFIGURE, [
-
-#possibly test for the presence of the compiler sources here?
+  # basic sanity check
+  if test ! -d ${toplevel_srcdir}/gcc ; then
+    echo 'compiler sources not found' 1>&2
+    echo 'libstdc++ must be built as part of the compiler,' 1>&2
+    echo 'see the installation instructions.' 1>&2
+    exit 1
+  fi
 
   # Export build and source directories.
   # These need to be absolute paths, yet at the same time need to
@@ -1042,23 +1047,24 @@ dnl
 dnl Check for "unusual" flags to pass to the compiler while building.
 dnl
 dnl GLIBCPP_ENABLE_CXX_FLAGS
-dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
+dnl --enable-cxx-flags='-foo:-bar:-baz' is a general method for passing
 dnl     experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
-dnl     Somehow this same set of flags must be passed when [re]building
-dnl     libgcc.
 dnl --disable-cxx-flags passes nothing.
 dnl  +  See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
 dnl         http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
 dnl         http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
 dnl  +  Usage:  GLIBCPP_ENABLE_CXX_FLAGS(default flags)
-dnl       If "default flags" is an empty string (or "none"), the effect is
-dnl       the same as --disable or --enable=no.
+dnl       If "default flags" is an empty string, the effect is
+dnl       the same as --disable or --enable=no.  This option is unique in
+dnl       that user-specified flags append to the default flags rather than
+dnl       replacing them.  (If the user disables this option, then the
+dnl       default flags will also be removed.)
 AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
 define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
 AC_ARG_ENABLE(cxx-flags,
 changequote(<<, >>)dnl
-<<  --enable-cxx-flags=FLAGS      pass compiler FLAGS when building library;
-                                [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
+<<  --enable-cxx-flags=FLAGS    pass colon-seperated compiler FLAGS when
+                              building library; [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
 changequote([, ])dnl
 [case "x$enableval" in
  xyes)   
@@ -1068,12 +1074,10 @@ changequote([, ])dnl
  *)      
         enable_cxx_flags="$enableval" ;;
  esac],
-enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
+enable_cxx_flags='')
 
-dnl Thinko on my part during design.  This kludge is the workaround.
-if test "$enable_cxx_flags" = "none"; then 
-  enable_cxx_flags=''; 
-fi
+dnl Remove delimiters.
+enable_cxx_flags=`IFS=:; X="$enable_cxx_flags"; echo $X`
 
 dnl Run through flags (either default or command-line) and set anything
 dnl extra (e.g., #defines) that must accompany particular g++ options.
@@ -1087,7 +1091,7 @@ if test -n "$enable_cxx_flags"; then
         esac
     done
 fi
-EXTRA_CXX_FLAGS="$enable_cxx_flags"
+EXTRA_CXX_FLAGS="GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT $enable_cxx_flags"
 AC_SUBST(EXTRA_CXX_FLAGS)
 ])
 
@@ -1791,7 +1795,7 @@ AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
   OPTIMIZE_CXXFLAGS=
   AC_SUBST(OPTIMIZE_CXXFLAGS)
 
-  WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
+  WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline -Wabi'
   AC_SUBST(WARN_FLAGS)
 ])
 
Index: configure.in
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.104
diff -u -3 -p -r1.104 configure.in
--- configure.in	20 Aug 2002 07:32:10 -0000	1.104
+++ configure.in	29 Aug 2002 01:47:50 -0000
@@ -62,7 +62,7 @@ GLIBCPP_ENABLE_C99([yes])
 GLIBCPP_ENABLE_LONG_LONG([yes])
 GLIBCPP_ENABLE_CHEADERS([$c_model])
 GLIBCPP_ENABLE_THREADS
-GLIBCPP_ENABLE_CXX_FLAGS([none])
+GLIBCPP_ENABLE_CXX_FLAGS([])
 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
 GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
 GLIBCPP_ENABLE_CONCEPT_CHECKS
Index: docs/html/configopts.html
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/docs/html/configopts.html,v
retrieving revision 1.23
diff -u -3 -r1.23 configopts.html
--- docs/html/configopts.html	20 Aug 2002 00:44:19 -0000	1.23
+++ docs/html/configopts.html	29 Aug 2002 02:11:58 -0000
@@ -164,10 +164,10 @@
  <dt><code>--enable-cxx-flags=FLAGS</code>
  <dd><p>With this option, you can pass a string of -f (functionality)
         flags to the compiler to use when building libstdc++.  FLAGS
-        is a quoted string of options, like
+        is a colon-separated string of options, like
      </p>
         <pre>
-  --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
+  --enable-cxx-flags='-fvtable-gc:-fomit-frame-pointer:-ansi'</pre>
      <p>
         Note that the flags don't necessarily have to all be -f flags,
         as shown, but usually those are the ones that will make sense


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