-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Labels
bug reportSomething is not working properlySomething is not working properlypackagingIssue related to building packages, not affecting end users directlyIssue related to building packages, not affecting end users directly
Description
Problem description
Building libxml2 2.15.0 in the Termux builder (aarch64) fails at the tests stage when linking runtest:
ld.lld: error: undefined symbol: glob
ld.lld: error: undefined symbol: globfree
clang: error: linker command failed with exit code 1
On Android, glob(3)/globfree(3) are provided by libandroid-glob, not bionic. With Python bindings/tests enabled, the runtest executable needs to link against -landroid-glob.
Minimal fix that works in practice (recipe-only):
- Add
libandroid-globtoTERMUX_PKG_DEPENDS - Add
LDFLAGS+=" -landroid-glob"insidetermux_step_configure()
This is sufficient because the current build path propagates LDFLAGS to test linking.
Patch (unified diff):
--- a/packages/libxml2/build.sh
+++ b/packages/libxml2/build.sh
@@
-TERMUX_PKG_DEPENDS="libiconv, libicu, zlib"
+TERMUX_PKG_DEPENDS="libiconv, libicu, zlib, libandroid-glob"
@@
termux_step_configure() {
+ # Ensure glob/globfree resolve on Android tests
+ LDFLAGS+=" -landroid-glob"
mkdir -p "$TERMUX_PKG_BUILDDIR/python/doc/xml"
export TERMUX_MESON_ENABLE_SOVERSION=1
termux_step_configure_meson
}Notes:
- The
_XOPEN_SOURCE(600 vs 700) warnings are benign and unrelated. - If some environments don’t propagate global
LDFLAGSto tests, a target-scoped link arg forruntestinsrc/meson.buildwould also work, but the above minimal change fixes the issue in the current builder.
What steps will reproduce the bug?
-
(Optional) clean caches/markers:
rm -rf ~/.termux-build/libxml2* ~/.termux-build/python-libxml2* rm -f /data/data/.built-packages/libxml2 /data/data/.built-packages/python-libxml2
-
Build:
./build-package.sh -a aarch64 libxml2
-
Observe link error for
runtest:ld.lld: error: undefined symbol: glob ld.lld: error: undefined symbol: globfree
What is the expected behavior?
libxml2builds successfully on Android, including tests (or tests link without undefined symbols).- No undefined references to
glob/globfreeduringruntestlink.
System information
If reproduced **on device**, paste the output of:
termux-info
If reproduced **only in the Termux package builder**, indicate that here, e.g.:
Not running on device; reproduced in package builder container.
Builder image: ghcr.io/termux/package-builder
Arch: aarch64
Package: libxml2 2.15.0
Python: 3.12 (TERMUX_PKG_SETUP_PYTHON=true; -Dpython=enabled)
Command: ./build-package.sh -a aarch64 libxml2Metadata
Metadata
Assignees
Labels
bug reportSomething is not working properlySomething is not working properlypackagingIssue related to building packages, not affecting end users directlyIssue related to building packages, not affecting end users directly