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

fix bionic-host build #21095

Closed
wants to merge 2 commits into from
Closed

Conversation

Grimler91
Copy link
Member

Replaces #20958

The one we downloaded previously no longer exists.
The repo script has been updated, and hence the hashsum has changed.
@TomJo2000
Copy link
Member

#### make completed successfully (14:31 (mm:ss)) ####

INFO: READELF=llvm-readelf ... /home/runner/.termux-build/_cache/android-r27-api-24-v0/bin/llvm-readelf
INFO: Generating undefined symbols regex to /tmp/tmp.5AzZrY8TDF
INFO: Done ... 0s
INFO: Total symbols 2365
INFO: Generating OpenMP symbols regex to /tmp/tmp.PSMRtng4UL
INFO: Done ... 0s
INFO: Total OpenMP symbols 2505
INFO: Identifying files with nproc=4
INFO: Done ... 0s
INFO: Found 31 / 34 files
INFO: Running symbol checks on 31 files with nproc=4
INFO: Done ... 11s
INFO: Found files with undefined symbols
INFO: Showing result
ERROR: ./opt/bionic-host/lib/ld-android.so contains undefined symbols:
     1: 00000000     0 NOTYPE  GLOBAL DEFAULT   UND __cxa_finalize
     2: 00000000     0 NOTYPE  GLOBAL DEFAULT   UND __cxa_atexit
     3: 00000000     0 NOTYPE  GLOBAL DEFAULT   UND __register_atfork
ERROR: ./opt/bionic-host/lib/libdl.so contains undefined symbols:
     1: 00000000     0 NOTYPE  GLOBAL DEFAULT   UND __cxa_finalize
     2: 00000000     0 NOTYPE  GLOBAL DEFAULT   UND __cxa_atexit
     3: 00000000     0 NOTYPE  GLOBAL DEFAULT   UND __register_atfork
    24: 00000000     0 NOTYPE  GLOBAL DEFAULT   UND abort
    25: 00000000     0 NOTYPE  GLOBAL DEFAULT   UND memcpy
ERROR: ./opt/bionic-host/lib64/ld-android.so contains undefined symbols:
     1: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND __cxa_finalize
     2: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND __register_atfork
     3: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND __cxa_atexit
ERROR: ./opt/bionic-host/lib64/libdl.so contains undefined symbols:
     1: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND __cxa_finalize
     2: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND __register_atfork
     3: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND __cxa_atexit
INFO: Done ... 7s
INFO: Found 4 files with undefined symbols after exclusion
ERROR: Refer above
Error: Process completed with exit code 1.

Looks like some library isn't getting linked.

@twaik
Copy link
Member

twaik commented Oct 15, 2024

Maybe we should just omit the undefined symbols checking? Building is controlled by AOSP building system, I do not think we should make sure everything is fine.
Also there is another way to obtain ubuntu packages directly from repos, without guessing package names and their urls.

# Function to obtain the .deb URL
obtain_deb_url() {
local url="https://packages.ubuntu.com/noble/amd64/$1/download"
local retries=5
local wait=5
local attempt
local deb_url
for ((attempt=1; attempt<=retries; attempt++)); do
local PAGE="$(curl -s "$url")"
>&2 echo page
>&2 echo "$PAGE"
if deb_url=$(echo "$PAGE" | grep -Eo 'http://.*\.deb' | head -n 1); then
if [[ -n "$deb_url" ]]; then
echo "$deb_url"
return 0
else
# deb_url is empty or server answered with `internal server error`, retry
>&2 echo "Attempt $attempt: Received empty URL or server answered with `Internal server error` page. Retrying in $wait seconds..."
fi
else
# The command failed, retry
>&2 echo "Attempt $attempt: Command failed. Retrying in $wait seconds..."
fi
sleep "$wait"
done
# Failed after retries, output error to stderr and exit with code 1
>&2 echo "Failed to obtain URL after $retries attempts."
exit 1
}
termux_step_host_build() {
termux_setup_cmake
termux_setup_ninja
( # Running build in a subshell to avoid variable mess
# We must build the `image-compiler` for building.
# See https://github.com/audacity/audacity/blob/Audacity-3.6.4/BUILDING.md#selecting-target-architecture-on-macos
_PREFIX="$TERMUX_PKG_HOSTBUILD_DIR/prefix"
# Building both gtk2.0 and alsa only for building host-side tool seems to be excessive.
# Let's download them from ubuntu repos.
# To avoid messing with `apt update` and `apt download` we will get download links directly from ubuntu servers.
mkdir "$_PREFIX"
for i in libgtk2.0-0t64 libgtk2.0-dev libasound2-dev; do
wget "$(obtain_deb_url $i)" -O "$TERMUX_PKG_HOSTBUILD_DIR/tmp.deb"
dpkg-deb -R "$TERMUX_PKG_HOSTBUILD_DIR/tmp.deb" "$TERMUX_PKG_HOSTBUILD_DIR/tmp"
cp -rf "$TERMUX_PKG_HOSTBUILD_DIR"/tmp/* "$_PREFIX"
rm -rf "$TERMUX_PKG_HOSTBUILD_DIR/tmp.deb" "$TERMUX_PKG_HOSTBUILD_DIR/tmp"
unset _URL
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants