This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

PATCH: GCC-3.0.4 (pre) on AIX requires pthreads


An alternate patch displayed a more aggressive and thus riskier change
supported by (at least some) libstdc++-v3 maintainers:
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00231.html (see there and
the related thread for additional discussion on the root forces
requiring any patch).

David Edelsohn proposed the minimum required to solve the current
threaded/multilib/libstdc++ issue for AIX.  I went on to propose
dynamically computing the exact number and list of files to be
installed by scanning the installed gthr-default.h file.  This turns
out to be non-expressable at the Makefile dependency level (at least
in terms of portability and maintainability at my level of Makefile
hacking).

The best compromise I see is to unconditionally stage and install
another gthr header.  We already do so for gthr-single.h, which is
only actually used by some port configurations.

Given the construction, this is a very safe patch.  It will allow all
AIX multilib configurations to once again report aix as the base
thread model.  I believe this is what David really wanted to happen on
AIX but if I missed some detail please forgive me.  The modification
to the ${target_builddir}/gthr-default.h rule is actually needed to
fix a similar issue on HPUX10 as well (introduced by change -r1.15 to
gthr-dce.h made on 2001/11/30).  I tested this change by forcing
i386-unknown-freebsd4.5 to use the aix thread model and then
inspecting the staged gthr files.  David, will you commit it with your
related change for AIX.  Alternatively, I will commit it after you
confirm that it will meet your needs.

This whole experience has reminded me what a bad idea it was to
attempt to reuse header files that were never meant to be installed
for use by end-users of gcc...

Developed for mainline and applies cleanly to 3.1 but not 3.0.X.

Regards,
Loren

	* include/Makefile.am (thread_target_headers): Unconditionally
	stage and install gthr-posix.h (thus allowing the aix
	meta-thread model to work again).
	(${target_builddir}/gthr-posix.h): New rule cloned off
	${target_builddir}/gthr-default.h.
	(${target_builddir}/gthr-default.h): Support chained inclusion
	of gthr support headers (to support both gthr-dce.h and
	gthr-aix.h).
	* include/Makefile.in: Rebuilt.

Index: include/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/Makefile.am,v
retrieving revision 1.30
diff -c -r1.30 Makefile.am
*** Makefile.am	2002/02/19 21:35:30	1.30
--- Makefile.am	2002/02/26 04:43:20
***************
*** 287,292 ****
--- 287,293 ----
  thread_target_headers = \
  	${target_builddir}/gthr.h \
  	${target_builddir}/gthr-single.h \
+ 	${target_builddir}/gthr-posix.h \
  	${target_builddir}/gthr-default.h
  
  # List of all timestamp files.  By keeping only one copy of this list, both
***************
*** 388,398 ****
--- 389,407 ----
  	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
  	    < ${toplevel_srcdir}/gcc/gthr-single.h > $@
  
+ ${target_builddir}/gthr-posix.h: ${toplevel_srcdir}/gcc/gthr-posix.h \
+ 				   stamp-${target_alias}
+ 	sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
+ 	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
+ 	    -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \
+ 	    < ${toplevel_srcdir}/gcc/gthr-posix.h > $@
+ 
  ${target_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcpp_thread_h} \
  				   stamp-${target_alias}
  	sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
  	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
  	    -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \
+ 	    -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
  	    < ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@
  
  # For robustness sake (in light of junk files or in-source


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