#6793: Issues with __cxa_atexit ---------------------------+------------------------------ Reporter: kaliber | Owner: axeld Type: bug | Status: reopened Priority: normal | Milestone: R1 Component: Build System | Version: R1/Development Resolution: | Keywords: gcc Blocked By: | Has a Patch: 1 Platform: All | Blocking: ---------------------------+------------------------------ Changes (by bonefish): * keywords: => gcc * component: System/libroot.so => Build System Comment: Replying to [comment:10 kaliber]: > Replying to [comment:9 bonefish]: > > I see two issues with the patches: > > - I doubt the gcc patch is sufficient. By using the shared library glue code `__cxa_finalize()` will be called, but since gcc hasn't ever output code using `__cxa_atexit()` I suspect it won't do that now either. So it probably has to be enabled explicitly. > > I think that `--enable-__cxa_atexit` is sufficient. I've enabled it by default for Haiku in gcc/config.gcc Uh, sorry, I don't know how I missed that. > > - Selecting the glue code depending on the `shared` option has the problem that it won't work for executable add-ons -- `__cxa_finalize()` will not be called for them. > > Are there executable and non-executable add-ons? For example filetype add-on for tracker is build with `-nostart` (`-shared`), so it will work. Replicants come to mind. They are usually implemented directly in executables, but need to be loaded as an add-on by the host application. There are also regular add-ons that are executable. Most of those don't provide any actual functionality this way, though, but only show an about box or some alert. > If there are executable add-ons, we can introduce -addon flag for gcc. I haven't read up on that, but `-pie` might already be supposed to have the desired semantics. It's just not properly implemented in the gcc specs yet. -- Ticket URL: <http://dev.haiku-os.org/ticket/6793#comment:13> Haiku <http://dev.haiku-os.org> Haiku - the operating system.