From 008355a6ed0180b715a34bd49f67a987a78057fe Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Sun, 13 May 2001 22:17:02 +0000 Subject: [PATCH] tm.texi (THREAD_MODEL_SPEC): Document it. * 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. From-SVN: r42048 --- gcc/ChangeLog | 7 +++++++ gcc/config/rs6000/aix43.h | 4 ++++ gcc/config/rs6000/aix51.h | 4 ++++ gcc/gcc.c | 15 ++++++++++++++- gcc/tm.texi | 10 ++++++++++ 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a7e6bc615e..22f729ffa1e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2001-05-13 Alexandre Oliva + + * 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 * rtl.h (SYMBOL_REF_WEAK): New macro. diff --git a/gcc/config/rs6000/aix43.h b/gcc/config/rs6000/aix43.h index 3f08e771fe2..78700eaa209 100644 --- a/gcc/config/rs6000/aix43.h +++ b/gcc/config/rs6000/aix43.h @@ -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 diff --git a/gcc/config/rs6000/aix51.h b/gcc/config/rs6000/aix51.h index 5875956b7b7..a72d986cd1e 100644 --- a/gcc/config/rs6000/aix51.h +++ b/gcc/config/rs6000/aix51.h @@ -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 diff --git a/gcc/gcc.c b/gcc/gcc.c index 34047e64422..1ba86eebc9d 100644 --- 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 diff --git a/gcc/tm.texi b/gcc/tm.texi index 8f1c314d790..e777ea9a37b 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -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