source: rtems-tools/tools/4.11/gcc/gcc-rtems-thread-model-posix-1.diff @ b2589cb

4.104.115
Last change on this file since b2589cb was b2589cb, checked in by Chris Johns <chrisj@…>, on 08/14/13 at 03:49:27

gcc: Switch GCC to the posix thread model.

Change from the RTEMS thread model to the POSIX model. Do not enable
the weak support as it fails to link in the posix parts from the
RTEMS library. No weak support requires libstdc++'s makefile be
updated to handle RTEMS.

  • Property mode set to 100644
File size: 3.4 KB
  • gcc/config.gcc

    diff --git a/gcc/config.gcc b/gcc/config.gcc
    index ef37e61..6e03865 100644
    a b case ${target} in 
    763763  ;;
    764764*-*-rtems*)
    765765  case ${enable_threads} in
    766     yes) thread_file='rtems' ;;
     766    yes) thread_file='posix' ;;
    767767  esac
    768768  extra_options="${extra_options} rtems.opt"
    769769  default_use_cxa_atexit=yes
  • libgcc/config/t-rtems

    diff --git a/libgcc/config/t-rtems b/libgcc/config/t-rtems
    index 85f1da9..11e0c64 100644
    a b  
    11# If we are building next to newlib, this will let us find the RTEMS
    22# limits.h when building libgcc2.  Otherwise, newlib must be installed
    33# first.
    4 LIBGCC2_INCLUDES = -I$(srcdir)/../newlib/libc/sys/rtems/include
     4LIBGCC2_INCLUDES = -I$(srcdir)/../newlib/libc/sys/rtems/include -I$(srcdir)/../newlib/libc/sys/rtems
  • libgcc/gthr-posix.h

    diff --git a/libgcc/gthr-posix.h b/libgcc/gthr-posix.h
    index f0d8cd7..653a7fc 100644
    a b __gthrw(pthread_detach) 
    110110#ifndef __BIONIC__
    111111__gthrw(pthread_cancel)
    112112#endif
     113#ifndef __rtems__
    113114__gthrw(sched_yield)
     115#endif
    114116
    115117__gthrw(pthread_mutex_lock)
    116118__gthrw(pthread_mutex_trylock)
    __gthread_objc_thread_get_priority (void) 
    447449static inline void
    448450__gthread_objc_thread_yield (void)
    449451{
     452#ifndef __rtems__
    450453  if (__gthread_active_p ())
    451454    __gthrw_(sched_yield) ();
     455#endif
    452456}
    453457
    454458/* Terminate the current thread.  */
    __gthread_self (void) 
    689693static inline int
    690694__gthread_yield (void)
    691695{
     696#ifndef __rtems__
    692697  return __gthrw_(sched_yield) ();
     698#else
     699  return 0;
     700#endif
    693701}
    694702
    695703static inline int
  • libgcc/gthr.h

    diff --git a/libgcc/gthr.h b/libgcc/gthr.h
    index 0edb583..672f69d 100644
    a b see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 
    135135#if SUPPORTS_WEAK
    136136/* The pe-coff weak support isn't fully compatible to ELF's weak.
    137137   For static libraries it might would work, but as we need to deal
    138    with shared versions too, we disable it for mingw-targets.  */
    139 #ifdef __MINGW32__
     138   with shared versions too, we disable it for mingw-targets.
     139
     140   RTEMS is always threaded so disable weak support.  */
     141#if defined(__MINGW32__) || defined(__rtems__)
    140142#undef GTHREAD_USE_WEAK
    141143#define GTHREAD_USE_WEAK 0
    142144#endif
  • libstdc++-v3/include/Makefile.am

    diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
    index 5971af3..b8f2842 100644
    a b ${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias} 
    11391139            -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
    11401140            -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
    11411141            -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
     1142            -e 's/_GLIBCXX___rtems_GLIBCXX___/__rtems__/g' \
    11421143            -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
    11431144            < $< > $@
    11441145
  • libstdc++-v3/include/Makefile.in

    diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
    index aa8ef43..1536a7f 100644
    a b ${host_builddir}/gthr.h: ${toplevel_srcdir}/libgcc/gthr.h stamp-${host_alias} 
    15451545            -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
    15461546            -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
    15471547            -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \
     1548            -e 's/_GLIBCXX___rtems_GLIBCXX___/__rtems__/g' \
    15481549            -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
    15491550            < $< > $@
    15501551
Note: See TracBrowser for help on using the repository browser.