public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RTEMS: Use __cxa_atexit by default for RTEMS
@ 2013-07-08 13:32 Sebastian Huber
  2013-07-31  8:34 ` Sebastian Huber
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Huber @ 2013-07-08 13:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: rtems-devel, Sebastian Huber

The __cxa_atexit support is a reqirement for destructor registration of
thread-local objects.

For *-*-elf it is already enabled by default.  See comment line 810 in
"gcc/config.gcc".

Define TARGET_LIBGCC_SDATA_SECTION on PowerPC for RTEMS to ".sdata" to
place the __dso_handle.  The __dso_handle is referenced by application
code.  In case this code uses the small data section, the __dso_handle
must be there.

This patch should be committed to GCC 4.8 and 4.9.

Test results:

http://gcc.gnu.org/ml/gcc-testresults/2013-07/msg00671.html

gcc/ChangeLog
2013-07-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* config.gcc (*-*-rtems*): Use __cxa_atexit by default.
	* config/rs6000/rtems.h (TARGET_LIBGCC_SDATA_SECTION): Define.
---
 gcc/config.gcc            |    1 +
 gcc/config/rs6000/rtems.h |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index a927964..1648dfe 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -734,6 +734,7 @@ case ${target} in
     yes) thread_file='rtems' ;;
   esac
   extra_options="${extra_options} rtems.opt"
+  default_use_cxa_atexit=yes
   use_gcc_stdint=wrap
   ;;
 *-*-uclinux*)
diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
index b910b5e..fb22be1 100644
--- a/gcc/config/rs6000/rtems.h
+++ b/gcc/config/rs6000/rtems.h
@@ -34,6 +34,9 @@
     }                                     \
   while (0)
 
+#undef TARGET_LIBGCC_SDATA_SECTION
+#define TARGET_LIBGCC_SDATA_SECTION ".sdata"
+
 #undef CPP_OS_DEFAULT_SPEC
 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_rtems)"
 
-- 
1.7.7

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RTEMS: Use __cxa_atexit by default for RTEMS
  2013-07-08 13:32 [PATCH] RTEMS: Use __cxa_atexit by default for RTEMS Sebastian Huber
@ 2013-07-31  8:34 ` Sebastian Huber
  2013-07-31 13:32   ` Joel Sherrill
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Huber @ 2013-07-31  8:34 UTC (permalink / raw)
  To: gcc-patches; +Cc: Joel Sherrill

Ping.

On 2013-07-08 15:29, Sebastian Huber wrote:
> The __cxa_atexit support is a reqirement for destructor registration of
> thread-local objects.
>
> For *-*-elf it is already enabled by default.  See comment line 810 in
> "gcc/config.gcc".
>
> Define TARGET_LIBGCC_SDATA_SECTION on PowerPC for RTEMS to ".sdata" to
> place the __dso_handle.  The __dso_handle is referenced by application
> code.  In case this code uses the small data section, the __dso_handle
> must be there.
>
> This patch should be committed to GCC 4.8 and 4.9.
>
> Test results:
>
> http://gcc.gnu.org/ml/gcc-testresults/2013-07/msg00671.html
>
> gcc/ChangeLog
> 2013-07-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
>
> 	* config.gcc (*-*-rtems*): Use __cxa_atexit by default.
> 	* config/rs6000/rtems.h (TARGET_LIBGCC_SDATA_SECTION): Define.
> ---
>   gcc/config.gcc            |    1 +
>   gcc/config/rs6000/rtems.h |    3 +++
>   2 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/gcc/config.gcc b/gcc/config.gcc
> index a927964..1648dfe 100644
> --- a/gcc/config.gcc
> +++ b/gcc/config.gcc
> @@ -734,6 +734,7 @@ case ${target} in
>       yes) thread_file='rtems' ;;
>     esac
>     extra_options="${extra_options} rtems.opt"
> +  default_use_cxa_atexit=yes
>     use_gcc_stdint=wrap
>     ;;
>   *-*-uclinux*)
> diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
> index b910b5e..fb22be1 100644
> --- a/gcc/config/rs6000/rtems.h
> +++ b/gcc/config/rs6000/rtems.h
> @@ -34,6 +34,9 @@
>       }                                     \
>     while (0)
>
> +#undef TARGET_LIBGCC_SDATA_SECTION
> +#define TARGET_LIBGCC_SDATA_SECTION ".sdata"
> +
>   #undef CPP_OS_DEFAULT_SPEC
>   #define CPP_OS_DEFAULT_SPEC "%(cpp_os_rtems)"
>
>


-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RTEMS: Use __cxa_atexit by default for RTEMS
  2013-07-31  8:34 ` Sebastian Huber
@ 2013-07-31 13:32   ` Joel Sherrill
  0 siblings, 0 replies; 3+ messages in thread
From: Joel Sherrill @ 2013-07-31 13:32 UTC (permalink / raw)
  To: Sebastian Huber; +Cc: gcc-patches

This is now committed.

Please double check me, Sebastian.

--joel

On 7/31/2013 2:02 AM, Sebastian Huber wrote:
> Ping.
>
> On 2013-07-08 15:29, Sebastian Huber wrote:
>> The __cxa_atexit support is a reqirement for destructor registration of
>> thread-local objects.
>>
>> For *-*-elf it is already enabled by default.  See comment line 810 in
>> "gcc/config.gcc".
>>
>> Define TARGET_LIBGCC_SDATA_SECTION on PowerPC for RTEMS to ".sdata" to
>> place the __dso_handle.  The __dso_handle is referenced by application
>> code.  In case this code uses the small data section, the __dso_handle
>> must be there.
>>
>> This patch should be committed to GCC 4.8 and 4.9.
>>
>> Test results:
>>
>> http://gcc.gnu.org/ml/gcc-testresults/2013-07/msg00671.html
>>
>> gcc/ChangeLog
>> 2013-07-08  Sebastian Huber  <sebastian.huber@embedded-brains.de>
>>
>> 	* config.gcc (*-*-rtems*): Use __cxa_atexit by default.
>> 	* config/rs6000/rtems.h (TARGET_LIBGCC_SDATA_SECTION): Define.
>> ---
>>    gcc/config.gcc            |    1 +
>>    gcc/config/rs6000/rtems.h |    3 +++
>>    2 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/gcc/config.gcc b/gcc/config.gcc
>> index a927964..1648dfe 100644
>> --- a/gcc/config.gcc
>> +++ b/gcc/config.gcc
>> @@ -734,6 +734,7 @@ case ${target} in
>>        yes) thread_file='rtems' ;;
>>      esac
>>      extra_options="${extra_options} rtems.opt"
>> +  default_use_cxa_atexit=yes
>>      use_gcc_stdint=wrap
>>      ;;
>>    *-*-uclinux*)
>> diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
>> index b910b5e..fb22be1 100644
>> --- a/gcc/config/rs6000/rtems.h
>> +++ b/gcc/config/rs6000/rtems.h
>> @@ -34,6 +34,9 @@
>>        }                                     \
>>      while (0)
>>
>> +#undef TARGET_LIBGCC_SDATA_SECTION
>> +#define TARGET_LIBGCC_SDATA_SECTION ".sdata"
>> +
>>    #undef CPP_OS_DEFAULT_SPEC
>>    #define CPP_OS_DEFAULT_SPEC "%(cpp_os_rtems)"
>>
>>
>


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-31 12:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-08 13:32 [PATCH] RTEMS: Use __cxa_atexit by default for RTEMS Sebastian Huber
2013-07-31  8:34 ` Sebastian Huber
2013-07-31 13:32   ` Joel Sherrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).