Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: termux-elf-cleaner: Section header for 'usr/lib/x86_64-linux-android/27/libGLESv3.so' would end at 94808 but file size only 57344 #11847

Closed
diyism opened this issue Sep 8, 2022 · 4 comments
Labels
bug report Something is not working properly packaging Issue related to building packages, not affecting end users directly

Comments

@diyism
Copy link

diyism commented Sep 8, 2022

Problem description

I'm trying build-bootstraps.sh in docker, but it failed with error:
termux-elf-cleaner: Section header for 'usr/lib/x86_64-linux-android/27/libGLESv3.so' would end at 94808 but file size only 57344

I can't figure out what's wrong, any hint?

What steps will reproduce the bug?

$ git clone --depth 1 https://github.com/termux/termux-packages.git
$ cd termux-packages/scripts
$ ./update-docker.sh
Using default tag: latest
latest: Pulling from termux/package-builder
Digest: sha256:770243427bca3a361ba0de85aceaefbea2a3c1e1575a988584aa31fc7b0f0da3
Status: Image is up to date for ghcr.io/termux/package-builder:latest
ghcr.io/termux/package-builder:latest
Image 'ghcr.io/termux/package-builder' used in the container 'termux-package-builder' is already up to date

$ ./run-docker.sh
$ cd scripts
$ ./setup-android-sdk.sh
INFO: Using sdkmanager ... /home/builder/lib/android-sdk-8512546/cmdline-tools/bin/sdkmanager
INFO: Using NDK ... /home/builder/lib/android-ndk-r25
All SDK package licenses accepted.======] 100% Computing updates...             
[=======================================] 100% Computing updates...

$ ./build-bootstraps.sh -a aarch64
[*] Building 'apt'...
termux - building apt for arch aarch64...
Building dependency libandroid-support if necessary...
termux - building libandroid-support for arch aarch64...
Applying ndk-patch: bits-struct_file.h.patch
Applying ndk-patch: dirent.h.patch
Applying ndk-patch: grp.h.patch
Applying ndk-patch: langinfo.h.patch
Applying ndk-patch: linux-fcntl.h.patch
Applying ndk-patch: paths.h.patch
Applying ndk-patch: pwd.h.patch
Applying ndk-patch: redefine-TCSAFLUSH.patch
Applying ndk-patch: semaphore.h.patch
Applying ndk-patch: stdio.h.patch
Applying ndk-patch: stdlib.h.patch
Applying ndk-patch: sys-cdefs.h.patch
Applying ndk-patch: syslog.patch
Applying ndk-patch: unistd.h.patch
Applying ndk-patch: utmp.h.patch
termux-elf-cleaner: Section header for 'usr/lib/x86_64-linux-android/27/libGLESv3.so' would end at 94808 but file size only 57344
[*] Building 'apt' exited with exit code 1
Failed to build package 'apt' for arch 'aarch64'

What is the expected behavior?

No response

System information

$ uname -a
Linux kali 5.9.0-kali1-amd64 #1 SMP Debian 5.9.1-1kali2 (2020-10-29) x86_64 GNU/Linux
@diyism diyism added the bug report Something is not working properly label Sep 8, 2022
@Grimler91
Copy link
Member

Sounds like ~/lib/android-ndk might be corrupted or only half-extracted. Try

rm -rf ~/lib/android-ndk
./scripts/setup-android-sdk.sh

@sylirre
Copy link
Member

sylirre commented Sep 8, 2022

./setup-android-sdk.sh is not needed if using Docker image.

@diyism
Copy link
Author

diyism commented Sep 11, 2022

My fault, my docker container's default dev mapper size is too small (10GB),
the build-bootstraps.sh need about 30GB,
I have used

$ sudo dmsetup table "docker-0:27-6459859-4861929f8aab3624f45133b94ccf47654be7fbe9074be0cf729c54d00a90a324"
0 20971520 thin 254:1 44
$ echo 0 41943040 thin 254:1 44 | sudo dmsetup load "docker-0:27-6459859-4861929f8aab3624f45133b94ccf47654be7fbe9074be0cf729c54d00a90a324"
$ sudo dmsetup resume "docker-0:27-6459859-4861929f8aab3624f45133b94ccf47654be7fbe9074be0cf729c54d00a90a324"
$ sudo resize2fs "/dev/mapper/docker-0:27-6459859-4861929f8aab3624f45133b94ccf47654be7fbe9074be0cf729c54d00a90a324"

and expanded my docker container size,

then executed "export NDK=/home/builder/lib/android-ndk-r25/"

now the "./build-bootstraps.sh -a aarch64" can continue in my docker container,

but after about 2 hours compilation without an error, a new error happened:

[*] Building 'apt'...
apt@2.5.2-3 built - skipping (rm /data/data/.built-packages/apt to force rebuild)
[*] Building 'apt' exited with exit code 0



[*] Building 'bash'...
bash@5.1.16-1 built - skipping (rm /data/data/.built-packages/bash to force rebuild)
[*] Building 'bash' exited with exit code 0



[*] Building 'bzip2'...
ERROR: No package bzip2 found in any of the enabled repositories. Are you trying to set up a custom repository?
[*] Building 'bzip2' exited with exit code 1
Failed to build package 'bzip2' for arch 'aarch64'

$ ls -dl /home/builder/termux-packages/packages/libbz2
drwxr-xr-x 2 root root 4096 Sep 10 21:12 /home/builder/termux-packages/packages/libbz2

$ ls  /home/builder/termux-packages/packages/libbz2
build.sh  bzdiff.patch  bzip2.subpackage.sh  cross_compile.patch  shared_library.patch

I can't figure out what's wrong, any hint?

@truboxl
Copy link
Contributor

truboxl commented Sep 11, 2022

#10462

@truboxl truboxl closed this as completed Sep 11, 2022
@truboxl truboxl added the packaging Issue related to building packages, not affecting end users directly label Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly packaging Issue related to building packages, not affecting end users directly
Projects
None yet
Development

No branches or pull requests

4 participants