summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-11-01 21:11:48 +0100
committerLennart Poettering <lennart@poettering.net>2008-11-01 21:48:29 +0100
commit3bef1a94b4a757292f6077b9c93285f74210752f (patch)
treedf875afb34e12f4d9b0ce22356fd0fbca380a7cb
parent68e9a48bb96f195ee13a093d7741a658d89591a7 (diff)
Make sure libpulse never gets unloaded
When an .so is unloaded during runtime all TLS keys it has registered need to be freed because the destructor callbacks of the TLS key might otherwise point to invalid code. Hence it would appear sensible to destruct the TLS keys from a function marked as __attribute__ ((destructor)). However functions marked like that are also called when an application terminates, on exit(). If a thread continues to run until the very exit it might still want to access that TLS data. The destructor functions are called while all other threads are still running. If __attribute ((destructor)) is used to destruct TLS keys for such threads this might hence cause a crash when the application shuts down. To circumvent this problem we'll now compile libpulse with -z nodelete, to make it unnecessary to delete the TLS data ever and thus avoiding the problem. It's suboptimal, but for now I see no better solution.
-rw-r--r--src/Makefile.am2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index f2771980..a4e4944a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -66,7 +66,7 @@ AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS)
AM_LDADD = $(PTHREAD_LIBS) $(INTLLIBS)
# Only required on some platforms but defined for all to avoid errors
-AM_LDFLAGS = -Wl,-no-undefined -Wl,--gc-sections
+AM_LDFLAGS = -Wl,-no-undefined -Wl,--gc-sections -Wl,-z,nodelete
if STATIC_BINS
BINLDFLAGS = -static