This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[PATCH] PR bootstrap/9330: -pthread required to include <pthread.h>(take 2)
- From: Roger Sayle <roger at eyesopen dot com>
- To: Jim Wilson <wilson at tuliptree dot org>, Tom Tromey <tromey at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, <java-patches at gcc dot gnu dot org>
- Date: Tue, 1 Jul 2003 09:53:31 -0600 (MDT)
- Subject: [PATCH] PR bootstrap/9330: -pthread required to include <pthread.h>(take 2)
On Sun, 29 Jun 2003, Jim Wilson wrote:
> > I hope this is a resonable location, there didn't appear to be a
> > THREADCFLAGS option.
>
> I think you should create one. It shouldn't be hard. Just pattern it
> after the existing THREAD* variables.
Hi Jim and Tom,
Although Tom Tromey approved the use (abuse?) of THREADINCS in my previous
patch to add "-pthread" as a compiler option when required to build
libjava, Jim Wilson had requested that I consider adding a new THREAD*
variable specially for handling compiler flags rather than reuse the
one for include directories.
The revision of my patch below implements this suggestion, by introducing
a new THREADCXXFLAGS variable. I'm only reposting the libjava bits of
my original patch, as nothing else has changed.
The following patch has been tested by a full bootstrap of the compiler
on alphaev67-dec-osf5.1, all languages except Ada and treelang, which
would otherwise fail without these patches.
Ok for mainline? Tom, if this is OK could you please apply it for me,
as I get very nervous about regenerating files and autoconf/automake
version requirements? Jim, can I commit the C/C++ bits as originally
posted? Many thanks to you both.
2003-07-01 Roger Sayle <roger@eyesopen.com>
PR bootstrap/9330
* configure.in: Add new THREADCXXFLAGS variable. Set it to
-pthread if using posix threads on alpha*-dec-osf5*.
* configure: Regenerate.
* Makefile.am: Add THREADCXXFLAGS to AM_CXXFLAGS.
* Makefile.in: Regenerate.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.157
diff -c -3 -p -r1.157 configure.in
*** configure.in 17 Jun 2003 15:56:07 -0000 1.157
--- configure.in 30 Jun 2003 19:12:22 -0000
*************** case "$THREADS" in
*** 432,437 ****
--- 432,438 ----
;;
esac
+ THREADCXXFLAGS=
THREADLDFLAGS=
THREADLIBS=
THREADINCS=
*************** changequote([,])
*** 466,471 ****
--- 467,477 ----
THREADLDFLAGS=-pthread
THREADSPEC=-lc_r
;;
+ alpha*-dec-osf5*)
+ THREADCXXFLAGS=-pthread
+ THREADLIBS=-lpthread
+ THREADSPEC=-lpthread
+ ;;
*)
THREADLIBS=-lpthread
THREADSPEC=-lpthread
*************** AC_SUBST(THREADDEPS)
*** 503,508 ****
--- 509,515 ----
AC_SUBST(THREADOBJS)
AC_SUBST(THREADSPEC)
AC_SUBST(THREADLDFLAGS)
+ AC_SUBST(THREADCXXFLAGS)
if test -d sysdep; then true; else mkdir sysdep; fi
AC_LINK_FILES(sysdep/$sysdeps_dir/locks.h, sysdep/locks.h)
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.304
diff -c -3 -p -r1.304 Makefile.am
*** Makefile.am 27 Jun 2003 12:48:39 -0000 1.304
--- Makefile.am 30 Jun 2003 19:12:23 -0000
*************** GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE
*** 91,97 ****
WARNINGS = -W -Wall
## We need _GNU_SOURCE defined for some Linux builds. It doesn't hurt
## to always define it.
! AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
## Some systems don't allow `$' in identifiers by default, so we force it.
-fdollars-in-identifiers \
## Detect bugs in the verifier implementation, and maybe other places.
--- 91,97 ----
WARNINGS = -W -Wall
## We need _GNU_SOURCE defined for some Linux builds. It doesn't hurt
## to always define it.
! AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions $(THREADCXXFLAGS) \
## Some systems don't allow `$' in identifiers by default, so we force it.
-fdollars-in-identifiers \
## Detect bugs in the verifier implementation, and maybe other places.
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833