gettext-full: link to local libxml2
authorMichael Pratt <mcpratt@pm.me>
Sun, 16 Apr 2023 15:04:31 +0000 (11:04 -0400)
committerChristian Marangi <ansuelsmth@gmail.com>
Thu, 4 May 2023 04:07:30 +0000 (06:07 +0200)
Some users have reported that gettext builds
are attempting to link to libxml2
while it was supposed to be configured
to use it's own built-in substitute.

Configure gettext to require and link
to our local libxml2 explicitly.

Add a patch to revert upstream commit 87927a4e2
which forces libtextstyle to use the built-in libxml,
no matter what the configuration is,
making that option configurable again
after the configure script is regenerated.

Reported-by: Tianling Shen <cnsztl@immortalwrt.org>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
package/libs/gettext-full/Makefile
package/libs/gettext-full/patches/100-libxml-no-force-included.patch [new file with mode: 0644]
package/libs/gettext-full/patches/150-disable_libxml_iconv.patch [deleted file]

index 440cff13412db47b940d272d213d00c729e284b5..a92932f3759ba0f2c68f468b2ad96ee43da78c8b 100644 (file)
@@ -23,10 +23,10 @@ PKG_CPE_ID:=cpe:/a:gnu:gettext
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
-PKG_BUILD_DEPENDS:=gettext-full/host
+PKG_BUILD_DEPENDS:=gettext-full/host libxml2
 PKG_BUILD_PARALLEL:=0
 
-HOST_BUILD_DEPENDS:=gperf/host
+HOST_BUILD_DEPENDS:=gperf/host libxml2/host
 HOST_BUILD_PARALLEL:=0
 
 PKG_SUBDIRS:= \
@@ -86,6 +86,7 @@ CONFIGURE_ARGS += \
        --with-included-gettext \
        --without-libintl-prefix \
        --without-libexpat-prefix \
+       --with-libxml2-prefix=$(STAGING_DIR) \
        --without-emacs
 
 HOST_CONFIGURE_ARGS += \
@@ -96,7 +97,7 @@ HOST_CONFIGURE_ARGS += \
        --disable-java \
        --disable-openmp \
        --without-emacs \
-       --without-libxml2-prefix
+       --with-libxml2-prefix=$(STAGING_DIR_HOSTPKG)
 
 HOST_CONFIGURE_VARS += \
        EMACS="no" \
diff --git a/package/libs/gettext-full/patches/100-libxml-no-force-included.patch b/package/libs/gettext-full/patches/100-libxml-no-force-included.patch
new file mode 100644 (file)
index 0000000..af5c0a4
--- /dev/null
@@ -0,0 +1,31 @@
+--- a/libtextstyle/gnulib-local/modules/libxml.diff
++++ /dev/null
+@@ -1,28 +0,0 @@
+-*** libxml.orig       2018-10-28 14:37:07.007164889 +0100
+---- libxml    2019-02-14 22:19:29.994771110 +0100
+-***************
+-*** 118,124 ****
+-  fabs
+-  
+-  configure.ac:
+-! gl_LIBXML
+-  
+-  Makefile.am:
+-  if INCLUDED_LIBXML
+---- 118,133 ----
+-  fabs
+-  
+-  configure.ac:
+-! # In libtextstyle, we don't want to use an external libxml, because its
+-! # dependencies and their dynamic relocations have an impact on the startup
+-! # time of a program that is linked with it. As you can see by using
+-! # 'readelf -r ... | wc -l' and 'readelf -d ... | grep NEEDED':
+-! # - libxml2.so has more than 3300 relocations and depends on libicuuc.
+-! #   - libicuuc.so has more than 4900 relocations and depends on libstdc++.
+-! #     - libstdc++.so has more than 4600 relocations.
+-! # These are more than 12800 relocations, to perform at program startup.
+-! # So, force the use of the included libxml part.
+-! gl_LIBXML([yes])
+-  
+-  Makefile.am:
+-  if INCLUDED_LIBXML
diff --git a/package/libs/gettext-full/patches/150-disable_libxml_iconv.patch b/package/libs/gettext-full/patches/150-disable_libxml_iconv.patch
deleted file mode 100644 (file)
index bf60ecb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/gettext-tools/gnulib-lib/libxml/xmlversion.in.h
-+++ b/gettext-tools/gnulib-lib/libxml/xmlversion.in.h
-@@ -302,7 +302,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(i
-  *
-  * Whether iconv support is available
-  */
--#if 1
-+#if 0
- #define LIBXML_ICONV_ENABLED
- #endif
---- a/gnulib-local/lib/libxml/xmlversion.in.h
-+++ b/gnulib-local/lib/libxml/xmlversion.in.h
-@@ -302,7 +302,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(i
-  *
-  * Whether iconv support is available
-  */
--#if 1
-+#if 0
- #define LIBXML_ICONV_ENABLED
- #endif