Commit cd93945d by Sebastian Huber Committed by Sebastian Huber

libgomp: Add RTEMS support

libgomp/ChangeLog

	* configure.tgt (*-*-rtems*): Use local-exec TLS model.
	* configure.ac (*-*-rtems*): Assume Pthread is supported.
	(pthread.h): Check for this header file.
	* configure: Regenerate.

From-SVN: r221415
parent 9b78b1e7
2015-03-13 Sebastian Huber <sebastian.huber@embedded-brains.de>
* configure.tgt (*-*-rtems*): Use local-exec TLS model.
* configure.ac (*-*-rtems*): Assume Pthread is supported.
(pthread.h): Check for this header file.
* configure: Regenerate.
2015-02-25 Tom de Vries <tom@codesourcery.com> 2015-02-25 Tom de Vries <tom@codesourcery.com>
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c (DO_PRAGMA) * testsuite/libgomp.oacc-c-c++-common/reduction-1.c (DO_PRAGMA)
......
...@@ -14611,7 +14611,7 @@ $as_echo "#define STRING_WITH_STRINGS 1" >>confdefs.h ...@@ -14611,7 +14611,7 @@ $as_echo "#define STRING_WITH_STRINGS 1" >>confdefs.h
fi fi
for ac_header in unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h for ac_header in pthread.h unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h
do : do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
...@@ -15033,11 +15033,16 @@ ac_config_commands="$ac_config_commands gstdint.h" ...@@ -15033,11 +15033,16 @@ ac_config_commands="$ac_config_commands gstdint.h"
# Check to see if -pthread or -lpthread is needed. Prefer the former.
# In case the pthread.h system header is not found, this test will fail.
XPCFLAGS="" XPCFLAGS=""
CFLAGS="$CFLAGS -pthread" case "$host" in
cat confdefs.h - <<_ACEOF >conftest.$ac_ext *-*-rtems*)
# RTEMS supports Pthreads, but the library is not available at GCC build time.
;;
*)
# Check to see if -pthread or -lpthread is needed. Prefer the former.
# In case the pthread.h system header is not found, this test will fail.
CFLAGS="$CFLAGS -pthread"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
#include <pthread.h> #include <pthread.h>
void *g(void *d) { return NULL; } void *g(void *d) { return NULL; }
...@@ -15075,6 +15080,7 @@ rm -f core conftest.err conftest.$ac_objext \ ...@@ -15075,6 +15080,7 @@ rm -f core conftest.err conftest.$ac_objext \
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
esac
# Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*- # Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*-
# #
......
...@@ -170,15 +170,20 @@ AC_SUBST(libtool_VERSION) ...@@ -170,15 +170,20 @@ AC_SUBST(libtool_VERSION)
AC_STDC_HEADERS AC_STDC_HEADERS
AC_HEADER_TIME AC_HEADER_TIME
ACX_HEADER_STRING ACX_HEADER_STRING
AC_CHECK_HEADERS(unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h) AC_CHECK_HEADERS(pthread.h unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h)
GCC_HEADER_STDINT(gstdint.h) GCC_HEADER_STDINT(gstdint.h)
# Check to see if -pthread or -lpthread is needed. Prefer the former.
# In case the pthread.h system header is not found, this test will fail.
XPCFLAGS="" XPCFLAGS=""
CFLAGS="$CFLAGS -pthread" case "$host" in
AC_LINK_IFELSE( *-*-rtems*)
# RTEMS supports Pthreads, but the library is not available at GCC build time.
;;
*)
# Check to see if -pthread or -lpthread is needed. Prefer the former.
# In case the pthread.h system header is not found, this test will fail.
CFLAGS="$CFLAGS -pthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM( [AC_LANG_PROGRAM(
[#include <pthread.h> [#include <pthread.h>
void *g(void *d) { return NULL; }], void *g(void *d) { return NULL; }],
...@@ -192,6 +197,7 @@ AC_LINK_IFELSE( ...@@ -192,6 +197,7 @@ AC_LINK_IFELSE(
[pthread_t t; pthread_create(&t,NULL,g,NULL);])], [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[], [],
[AC_MSG_ERROR([Pthreads are required to build libgomp])])]) [AC_MSG_ERROR([Pthreads are required to build libgomp])])])
esac
m4_include([plugin/configfrag.ac]) m4_include([plugin/configfrag.ac])
......
...@@ -20,6 +20,10 @@ if test $gcc_cv_have_tls = yes ; then ...@@ -20,6 +20,10 @@ if test $gcc_cv_have_tls = yes ; then
*-*-linux* | *-*-gnu*) *-*-linux* | *-*-gnu*)
XCFLAGS="${XCFLAGS} -ftls-model=initial-exec" XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
;; ;;
*-*-rtems*)
XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
;;
esac esac
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment