[libstdc++] Warn when generic atomicity.h is used

Phil Edwards phil@jaj.com
Wed Nov 20 23:36:00 GMT 2002


Last patch for tonight, I promise.  :-)

When the generic atomicity.h was recently hacked over (and we're not done
with it yet, pity), someone requested a configure-time warning if the slow
mutex wrappers were going to be used.  I posted this but forgot to check
it in.

Tested on athlon_mp-pc-linux-gnu, with enough combinations of ATOMICITYH
and threading support to exercise all the warnings.

I took this opportunity to fix some spacing and grammar in other configury
files.


Committed to trunk.


2002-11-21  Phil Edwards  <pme@gcc.gnu.org>

	* acinclude.m4:  Uniform formatting.
	* configure.in:  Warn when generic atomicity.h is used.
	* configure.target:  Fix comment.
	* aclocal.m4, configure:  Regenerate.


Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.222
diff -u -3 -p -r1.222 acinclude.m4
--- acinclude.m4	15 Nov 2002 08:06:31 -0000	1.222
+++ acinclude.m4	21 Nov 2002 07:30:49 -0000
@@ -921,9 +921,9 @@ dnl compilation, pick them up here.
 dnl 
 dnl GLIBCPP_CHECK_TARGET
 AC_DEFUN(GLIBCPP_CHECK_TARGET, [
-    . [$]{glibcpp_basedir}/configure.target
-    AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
-    AC_MSG_RESULT(OS config directory is $os_include_dir)
+  . [$]{glibcpp_basedir}/configure.target
+  AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
+  AC_MSG_RESULT(OS config directory is $os_include_dir)
 ])
 
 
@@ -1120,14 +1120,14 @@ fi
 dnl Run through flags (either default or command-line) and set anything
 dnl extra (e.g., #defines) that must accompany particular g++ options.
 if test -n "$enable_cxx_flags"; then
-    for f in $enable_cxx_flags; do
-        case "$f" in
-            -fhonor-std)  ;;
-            -*)  ;;
-            *)   # and we're trying to pass /what/ exactly?
-                 AC_MSG_ERROR([compiler flags start with a -]) ;;
-        esac
-    done
+  for f in $enable_cxx_flags; do
+    case "$f" in
+      -fhonor-std)  ;;
+      -*)  ;;
+      *)   # and we're trying to pass /what/ exactly?
+           AC_MSG_ERROR([compiler flags start with a -]) ;;
+    esac
+  done
 fi
 EXTRA_CXX_FLAGS="$enable_cxx_flags"
 AC_SUBST(EXTRA_CXX_FLAGS)
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.108
diff -u -3 -p -r1.108 configure.in
--- configure.in	15 Nov 2002 08:06:31 -0000	1.108
+++ configure.in	21 Nov 2002 07:30:52 -0000
@@ -70,6 +70,19 @@ GLIBCPP_ENABLE_CONCEPT_CHECKS
 # Check for headers necessary for libsupc++ using dyn-string.c/cxa_demangle.c
 AC_CHECK_HEADERS(string.h stdlib.h)
 
+# No surprises, no surprises...
+if test $ATOMICITYH = cpu/generic ; then
+  AC_MSG_WARN([No native atomic operations are provided yet for this platform.])
+  if test $target_thread_file = single; then
+    AC_MSG_WARN([They cannot be faked when thread support is disabled.])
+    AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
+  else
+    AC_MSG_WARN([They will be faked using a mutex.])
+    AC_MSG_WARN([Performance of certain classes will degrade as a result.])
+  fi
+fi
+
+
 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
 
   # We are being configured with some form of cross compiler.
@@ -417,7 +430,7 @@ GLIBCPP_ENABLE_SYMVERS([yes])
 
 # Propagate the target-specific source directories through the build chain.
 # (Nothing currently uses cpu_include_dir directly; only ATOMICITYH 
-# uses it, and they only get used here.)
+# uses it, and it only gets used in this file.)
 OS_INC_SRCDIR=config/${os_include_dir}
 ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
 AC_SUBST(OS_INC_SRCDIR)
Index: configure.target
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.target,v
retrieving revision 1.55
diff -u -3 -p -r1.55 configure.target
--- configure.target	5 Nov 2002 21:24:37 -0000	1.55
+++ configure.target	21 Nov 2002 07:30:52 -0000
@@ -18,7 +18,7 @@
 #
 #   cpu_include_dir        CPU-specific directory, defaults to cpu/generic
 #                              if cpu/target_cpu doesn't exist.  This is
-#                              used to set the next two:
+#                              used to set ATOMICITYH.
 #
 #   os_include_dir         OS-specific directory, defaults to os/generic.
 #



More information about the Gcc-patches mailing list