]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp: Add RTEMS support
authorSebastian Huber <sebastian.huber@embedded-brains.de>
Thu, 2 Apr 2015 07:15:34 +0000 (07:15 +0000)
committerSebastian Huber <sh@gcc.gnu.org>
Thu, 2 Apr 2015 07:15:34 +0000 (07:15 +0000)
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: r221828

libgomp/ChangeLog
libgomp/configure
libgomp/configure.ac
libgomp/configure.tgt

index c1a983a5094ed7e960a62548fd70debe7ccf51d6..1cd186c4c2bb92f25943e3ee27e229b090c617d1 100644 (file)
@@ -1,3 +1,13 @@
+2015-04-02  Sebastian Huber  <sebastian.huber@embedded-brains.de>
+
+       Backported from mainline
+       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-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/64824
index 766eb098089fbc148c91f7a3ebb1139667ac85cc..32d9325035d1691727338c37f1184781259a967c 100755 (executable)
@@ -14587,7 +14587,7 @@ $as_echo "#define STRING_WITH_STRINGS 1" >>confdefs.h
 
 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 :
   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"
@@ -15009,14 +15009,19 @@ 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=""
-CFLAGS="$CFLAGS -pthread"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+case "$host" in
+  *-*-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.  */
 #include <pthread.h>
-   void *g(void *d) { return NULL; }
+       void *g(void *d) { return NULL; }
 int
 main ()
 {
@@ -15029,10 +15034,10 @@ if ac_fn_c_try_link "$LINENO"; then :
   XPCFLAGS=" -Wc,-pthread"
 else
   CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <pthread.h>
-     void *g(void *d) { return NULL; }
+         void *g(void *d) { return NULL; }
 int
 main ()
 {
@@ -15051,6 +15056,7 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+esac
 
 # Check for functions needed.
 for ac_func in getloadavg clock_gettime strtoull
index 84d250f0b19a237538ff2be3d9810a3c32e99adf..03fc93074c26241877531f8725b00c85a54e9364 100644 (file)
@@ -170,28 +170,34 @@ AC_SUBST(libtool_VERSION)
 AC_STDC_HEADERS
 AC_HEADER_TIME
 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)
 
-# 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=""
-CFLAGS="$CFLAGS -pthread"
-AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
-  [#include <pthread.h>
-   void *g(void *d) { return NULL; }],
-  [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
- [XPCFLAGS=" -Wc,-pthread"],
- [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
-  AC_LINK_IFELSE(
-   [AC_LANG_PROGRAM(
-    [#include <pthread.h>
-     void *g(void *d) { return NULL; }],
-    [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
-   [],
-   [AC_MSG_ERROR([Pthreads are required to build libgomp])])])
+case "$host" in
+  *-*-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(
+      [#include <pthread.h>
+       void *g(void *d) { return NULL; }],
+      [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
+     [XPCFLAGS=" -Wc,-pthread"],
+     [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
+      AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+        [#include <pthread.h>
+         void *g(void *d) { return NULL; }],
+        [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
+       [],
+       [AC_MSG_ERROR([Pthreads are required to build libgomp])])])
+esac
 
 # Check for functions needed.
 AC_CHECK_FUNCS(getloadavg clock_gettime strtoull)
index ebd9be97d08f58211cc6c575eaa5f0e54c486e1f..e8cd14b1681c30499ea02c18bc4439ab5eae4eaa 100644 (file)
@@ -20,6 +20,10 @@ if test $gcc_cv_have_tls = yes ; then
     *-*-linux* | *-*-gnu*)
        XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
        ;;
+
+    *-*-rtems*)
+       XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
+       ;;
   esac
 fi