#2289 closed defect (fixed)
rtems_ada_self is broken on SMP
Reported by: | Sebastian Huber | Owned by: | Needs Funding |
---|---|---|---|
Priority: | normal | Milestone: | 5.1 |
Component: | tool/gcc | Version: | |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description
The global variable rtems_ada_self is broken on SMP (similar to the task variables) and should be replaced with a function call or thread specific data.
Change History (15)
comment:1 Changed on 01/26/17 at 07:16:00 by Sebastian Huber
Milestone: | 4.11.1 → 4.11.2 |
---|
comment:2 Changed on 02/15/17 at 13:37:51 by Sebastian Huber
Milestone: | 4.11.2 → Indefinite |
---|---|
Owner: | set to Needs Funding |
Status: | new → assigned |
comment:3 Changed on 03/07/17 at 10:07:12 by Sebastian Huber
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
comment:4 Changed on 05/23/17 at 08:01:52 by Sebastian Huber
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Version: | 4.11 |
One option is to use TLS, e.g.
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index 598b262d914..5e1c5286d63 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -1743,7 +1743,7 @@ ifeq ($(strip $(filter-out rtems%,$(target_os))),) s-parame.adb<s-parame-rtems.adb \ s-taprop.adb<s-taprop-posix.adb \ s-taspri.ads<s-taspri-posix.ads \ - s-tpopsp.adb<s-tpopsp-rtems.adb \ + s-tpopsp.adb<s-tpopsp-tls.adb \ s-stchop.adb<s-stchop-rtems.adb \ s-interr.adb<s-interr-hwint.adb endif
Another option is to use POSIX keys:
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in index 598b262d914..5e1c5286d63 100644 --- a/gcc/ada/gcc-interface/Makefile.in +++ b/gcc/ada/gcc-interface/Makefile.in @@ -1743,7 +1743,7 @@ ifeq ($(strip $(filter-out rtems%,$(target_os))),) s-parame.adb<s-parame-rtems.adb \ s-taprop.adb<s-taprop-posix.adb \ s-taspri.ads<s-taspri-posix.ads \ - s-tpopsp.adb<s-tpopsp-rtems.adb \ + s-tpopsp.adb<s-tpopsp-posix.adb \ s-stchop.adb<s-stchop-rtems.adb \ s-interr.adb<s-interr-hwint.adb endif
I tend to use TLS since it has less overhead.
comment:6 Changed on 06/07/17 at 09:50:37 by Sebastian Huber
comment:7 Changed on 06/07/17 at 13:12:16 by Joel Sherrill
Just to be clear. We are using keys now for Ada. Does confdefs.h reflect this?
comment:8 Changed on 06/07/17 at 13:19:36 by Sebastian Huber
No, we used a hand crafted task variable for this. I will update RTEMS once the RSB is updated. Need to backport the GCC change to GCC 7 branch before.
comment:9 Changed on 06/07/17 at 13:52:17 by Sebastian Huber
This change breaks the x86 Ada support as long as x86 has no TLS support.
comment:10 Changed on 06/07/17 at 17:49:23 by Joel Sherrill
So we are now using TLS for Ada.Self. I was thinking the POSIX default code used keys. That was the original implementation in GNAT. Is it TLS or POSIX keys?
comment:12 Changed on 06/12/17 at 11:53:01 by Sebastian Huber <sebastian.huber@…>
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:13 Changed on 06/12/17 at 11:54:23 by Sebastian Huber
Milestone: | Indefinite → 4.12.0 |
---|
comment:14 Changed on 06/14/17 at 05:31:18 by Sebastian Huber <sebastian.huber@…>
In 3dd67dd1/rtems:
comment:15 Changed on 11/09/17 at 06:27:14 by Sebastian Huber
Milestone: | 4.12.0 → 5.1 |
---|
Milestone renamed
Duplicate of #2835.