-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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]: Several configure&make packages give binaries with cannot locate symbol "__extendsftf2"
#8029
Comments
I see now that th e symbol is slightly different, extenddftf2 vs extendsftf2. On arm we do not seem to have this problem, compiling graphviz 2.49.3 for arm gives a fully working package |
I guess this issue is also reproducible on x86_64, did you try in emulator? From NDK changelog
The symbols which you refrenced, I could find in libgcc's source code and also in libcompiler-rt's, So I guess this is an upstream issue and will be likely fixed in future NDK versions Further investigation,
Whereas,
Our libcompiler-rt has the symbols but NDK's doesn't, so probably we need to report this upstream. Also, I wonder why build with Cmake succeeds while with autotools, it gives this error. This is worth investigating. |
Official NDK bindist also has those symbols:
|
One possibility is that some shared library that is used when |
Do you know of a way to check the status of the symbol? On aarch64 we have
but on arm extendsftf2 isn't used at all (it isn't referenced in either I tried adding |
If we or someone else report the issue, then probably yes :)
Would be nice to have a smaller code example that reproduces the issue when reporting in any case
It is pretty exciting :) |
The NDK toolchain by default makes links against
I use
As for a resulted executable or shared library, when compiler-rt is correctly used, we will see:
whereas for a case something is wrong, we will see
Symbols that are
These builtins are arch-specific. It is just that
A possible workaround would be to include |
Yep, that could be it. Another possibility is that in switching to the completely binutils-free toolchain in NDK 23, A good way to debug would be to check out the last commit of this repo before the NDK 23 pull was merged and build a now-broken package like graphviz with NDK 21d instead, extracting the working linker command it puts out for |
Building with ndk r21 gvpack works, we have
I guess it is the link command for libgvplugin_neato_layout.so that is interesting, since the missing symbol is there. Stuff below is with CC="<..>-clang --verbose" CXX="<..>-clang++ --verbose", maybe I need to add --verbose to LD as well (testing now) Diff between r21 and r23 is: $ diff -u graphviz_ndk-r21.link graphviz_ndk-r23.link
--- graphviz_ndk-r21.link 2021-11-23 12:09:16.950560583 +0100
+++ graphviz_ndk-r23.link 2021-11-23 12:09:13.713886886 +0100
@@ -4,7 +4,7 @@
-DPIC \
-shared \
-nostdlib \
-/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtbegin_so.o \
+/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtbegin_so.o \
.libs/gvplugin_neato_layout.o \
.libs/gvlayout_neato_layout.o \
-Wl,--whole-archive \
@@ -28,19 +28,17 @@
../../lib/cgraph/.libs/libcgraph.so \
../../lib/cdt/.libs/libcdt.so \
../../lib/pathplan/.libs/libpathplan.so \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/lib64/clang/9.0.8/lib/linux/aarch64 \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib/../lib64 \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android/24 \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/lib64/clang/12.0.8/lib/linux/aarch64 \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../lib/gcc/aarch64-linux-android/4.9.x \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android/24 \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib \
-lc++ \
-lm \
-lc \
--lgcc \
+-l:libunwind.a \
-ldl \
-/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtend_so.o \
+/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtend_so.o \
-fstack-protector-strong \
-Oz \
-Wl,-rpath=/data/data/com.termux/files/usr/lib \ Full command with r23
Full config.log and build logs for r21 and r23 are attached: |
Discard previous comment, here is the full link command: Diff: --- neato_layout_verbose_r21.log 2021-11-23 13:40:37.521566069 +0100
+++ neato_layout_verbose_r23.log 2021-11-23 13:41:09.604802803 +0100
@@ -1,4 +1,4 @@
-"/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld" \
+"/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/ld" \
-z \
noexecstack \
-EL \
@@ -11,29 +11,28 @@
-z \
max-page-size=4096 \
--hash-style=gnu \
---hash-style=both \
--enable-new-dtags \
--eh-frame-hdr \
-m \
aarch64linux \
-shared \
-o .libs/libgvplugin_neato_layout.so \
+-L/home/builder/.termux-build/graphviz/src/lib/gvc/.libs \
+-L/home/builder/.termux-build/graphviz/src/lib/cgraph/.libs \
+-L/home/builder/.termux-build/graphviz/src/lib/cdt/.libs \
+-L/home/builder/.termux-build/graphviz/src/lib/pathplan/.libs \
-L/data/data/com.termux/files/usr/lib \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/lib64/clang/9.0.8/lib/linux/aarch64 \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib/../lib64 \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android/24 \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/lib64/clang/9.0.8/lib/linux/aarch64 \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib/../lib64 \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android/24 \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib \
--L/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib \
-/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtbegin_so.o \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/lib64/clang/12.0.8/lib/linux/aarch64 \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../lib/gcc/aarch64-linux-android/4.9.x \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android/24 \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/lib64/clang/12.0.8/lib/linux/aarch64 \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../lib/gcc/aarch64-linux-android/4.9.x \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android/24 \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android \
+-L/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib \
+/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtbegin_so.o \
.libs/gvplugin_neato_layout.o \
.libs/gvlayout_neato_layout.o \
--whole-archive \
@@ -48,16 +47,16 @@
../../lib/sfdpgen/.libs/libsfdpgen_C.a \
../../lib/vpsc/.libs/libvpsc_C.a \
--no-whole-archive \
--lgvc \
--lcgraph \
--lcdt \
--lpathplan \
+../../lib/gvc/.libs/libgvc.so \
+../../lib/cgraph/.libs/libcgraph.so \
+../../lib/cdt/.libs/libcdt.so \
+../../lib/pathplan/.libs/libpathplan.so \
-lc++ \
-lm \
-lc \
--lgcc \
+-l:libunwind.a \
-ldl \
-/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtend_so.o \
+/home/builder/.termux-build/_cache/android-r23b-api-24-v2/bin/../sysroot/usr/lib/aarch64-linux-android/24/crtend_so.o \
-rpath=/data/data/com.termux/files/usr/lib \
--enable-new-dtags \
--as-needed \ Most suspicious is probably the missing Full command with r23
Full build log and config.log: |
I guess builtins library is not linked against because |
Seems to be more than 20-year-old bug(?) in libtool: https://gcc.gnu.org/legacy-ml/gcc/2001-09/msg00262.html |
Yeah, that's the problem: libtool supplying all the link flags to the compiler and overriding the runtime library the compiler chooses with |
This may work: termux_step_pre_configure() {
LDFLAGS+=" $($CC -print-libgcc-file-name)"
} |
@buttaface @xtkoba thanks, In any case, I'll create a minimal example and open an issue with the ndk to see what the best solution would be, and for what arches we might need it. |
Getting the same error when |
@alensiljak Similar but different: build failure (the Rust/Cargo case) vs. runtime error (discussed here; which is nastier). FWIW, we already have a workaround for the Rust/Cargo case:
|
Tried to build Anki for Termux on android using recently added packages pyqt5 and pyqtwebwngine. Getting following errors
|
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Converted to tracker. Keeping open until at least well documented in other places. Only for libtool + C++ + shared lib. Workaround already provided. |
Should we keep this issue opened or we should close it in prior to #21130? |
Since there is no activity I am closing this. |
The above workaround produces warning with libtool/autotools. Please try to use the workaround from this pull request. |
Problem description
After the ndk-r23 update several configure&make packages seem to give binaries that can have issues like
We saw it first for tesseract, where the workaround was to switch to building with cmake instead of configure and make. Updating graphviz gives a package with the same issue in some of the binaries.
Same workaround might work for graphviz as well, there is an CMakeLists.txt available, but since multiple packages have this problem there are probably other packages where this is not an option.
A minimal code example using
static_cast<long double>()
(which clang turns into exteddftf2) does not have any issues when (cross-)compiled. I can try see if a minimal example with a configure script and Makefile gives the issue.What steps will reproduce the bug?
Build and install graphviz 2.49.3 and try to run for example
gvpack
on device.What is the expected behavior?
gvpack, and other programs, should execute without an undefined symbol error.
System information
Just tested on aarch64 so far:
termux-info:
The text was updated successfully, but these errors were encountered: