This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Curent 3.0 branch of gcc fails to configure on AIX
- To: David Edelsohn <dje at watson dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Subject: Re: Curent 3.0 branch of gcc fails to configure on AIX
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 12 May 2001 10:18:35 -0300
- Cc: libstdc++ at gcc dot gnu dot org, Matt_Conway at i2 dot com, Mark Mitchell <mark at codesourcery dot com>
- Organization: GCC Team, Red Hat
- References: <200105092143.RAA09618@makai.watson.ibm.com>
On May 9, 2001, David Edelsohn <dje@watson.ibm.com> wrote:
> Your 2001-04-26 libstdc++ patch to determine what threads package
> to use has broken libstdc++-v3 configuration on AIX.
Oops. Sorry.
> GCC for AIX uses a fake thread model of "aix" for Objective C
> which dynamically chooses POSIX or Single as necessary (gcc/gthr-aix.h).
I see.
> libstdc++-v3 configuration cannot understand the "aix" thread model
> response from GCC and the single, uniform, non-multilib information
> provided does not allow libstdc++-v3 to be configured properly for
> AIX on a multilib directory-by-directory basis.
> Alternatively, the thread model response from GCC must be more
> intelligent for AIX by knowing the commandline argument which
> affects pthread multilib status.
How's this? Ok to install? Mainline and 3.0 branch?
Index: gcc/ChangeLog
from 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.
Index: gcc/tm.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tm.texi,v
retrieving revision 1.186
diff -u -p -r1.186 tm.texi
--- gcc/tm.texi 2001/05/12 10:41:21 1.186
+++ gcc/tm.texi 2001/05/12 13:17:17
@@ -248,6 +248,16 @@ the very end of the command given to the
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
Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.225
diff -u -p -r1.225 gcc.c
--- gcc/gcc.c 2001/05/05 12:29:33 1.225
+++ gcc/gcc.c 2001/05/12 13:17:18
@@ -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: gcc/config/rs6000/aix43.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix43.h,v
retrieving revision 1.18
diff -u -p -r1.18 aix43.h
--- gcc/config/rs6000/aix43.h 2001/02/07 19:10:57 1.18
+++ gcc/config/rs6000/aix43.h 2001/05/12 13:17:18
@@ -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: libstdc++-v3/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* configure.target: Remove detection of AIX pthread multilib, now
obtained from `gcc -v'.
Index: libstdc++-v3/configure.target
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.target,v
retrieving revision 1.18
diff -u -p -r1.18 configure.target
--- libstdc++-v3/configure.target 2001/03/31 20:15:41 1.18
+++ libstdc++-v3/configure.target 2001/05/12 13:17:18
@@ -60,14 +60,6 @@ esac
case "${target_os}" in
aix4.[3456789]* | aix[56789]*)
os_include_dir="config/os/aix"
- case "$CXX" in
- *pthread*)
- enable_threads='posix'
- ;;
- *)
- enable_threads='no'
- ;;
- esac
;;
bsd* | freebsd* )
os_include_dir="config/os/bsd/freebsd"
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me