diff mbox series

[meta-selinux,wrynose] libselinux: Reduce memory needed in libselinux

Message ID 20260807130455.421587-1-yannik.tannhaeuser@gmail.com
State New
Headers show
Series [meta-selinux,wrynose] libselinux: Reduce memory needed in libselinux | expand

Commit Message

Yannik Tannhaeuser Aug. 7, 2026, 1:04 p.m. UTC
libselinux has a dependency to libpcre2, which seems
to require more memory. Use the introduced AGGRESSIVE_FREE_AFTER_REGEX_MATCH
preprocessor ifndef to have reduced memory usage in libselinux itself.

The workaround with AGGRESSIVE_FREE_AFTER_REGEX_MATCH was introduced
to libselinux with the following commit:
https://github.com/SELinuxProject/selinux/commit/30b3e9d25f417cf62f0d87d2c516c34555b28b32

Signed-off-by: Yannik Tannhaeuser <yannik.tannhaeuser@gmail.com>
---
 recipes-security/selinux/libselinux_3.10.bb | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/recipes-security/selinux/libselinux_3.10.bb b/recipes-security/selinux/libselinux_3.10.bb
index 86c9168..24956ae 100644
--- a/recipes-security/selinux/libselinux_3.10.bb
+++ b/recipes-security/selinux/libselinux_3.10.bb
@@ -28,6 +28,8 @@  def get_policyconfigarch(d):
 EXTRA_OEMAKE = "${@get_policyconfigarch(d)}"
 EXTRA_OEMAKE:append:libc-musl = " FTS_LDLIBS=-lfts"
 
+CFLAGS:append = " -DAGGRESSIVE_FREE_AFTER_REGEX_MATCH"
+
 # LTO fat objects in static library embed original source paths in .gnu.lto_* IR
 # sections which are not affected by -ffile-prefix-map, causing buildpaths QA failure
 LTO = ""