Skip to content

Replace ctor/dtor priority mechanism with direct init/exit calls - #450

Merged
afxgroup merged 1 commit into
developmentfrom
no_more_ctors_dtors
Jul 31, 2026
Merged

Replace ctor/dtor priority mechanism with direct init/exit calls#450
afxgroup merged 1 commit into
developmentfrom
no_more_ctors_dtors

Conversation

@afxgroup

Copy link
Copy Markdown
Collaborator

clib4's own initialization no longer relies on GCC constructor/destructor attributes with priorities walked via .ctors/.dtors: libOpen()/libClose() now call the init/exit functions directly in a fixed order through clib4_init()/clib4_exit(), so no other library with a same or lower constructor priority can run in between clib4's own initialization steps. The init/exit functions are plain functions named _init/_exit.

The satellite static libraries (libamiga, librt, libpthread) are not part of clib4.library and still register their init/exit functions via constructor/destructor attributes in the executable's ctor/dtor lists.

clib4's own initialization no longer relies on GCC constructor/destructor
attributes with priorities walked via .ctors/.dtors: libOpen()/libClose()
now call the init/exit functions directly in a fixed order through
clib4_init()/clib4_exit(), so no other library with a same or lower
constructor priority can run in between clib4's own initialization steps.
The init/exit functions are plain functions named *_init/*_exit.

The satellite static libraries (libamiga, librt, libpthread) are not part
of clib4.library and still register their init/exit functions via
constructor/destructor attributes in the executable's ctor/dtor lists.
@afxgroup
afxgroup merged commit e818397 into development Jul 31, 2026
3 checks passed
@afxgroup
afxgroup deleted the no_more_ctors_dtors branch July 31, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant