aboutsummaryrefslogtreecommitdiff
path: root/libjava/configure.ac
diff options
context:
space:
mode:
authorRanjit Mathew <rmathew@gcc.gnu.org>2006-07-05 02:15:51 +0000
committerRanjit Mathew <rmathew@gcc.gnu.org>2006-07-05 02:15:51 +0000
commit5a1218970f65f132de4d0ddc77a5d68768d19424 (patch)
tree0a98e27f40c056a0c593499932dea332859cbd04 /libjava/configure.ac
parentd2ab4cf72b60d8a81aea2a7e09e1b06a04a5c402 (diff)
downloadgcc-5a1218970f65f132de4d0ddc77a5d68768d19424.zip
gcc-5a1218970f65f132de4d0ddc77a5d68768d19424.tar.gz
gcc-5a1218970f65f132de4d0ddc77a5d68768d19424.tar.bz2
libgcj.spec.in: Use THREADSTARTFILESPEC to affect the spec for startfile.
* libgcj.spec.in: Use THREADSTARTFILESPEC to affect the spec for startfile. * configure.ac: Allow targets to affect the spec for startfile by specifying a THREADSTARTFILESPEC variable. Define this for the win32 threads package to include crtmt.o. * configure: Regenerate. * win32.cc (_CRT_MT): Remove definition. (__mingwthr_key_dtor): Likewise. Co-Authored-By: Danny Smith <dannysmith@users.sourceforge.net> From-SVN: r115196
Diffstat (limited to 'libjava/configure.ac')
-rw-r--r--libjava/configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/libjava/configure.ac b/libjava/configure.ac
index 7dcbe88..fab0264 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -783,6 +783,7 @@ THREADINCS=
THREADDEPS=
THREADH=
THREADSPEC=
+THREADSTARTFILESPEC=
case "$THREADS" in
posix)
case "$host" in
@@ -834,6 +835,20 @@ case "$THREADS" in
win32)
THREADH=win32-threads.h
+ THREADCXXFLAGS=-mthreads
+ # We need thread-safe exception handling so _CRT_MT should be set to 1.
+ # But we do not want the executables created to be dependent on
+ # mingwm10.dll which provides a __mingwthr_key_dtor() that cleans up
+ # exception handling contexts. The following kludge achieves this effect
+ # and causes a dummy __mingwthr_key_dtor() to be linked in from
+ # libmingw32.a. This causes a memory leak of about 24 bytes per thread.
+ # A workaround is to explicitly use -mthreads while linking Java programs.
+ # See PR libgcj/28263.
+ #
+ # FIXME: In Java we are able to detect thread death at the end of
+ # Thread.run() so we should be able to clean up the exception handling
+ # contexts ourselves.
+ THREADSTARTFILESPEC='crtmt%O%s'
;;
none)
@@ -845,6 +860,7 @@ AC_SUBST(THREADLIBS)
AC_SUBST(THREADINCS)
AC_SUBST(THREADDEPS)
AC_SUBST(THREADSPEC)
+AC_SUBST(THREADSTARTFILESPEC)
AC_SUBST(THREADLDFLAGS)
AC_SUBST(THREADCXXFLAGS)
AM_CONDITIONAL(USING_POSIX_THREADS, test "$THREADS" = posix)