aboutsummaryrefslogtreecommitdiff
path: root/libcpp/files.cc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2025-03-27 20:29:51 +0100
committerEric Botcazou <ebotcazou@adacore.com>2025-03-27 20:31:31 +0100
commitf4649a8901b2ebd6bd87451c8b758022600bf281 (patch)
tree5778b2e42a4c9d75b143f8325f6e6882beaa9bfc /libcpp/files.cc
parent4242ea1916fffba7c00f6bd2cb1cadb0662f286c (diff)
downloadgcc-f4649a8901b2ebd6bd87451c8b758022600bf281.zip
gcc-f4649a8901b2ebd6bd87451c8b758022600bf281.tar.gz
gcc-f4649a8901b2ebd6bd87451c8b758022600bf281.tar.bz2
Ada: Fix too late initialization of tasking runtime with standalone library
The Tasking_Runtime_Initialize routine installs the tasking version of the RTS_Lock manipulation routines and thus needs to be called very early before the elaboration of all the Ada units of the program, including those of the runtime itself. This is guaranteed by the binder when the tasking runtime is explicitly dragged into the link. However, for a standalone dynamic library that does not depend on the tasking runtime and is auto-initialized, no such guarantee holds, even though the library might be later dragged into a link that contains the tasking runtime. This change causes the routine to be called even earlier, in particular at load time when a (standalone) dynamic library is involved in the link, so as to meet the requirements. It will cause the routine to be called twice if the main subprogram is generated by the binder, but this is harmless since the routine is idempotent. ada/ * libgnarl/s-tasini.adb (Tasking_Runtime_Initialize): Add pragma Linker_Constructor for the procedure.
Diffstat (limited to 'libcpp/files.cc')
0 files changed, 0 insertions, 0 deletions