From 08ab27506b1acf9a64e0c56f3ce267cf4c7af893 Mon Sep 17 00:00:00 2001 From: Sabareesh-Kumar-Anandan <59681634+Sabareesh-Kumar-Anandan@users.noreply.github.com> Date: Tue, 5 Jan 2021 01:58:32 +0530 Subject: [PATCH] [libyang1] Adding LFS support for arm32 (#6346) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the emulated armhf environment, the function readdir()returns NULL on a ext4 file system directory. When running the libyang1 test cases, it will require to load the plugins from the files (such as metadata.so), because the readdir() is failing, the plugins can’t be loaded in the emulated armhf environment, so it causes libyang1 test error. This error is a combination of the following reasons. • Emulation of a 32-bit target from a 64-bit host –> qemu from x86_64 to armhf • Glibc version > 2.27 – Debian buster is using glibc 2.28 - How I did it Enabled large file support by setting _FILE_OFFSET_BITS=64 for libyang1. Signed-off-by: Sabareesh Kumar Anandan --- src/libyang1/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libyang1/Makefile b/src/libyang1/Makefile index acdd686b79..da6359aa9e 100644 --- a/src/libyang1/Makefile +++ b/src/libyang1/Makefile @@ -28,6 +28,9 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : pushd libyang-$(LIBYANG1_VERSION) sed -i 's/set(LIBYANG_MAJOR_SOVERSION 1)/set(LIBYANG_MAJOR_SOVERSION 2)/' CMakeLists.txt sed -i 's/libyang1/libyang2/' debian/libyang1.install + # Enable large file support for 32-bit arch + echo 'add_definitions(-D_FILE_OFFSET_BITS=64)' >> CMakeLists.txt + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) popd