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

termux_step_massage: check built libs for undefined symbols #9790

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

Grimler91
Copy link
Member

Building packages that use libtool for linking libraries has issues
with ndk-r23 (android/ndk#1614). This check
makes sure that the built libraries do not give an error like

CANNOT LINK EXECUTABLE "tesseract": cannot locate symbol "__extenddftf2" referenced by "/data/data/com.termux/files/usr/lib/libtesseract.so"...

once used on device. In android/ndk#1614 it
seemed like arm gave false positives and needed special consideration,
but when I tested it again today the same false positives do not occur
in built libraries, so no "if arm then .." workaround has been added
for now.

if ! readelf -h $lib &> /dev/null; then
continue
fi
if readelf -s $lib | grep "UND $sym" &> /dev/null; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regexp for this line could be improved:

egrep 'NOTYPE[[:space:]]+GLOBAL[[:space:]]+DEFAULT[[:space:]]+UND[[:space:]]+'$sym'$'

where NOTYPE is specified in order to avoid matching "leaked builtins" from other shared libraries, though I suppose they have all been purged now.

@Grimler91 Grimler91 force-pushed the ndk-r23-undefined-sym-check branch from bd1f66c to 9e84d66 Compare April 3, 2022 08:48
Building packages that use libtool for linking libraries has issues
with ndk-r23 (android/ndk#1614).  This check
makes sure that the built libraries do not give an error like

    CANNOT LINK EXECUTABLE "tesseract": cannot locate symbol "__extenddftf2" referenced by "/data/data/com.termux/files/usr/lib/libtesseract.so"...

once used on device.  In android/ndk#1614 it
seemed like arm gave false positives and needed special consideration,
but when I tested it again today the same false positives do not occur
in built libraries, so no "if arm then .." workaround has been added
for now.
@Grimler91 Grimler91 force-pushed the ndk-r23-undefined-sym-check branch from 9e84d66 to ffa1ed6 Compare April 5, 2022 18:58
@Grimler91 Grimler91 merged commit ffa1ed6 into master Apr 5, 2022
@Grimler91 Grimler91 deleted the ndk-r23-undefined-sym-check branch April 5, 2022 18:58
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.

2 participants