* tm.texi (THREAD_MODEL_SPEC): Document it.
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 13 May 2001 22:17:02 +0000 (22:17 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 13 May 2001 22:17:02 +0000 (22:17 +0000)
* gcc.c (main): Use it.
* config/rs6000/aix43.h (THREAD_MODEL_SPEC): Define it.
* config/rs6000/aix51.h (THREAD_MODEL_SPEC): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42048 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/aix43.h
gcc/config/rs6000/aix51.h
gcc/gcc.c
gcc/tm.texi

index 6a7e6bc..22f729f 100644 (file)
@@ -1,3 +1,10 @@
+2001-05-13  Alexandre Oliva  <aoliva@redhat.com>
+
+       * tm.texi (THREAD_MODEL_SPEC): Document it.
+       * gcc.c (main): Use it.
+       * config/rs6000/aix43.h (THREAD_MODEL_SPEC): Define it.
+       * config/rs6000/aix51.h (THREAD_MODEL_SPEC): Likewise.
+
 2001-05-13  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
        * rtl.h (SYMBOL_REF_WEAK): New macro.
index 3f08e77..78700ea 100644 (file)
@@ -199,6 +199,10 @@ do {                                                                       \
        %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
        %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}"
 
+/* Since there are separate multilibs for pthreads, determine the
+   thread model based on the command-line arguments.  */
+#define THREAD_MODEL_SPEC "%{pthread:posix}%{!pthread:single}"
+
 /* AIX 4.3 typedefs ptrdiff_t as "long" while earlier releases used "int".  */
 
 #undef PTRDIFF_TYPE
index 5875956..a72d986 100644 (file)
@@ -202,6 +202,10 @@ do {                                                                       \
        %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
        %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}"
 
+/* Since there are separate multilibs for pthreads, determine the
+   thread model based on the command-line arguments.  */
+#define THREAD_MODEL_SPEC "%{pthread:posix}%{!pthread:single}"
+
 /* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int".  */
 
 #undef PTRDIFF_TYPE
index 34047e6..1ba86ee 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -5801,10 +5801,23 @@ main (argc, argv)
   if (verbose_flag)
     {
       int n;
+      const char *thrmod;
 
       notice ("Configured with: %s\n", configuration_arguments);
 
-      notice ("Thread model: %s\n", thread_model);
+#ifdef THREAD_MODEL_SPEC
+      /* We could have defined THREAD_MODEL_SPEC to "%*" by default,
+        but there's no point in doing all this processing just to get
+        thread_model back.  */
+      obstack_init (&obstack);
+      do_spec_1 (THREAD_MODEL_SPEC, 0, thread_model);
+      obstack_1grow (&obstack, '\0');
+      thrmod = obstack_finish (&obstack);
+#else
+      thrmod = thread_model;
+#endif
+
+      notice ("Thread model: %s\n", thrmod);
 
       /* compiler_version is truncated at the first space when initialized
         from version string, so truncate version_string at the first space
index 8f1c314..e777ea9 100644 (file)
@@ -248,6 +248,16 @@ the very end of the command given to the linker.
 
 Do not define this macro if it does not need to do anything.
 
+@findex THREAD_MODEL_SPEC
+@item THREAD_MODEL_SPEC
+GCC @code{-v} will print the thread model GCC was configured to use.
+However, this doesn't work on platforms that are multilibbed on thread
+models, such as AIX 4.3.  On such platforms, define
+@code{THREAD_MODEL_SPEC} such that it evaluates to a string without
+blanks that names one of the recognized thread models.  @code{%*}, the
+default value of this macro, will expand to the value of
+@code{thread_file} set in @file{config.gcc}.
+
 @findex EXTRA_SPECS
 @item EXTRA_SPECS
 Define this macro to provide additional specifications to put in the