Skip to content

Commit

Permalink
lsb: don't provide __dso_handle for static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lzcunt committed Jan 12, 2025
1 parent f147924 commit 0c766b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions options/lsb/generic/dso_exit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ extern "C" void __cxa_finalize(void *dso) {
}
}

#ifndef MLIBC_STATIC_BUILD
// This is referenced by the compiler when generating constructors for global
// C++ objects so that it can call __cxa_finalize with a unique argument.
extern "C" { [[gnu::visibility("hidden")]] void *__dso_handle; }
Expand All @@ -56,6 +57,7 @@ extern "C" { [[gnu::visibility("hidden")]] void *__dso_handle; }
// In normal programs this call to __cxa_finalize is provided by libgcc.
__cxa_finalize(&__dso_handle);
}
#endif

void __mlibc_do_finalize() {
// Invoke any handlers registered with atexit (NOT associated with a DSO).
Expand Down

0 comments on commit 0c766b5

Please sign in to comment.