summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-10-09 16:02:55 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-10-11 11:10:37 +0200
commita5d8835c78112206bbf0812dd4cb471f803bfe88 (patch)
treef42a5d79e0d5b0357def1891b3b8dc8aa43feb0d /src/libsystemd
parent7c48ea02800782651b7da373c6165abb052f1382 (diff)
downloadsystemd-a5d8835c78112206bbf0812dd4cb471f803bfe88.tar.gz
mempool: only enable mempool use when linked to libsystemd-shared.so
Mempool use is enabled or disabled based on the mempool_use_allowed symbol that is linked in. Should fix assert crashes in external programs caused by #9792. Replaces #10286. v2: - use two different source files instead of a gcc constructor
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/disable-mempool.c5
-rw-r--r--src/libsystemd/meson.build2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libsystemd/disable-mempool.c b/src/libsystemd/disable-mempool.c
new file mode 100644
index 0000000000..034bd24dc4
--- /dev/null
+++ b/src/libsystemd/disable-mempool.c
@@ -0,0 +1,5 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+
+#include "mempool.h"
+
+const bool mempool_use_allowed = false;
diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build
index e3716a68d8..d95406e7ac 100644
--- a/src/libsystemd/meson.build
+++ b/src/libsystemd/meson.build
@@ -81,6 +81,8 @@ libsystemd_sources = files('''
sd-utf8/sd-utf8.c
'''.split()) + id128_sources + sd_daemon_c + sd_event_c + sd_login_c
+disable_mempool_c = files('disable-mempool.c')
+
libsystemd_c_args = ['-fvisibility=default']
libsystemd_static = static_library(