From ceb261cb4281e0d76f76724a30bf7e61ef59bef1 Mon Sep 17 00:00:00 2001 From: Norbert Lange Date: Tue, 22 Feb 2022 11:22:10 +0100 Subject: [PATCH] package/zsh: enable static regex module the builtin string =~ regexp operator needs to load the regex module. This operator is used very often in zsh scripts, so link it statically to avoid the overhead of dynamic loading. Signed-off-by: Norbert Lange Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- package/zsh/zsh.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/zsh/zsh.mk b/package/zsh/zsh.mk index f03a2e6982..4897620a00 100644 --- a/package/zsh/zsh.mk +++ b/package/zsh/zsh.mk @@ -49,6 +49,12 @@ ZSH_CONF_OPTS += \ zsh_cv_sys_dynamic_strip_lib=yes endif +# regex is commonly used by completion scripts, link it statically +define ZSH_USE_STATIC_REGEX_MODULE + $(SED) 's,echo dynamic,echo static,' $(@D)/Src/Modules/regex.mdd +endef +ZSH_POST_PATCH_HOOKS += ZSH_USE_STATIC_REGEX_MODULE + # Add /bin/zsh to /etc/shells otherwise some login tools like dropbear # can reject the user connection. See man shells. define ZSH_ADD_ZSH_TO_SHELLS