From 368cac3c9da3c3873d3afa65183e05c08d921e17 Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Sun, 21 Dec 2025 11:34:01 +0100 Subject: [PATCH] ImageRules: do not include catalogs from .so in dependencies The rule to add an executable or shared library to the Haiku image automatically also includes the corresponding locale catalogs and MIME database entries. The locale catalogs for .a files linked in the executable are also included, since .a files are not themselves added to the same package. This makes sure the executable has all the catalogs it needs. The jam rule was written assuming that NEEDLIBS would only contain .a files, but that is not the case when compiling Haiku. Libroot for example is also in NEEDLIBS (this makes sure it is linked by absolute file path, whereas LINKLIBS would instead use -lroot and may link the host system one). Filter out .so files from the NEEDLIBS list when determining which catalogs to include. Fixes #19721. Change-Id: I04604bd37c656f987dd17be8db6edffe88cee651 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10144 Reviewed-by: Adrien Destugues Tested-by: Commit checker robot --- build/jam/ImageRules | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/build/jam/ImageRules b/build/jam/ImageRules index 5bb656c5a2..d2934c520e 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -275,15 +275,19 @@ rule AddFilesToContainer container : directoryTokens : targets : destName # files, add those, too. local catalogTargets = $(target) + [ on $(target) return $(NEEDLIBS) ] ; for catalogTarget in $(catalogTargets) { - local catalogs - = [ on $(catalogTarget) return $(HAIKU_CATALOG_FILES) ] ; - if $(catalogs) { - local signature - = [ on $(catalogTarget) - return $(HAIKU_CATALOG_SIGNATURE) ] ; - AddFilesToContainer $(container) - : $(systemDirTokens) data locale catalogs $(signature) - : $(catalogs) ; + # NEEDLIBS may also contain .so files, ignore these. They will be added to the image + # separately + if $(catalogTarget:S) != .so { + local catalogs + = [ on $(catalogTarget) return $(HAIKU_CATALOG_FILES) ] ; + if $(catalogs) { + local signature + = [ on $(catalogTarget) + return $(HAIKU_CATALOG_SIGNATURE) ] ; + AddFilesToContainer $(container) + : $(systemDirTokens) data locale catalogs $(signature) + : $(catalogs) ; + } } }