@@ -529,9 +529,7 @@ lang_opt_files=@lang_opt_files@ $(srcdir
lang_specs_files=@lang_specs_files@
lang_tree_files=@lang_tree_files@
target_cpu_default=@target_cpu_default@
-GCC_THREAD_FILE=@thread_file@
OBJC_BOEHM_GC=@objc_boehm_gc@
-GTHREAD_FLAGS=@gthread_flags@
extra_modes_file=@extra_modes_file@
extra_opt_files=@extra_opt_files@
host_hook_obj=@out_host_hook_obj@
@@ -1801,7 +1799,6 @@ libgcc-support: libgcc.mvars stmp-int-hd
libgcc.mvars: config.status Makefile specs xgcc$(exeext)
: > tmp-libgcc.mvars
echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
- echo GTHREAD_FLAGS = '$(GTHREAD_FLAGS)' >> tmp-libgcc.mvars
echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
@@ -84,7 +84,7 @@
#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC "\
%{posix:-D_POSIX_SOURCE} \
- %{pthread:-D_REENTRANT -D_PTHREADS} \
+ %{pthread:-D_REENTRANT} \
"
#define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS()
@@ -28,7 +28,7 @@
#undef CPP_SPEC
#define CPP_SPEC "%{mam33:-D__AM33__} %{!mam33:-D__AM33__=2 -D__AM33_2__} \
%{posix:-D_POSIX_SOURCE} \
- %{pthread:-D_REENTRANT -D_PTHREADS}"
+ %{pthread:-D_REENTRANT}"
#undef ASM_SPEC
#define ASM_SPEC ""
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3.
/* CPP_SPEC parts common to all NetBSD targets. */
#define NETBSD_CPP_SPEC \
"%{posix:-D_POSIX_SOURCE} \
- %{pthread:-D_REENTRANT -D_PTHREADS}"
+ %{pthread:-D_REENTRANT}"
/* NETBSD_NATIVE is defined when gcc is integrated into the NetBSD
source tree so it can be configured appropriately without using
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3.
#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC "\
%{posix:-D_POSIX_SOURCE} \
- %{pthread:-D_REENTRANT -D_PTHREADS} \
+ %{pthread:-D_REENTRANT} \
"
#define TARGET_OS_CPP_BUILTINS() \
@@ -72,8 +72,7 @@ along with GCC; see the file COPYING3.
#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
#undef CPP_SUBTARGET_SPEC
-#define CPP_SUBTARGET_SPEC "\
-%{pthreads|pthread:-D_REENTRANT -D_PTHREADS}"
+#define CPP_SUBTARGET_SPEC "%{pthreads|pthread:-D_REENTRANT}"
/* Names to predefine in the preprocessor for this target machine. */
#define TARGET_SUB_OS_CPP_BUILTINS()
@@ -17,10 +17,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-# Some runtime modules need these. Can't set extra_headers in config.gcc
-# because the paths are always made absolute to the cpu config dir.
-EXTRA_HEADERS += $(srcdir)/gthr-vxworks.h gthr-default.h
-
# Both the kernel and RTP headers provide limits.h.
LIMITS_H_TEST = true
@@ -1374,19 +1374,6 @@ if test x${thread_file} = x; then
thread_file=${target_thread_file}
fi
-# Make gthr-default.h if we have a thread file.
-gthread_flags=
-if test $thread_file != single; then
- echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h-t
- if diff gthr-default.h-t gthr-default.h 2>/dev/null; then
- rm -f gthr-default.h-t
- else
- mv -f gthr-default.h-t gthr-default.h
- fi
- gthread_flags=-DHAVE_GTHR_DEFAULT
-fi
-AC_SUBST(gthread_flags)
-
# --------
# UNSORTED
# --------
@@ -4887,7 +4874,6 @@ AC_SUBST(out_file)
AC_SUBST(out_object_file)
AC_SUBST(common_out_file)
AC_SUBST(common_out_object_file)
-AC_SUBST(thread_file)
AC_SUBST(tm_file_list)
AC_SUBST(tm_include_list)
AC_SUBST(tm_defines)
@@ -24,16 +24,6 @@
# These files are part of libgcc, or target headers provided by gcc.
gcov-io.h
gcov-iov.c
-gthr-aix.h
-gthr-dce.h
-gthr-posix.c
-gthr-posix.h
-gthr-rtems.h
-gthr-single.h
-gthr-solaris.h
-gthr-vxworks.h
-gthr-win32.h
-gthr.h
limitx.h
limity.h
@@ -223,8 +223,7 @@ endif
#
LIBGCC2_DEBUG_CFLAGS = -g
LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
- $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \
- -DIN_LIBGCC2 \
+ $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
-fbuilding-libgcc -fno-stack-protector \
$(INHIBIT_LIBC_CFLAGS)
@@ -65,6 +65,7 @@
# built for the target, not the host. These files
# are relative to $srcdir/config and must not have
# the same names as files in $srcdir/../gcc/config.
+# thread_header The name of the header file for the thread model used.
# unwind_header The name of the header file declaring the unwind
# runtime interface routines.
@@ -74,6 +75,7 @@ extra_parts=
tmake_file=
tm_file=
tm_define=
+thread_header=
md_unwind_header=no-unwind.h
unwind_header=unwind-generic.h
@@ -285,6 +287,38 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
;;
esac
+# Map from thread model to thread header.
+thread_dir=
+case $target_thread_file in
+ aix)
+ thread_dir=config/rs6000/
+ ;;
+ dce)
+ thread_dir=config/pa/
+ ;;
+ lynx)
+ thread_dir=config/
+ ;;
+ mipssde)
+ thread_dir=config/mips/
+ ;;
+ posix | single)
+ ;;
+ rtems)
+ thread_dir=config/
+ ;;
+ tpf)
+ thread_dir=config/s390/
+ ;;
+ vxworks)
+ thread_dir=config/
+ ;;
+ win32)
+ thread_dir=config/i386/
+ ;;
+esac
+thread_header=${thread_dir}gthr-${target_thread_file}.h
+
case ${host} in
alpha*-*-linux*)
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee t-crtfm alpha/t-linux"
rename from gcc/gthr-lynx.h
rename to libgcc/config/gthr-lynx.h
rename from gcc/gthr-rtems.h
rename to libgcc/config/gthr-rtems.h
rename from gcc/gthr-vxworks.h
rename to libgcc/config/gthr-vxworks.h
@@ -1,7 +1,8 @@
/* Implementation of W32-specific threads compatibility routines for
libgcc2. */
-/* Copyright (C) 1999, 2000, 2002, 2004, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2002, 2004, 2008, 2009, 2011
+ Free Software Foundation, Inc.
Contributed by Mumit Khan <khan@xraylith.wisc.edu>.
Modified and moved to separate file by Danny Smith
<dannysmith@users.sourceforge.net>.
@@ -33,7 +34,7 @@ see the files COPYING3 and COPYING.RUNTI
#endif
#undef __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
#define __GTHREAD_I486_INLINE_LOCK_PRIMITIVES
-#include <gthr-win32.h>
+#include "gthr-win32.h"
/* Windows32 threads specific definitions. The windows32 threading model
does not map well into pthread-inspired gcc's threading model, and so
rename from gcc/gthr-win32.h
rename to libgcc/config/i386/gthr-win32.h
rename from gcc/gthr-mipssde.h
rename to libgcc/config/mips/gthr-mipssde.h
rename from gcc/gthr-dce.h
rename to libgcc/config/pa/gthr-dce.h
rename from gcc/gthr-aix.h
rename to libgcc/config/rs6000/gthr-aix.h
rename from gcc/gthr-tpf.h
rename to libgcc/config/s390/gthr-tpf.h
@@ -372,6 +372,7 @@ AC_CONFIG_LINKS([enable-execute-stack.c:
AC_CONFIG_LINKS([unwind.h:$unwind_header])
AC_CONFIG_LINKS([md-unwind-support.h:config/$md_unwind_header])
AC_CONFIG_LINKS([sfp-machine.h:config/$sfp_machine_header])
+AC_CONFIG_LINKS([gthr-default.h:$thread_header])
# We need multilib support.
AC_CONFIG_FILES([Makefile])
rename from gcc/gthr-posix.h
rename to libgcc/gthr-posix.h
rename from gcc/gthr-single.h
rename to libgcc/gthr-single.h
rename from gcc/gthr.h
rename to libgcc/gthr.h
@@ -132,23 +132,8 @@ see the files COPYING3 and COPYING.RUNTI
__gthread_recursive_mutex_t *mutex,
const __gthread_time_t *abs_time)
- Currently supported threads packages are
- TPF threads with -D__tpf__
- POSIX/Unix98 threads with -D_PTHREADS
- DCE threads with -D_DCE_THREADS
-
*/
-/* Check first for thread specific defines. */
-#if defined (__tpf__)
-#include "gthr-tpf.h"
-#elif _PTHREADS
-#include "gthr-posix.h"
-#elif _DCE_THREADS
-#include "gthr-dce.h"
-
-/* Include GTHREAD_FILE if one is defined. */
-#elif defined(HAVE_GTHR_DEFAULT)
#if SUPPORTS_WEAK
#ifndef GTHREAD_USE_WEAK
#define GTHREAD_USE_WEAK 1
@@ -156,11 +141,6 @@ see the files COPYING3 and COPYING.RUNTI
#endif
#include "gthr-default.h"
-/* Fallback to single thread definitions. */
-#else
-#include "gthr-single.h"
-#endif
-
#ifndef HIDE_EXPORTS
#pragma GCC visibility pop
#endif
@@ -56,7 +56,9 @@ libcaf_single_la_LINK = $(LINK) $(libcaf
## use -iquote
AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
-I$(srcdir)/$(MULTISRCTOP)../gcc/config $(LIBQUADINCLUDE) \
- -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc
+ -I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
+ -I$(srcdir)/$(MULTISRCTOP)../libgcc \
+ -I$(MULTIBUILDTOP)../libgcc
# Fortran rules for complex multiplication and division
AM_CFLAGS += -fcx-fortran-rules
@@ -83,17 +83,6 @@ if (foovar > 10) return __sync_add_and_f
[Define to 1 if the target supports __sync_fetch_and_add])
fi])
-dnl Check if threads are supported.
-AC_DEFUN([LIBGFOR_CHECK_GTHR_DEFAULT], [
- AC_CACHE_CHECK([configured target thread model],
- libgfor_cv_target_thread_file, [
-libgfor_cv_target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`])
-
- if test $libgfor_cv_target_thread_file != single; then
- AC_DEFINE(HAVE_GTHR_DEFAULT, 1,
- [Define if the compiler has a thread header that is non single.])
- fi])
-
dnl Check for pragma weak.
AC_DEFUN([LIBGFOR_GTHREAD_WEAK], [
AC_CACHE_CHECK([whether pragma weak works],
@@ -550,9 +550,6 @@ LIBGFOR_CHECK_ATTRIBUTE_ALIAS
# Check out sync builtins support.
LIBGFOR_CHECK_SYNC_FETCH_AND_ADD
-# Check out thread support.
-LIBGFOR_CHECK_GTHR_DEFAULT
-
# Check out #pragma weak.
LIBGFOR_GTHREAD_WEAK
@@ -102,6 +102,7 @@ INCLUDES = -I$(srcdir)/$(MULTISRCTOP)../
-I$(srcdir)/$(MULTISRCTOP)../gcc/config \
-I$(MULTIBUILDTOP)../../$(host_subdir)/gcc \
-I$(srcdir)/$(MULTISRCTOP)../libgcc \
+ -I$(MULTIBUILDTOP)../libgcc \
-I$(srcdir)/$(MULTISRCTOP)../include \
$(OBJC_BOEHM_GC_INCLUDES)
@@ -217,15 +217,6 @@ AC_CHECK_HEADERS(sched.h)
# Miscellanea
# -----------
-AC_MSG_CHECKING([for thread model used by GCC])
-target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
-AC_MSG_RESULT([$target_thread_file])
-
-if test $target_thread_file != single; then
- AC_DEFINE(HAVE_GTHR_DEFAULT, 1,
- [Define if the compiler has a thread header that is non single.])
-fi
-
# Check if we have thread-local storage
GCC_CHECK_TLS
@@ -35,6 +35,7 @@ dnl SUBDIRS
dnl Substs:
dnl glibcxx_builddir (absolute path)
dnl glibcxx_srcdir (absolute path)
+dnl toplevel_builddir (absolute path)
dnl toplevel_srcdir (absolute path)
dnl with_cross_host
dnl with_newlib
@@ -59,9 +60,11 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [
[\\/$]* | ?:[\\/]*) glibcxx_srcdir=${srcdir} ;;
*) glibcxx_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
esac
+ toplevel_builddir=${glibcxx_builddir}/..
toplevel_srcdir=${glibcxx_srcdir}/..
AC_SUBST(glibcxx_builddir)
AC_SUBST(glibcxx_srcdir)
+ AC_SUBST(toplevel_builddir)
AC_SUBST(toplevel_srcdir)
# We use these options to decide which functions to include. They are
@@ -3226,34 +3229,10 @@ dnl having to write complex code (the se
dnl namespace are complex and fragile enough as it is). We must also
dnl add a relative path so that -I- is supported properly.
dnl
-dnl Substs:
-dnl glibcxx_thread_h
-dnl
-dnl Defines:
-dnl HAVE_GTHR_DEFAULT
-dnl
AC_DEFUN([GLIBCXX_ENABLE_THREADS], [
AC_MSG_CHECKING([for thread model used by GCC])
target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
AC_MSG_RESULT([$target_thread_file])
-
- if test $target_thread_file != single; then
- AC_DEFINE(HAVE_GTHR_DEFAULT, 1,
- [Define if gthr-default.h exists
- (meaning that threading support is enabled).])
- fi
-
- glibcxx_thread_h=gthr-$target_thread_file.h
-
- dnl Check for __GTHREADS define.
- gthread_file=${toplevel_srcdir}/gcc/${glibcxx_thread_h}
- if grep __GTHREADS $gthread_file >/dev/null 2>&1 ; then
- enable_thread=yes
- else
- enable_thread=no
- fi
-
- AC_SUBST(glibcxx_thread_h)
])
@@ -3267,7 +3246,8 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -fno-exceptions -I${toplevel_srcdir}/gcc"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions \
+ -I${toplevel_srcdir}/libgcc -I${toplevel_builddir}/libgcc"
AC_MSG_CHECKING([check whether it can be safely assumed that mutex_timedlock is available])
@@ -846,7 +846,6 @@ thread_host_headers = \
${host_builddir}/gthr.h \
${host_builddir}/gthr-single.h \
${host_builddir}/gthr-posix.h \
- ${host_builddir}/gthr-tpf.h \
${host_builddir}/gthr-default.h
@@ -1108,43 +1107,35 @@ endif
# Host includes for threads
uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
-${host_builddir}/gthr.h: ${toplevel_srcdir}/gcc/gthr.h stamp-${host_alias}
+${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias}
sed -e '/^#pragma/b' \
-e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
- < ${toplevel_srcdir}/gcc/gthr.h > $@
+ < $< > $@
-${host_builddir}/gthr-single.h: ${toplevel_srcdir}/gcc/gthr-single.h \
+${host_builddir}/gthr-single.h: ${toplevel_srcdir}/libgcc/gthr-single.h \
stamp-${host_alias}
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
- < ${toplevel_srcdir}/gcc/gthr-single.h > $@
+ < $< > $@
-${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/gcc/gthr-posix.h \
+${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/libgcc/gthr-posix.h \
stamp-${host_alias}
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
-e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
- < ${toplevel_srcdir}/gcc/gthr-posix.h > $@
+ < $< > $@
-${host_builddir}/gthr-tpf.h: ${toplevel_srcdir}/gcc/gthr-tpf.h \
- stamp-${host_alias}
- sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
- -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
- -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
- -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
- < ${toplevel_srcdir}/gcc/gthr-tpf.h > $@
-
-${host_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcxx_thread_h} \
+${host_builddir}/gthr-default.h: ${toplevel_builddir}/libgcc/gthr-default.h \
stamp-${host_alias}
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
-e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
- < ${toplevel_srcdir}/gcc/${glibcxx_thread_h} > $@
+ < $< > $@
# Build two precompiled C++ includes, stdc++.h.gch/*.gch
${pch1a_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source}