[libyang1] Adding LFS support for arm32 (#6346)

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 <sanandan@marvell.com>
This commit is contained in:
Sabareesh-Kumar-Anandan 2021-01-05 01:58:32 +05:30 committed by GitHub
parent 9e57f5157e
commit d6b92da643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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