Termux-packages: Packages cannot locate symbol "iconv_open" (or "libiconv_open")

Created on 22 May 2019  Â·  23Comments  Â·  Source: termux/termux-packages

Problem description

While working a in a Termux session I kept receiving CANNOT LINK [...] errors for most commands or depending libs.

I remember that I installed _parallel_ before the errors started. There was another error or warning message in stdout of the _parallel_ installation, which I did not inspect (or log or remember) in detail.

After exiting the session I am getting following error immediately upon start of a new Termux session:

CANNOT LINK EXECUTABLE "cat": cannot locate symbol "iconv_open" referenced by "/data/data/com.termux/files/usr/bin/coreutils"...
Aborted
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/usr/bin/bash": cannot locate symbol "iconv_close" referenced by "/data/data/com.termux/files/usr/bin/bash"...

[Process completed (signal 6) - press Enter]

Steps to reproduce

Now every time when I try to start Termux, it immediately throws this error at me and stops. Nothing I could do in that Termux session except closing it.

Additional information

am using a Lenovo YB1-X90L with Android 7.1.1. (not rootet) and a pretty recent Termux.

Most helpful comment

Downgraded my tablet from Android 6 to 5.1, now I have same issue with mpv...
LD_PRELOAD will not work with mpv because it will be reset: $PREFIX/bin/mpv is a wrapper script:

#!/data/data/com.termux/files/usr/bin/sh
export LD_PRELOAD=/data/data/com.termux/files/usr/lib/libavcodec.so:/data/data/com.termux/files/usr/lib/libavfilter.so:/data/data/com.termux/files/usr/lib/libavformat.so:/data/data/com.termux/files/usr/lib/libavutil.so:/data/data/com.termux/files/usr/lib/libpostproc.so:/data/data/com.termux/files/usr/lib/libswresample.so:/data/data/com.termux/files/usr/lib/libswscale.so
LD_LIBRARY_PATH=/system/lib:/system/vendor/lib:/data/data/com.termux/files/usr/lib exec /data/data/com.termux/files/usr/libexec/mpv "$@"

And it seems that it works on Android 6 because of a bit different linker.

All 23 comments

Same problem on start "mc" application.

  • OnePlus 3 (Android 9.0.2)

You need to update packages.

Normally this is done by running pkg up, but if your Termux environment is so broken so that cannot be run the easiest way is to uninstall the Termux app completely and then reinstall it.

Note that you will loose the content of your $HOME directory when uninstalling. If this is a problem you need to look into failsafe sessions (long press on the Termux icon to get the Failsafe shortcut).

If CANNOT LINK EXECUTABLE DEPENDENCIES: "/data/data/com.termux/files/usr/lib/libtermux-exec.so" is 32-bit instead of 64-bit HOW TO FIX IT?

Something looks fishy for me.
Android 5 branch packages are up to date here, including
https://github.com/termux/termux-packages/commit/ce9473fdca11bcaa11adc6340118768e969d8792
For mc (no other broken stuff noticed) I'm getting:
CANNOT LINK EXECUTABLE: cannot locate symbol "libiconv_open" referenced by "/data/data/com.termux/files/usr/lib/libglib-2.0.so"...
page record for 0xb6e5e02c was not found (block_size=16)
Something broken (just) here? Another issue (opening sparete bug needed)?

Commit https://github.com/termux/termux-packages/commit/ce9473fdca11bcaa11adc6340118768e969d8792 has no relation to the issue.

Do export LD_PRELOAD=$PREFIX/lib/libiconv.so for temporary workaround until glib will be fixed.

Getting a similar error when attempting to run mpv:

CANNOT LINK EXECUTABLE: cannot locate symbol "libiconv_open" referenced by "/data/data/com.termux/files/usr/libexec/mpv"…

Error message remains the same after attempting @xeffyr 's workaround. It has had no effect.

It has had no effect.

It may not have effect for whatever reason:

  • You don't have upgraded packages.
  • You doing it wrong.
  • Workaround was proposed to fix mc but not mpv. Though it should work for mpv too.
  • This workaround works only per session, it is not persistent.

Also, if your packages are up to date, mpv will work fine without any workaround:

$ mpv
mpv 0.29.1 Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
 built on Mon May 20 23:36:05 UTC 2019
ffmpeg library versions:
   libavutil       56.22.100
   libavcodec      58.35.100
   libavformat     58.20.100
   libswscale      5.3.100
   libavfilter     7.40.101
   libswresample   3.3.100
ffmpeg version: 4.1.3

Usage:   mpv [options] [url|path/]filename

Basic options:
 --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
 --no-audio        do not play sound
 --no-video        do not play video
 --fs              fullscreen playback
 --sub-file=<file> specify subtitle file to use
 --playlist=<file> specify playlist file

 --list-options    list all mpv options
 --h=<string>      print options which contain the given string in their name

Do export LD_PRELOAD=$PREFIX/lib/libiconv.so for temporary workaround until glib will be fixed.

Works.
Now mc seems fine with latest glib update.

I am getting this error on Android 5.1.1, packages are updated:

/data/data/com.termux/files/home > xclock
CANNOT LINK EXECUTABLE: cannot locate symbol "iconv_open" referenced by "xclock"...

I have tried:

export LD_PRELOAD=$PREFIX/lib/libiconv.so

You don't have upgraded packages.

Ran pkg up all throughout yesterday and today and reset Termux to a fresh install. No change.

You doing it wrong.

You mean other than copying and pasting into a terminal? You right… instructions not clear; dick got stuck in github trying to execute it.

Workaround was proposed to fix mc but not mpv. Though it should work for mpv too.

That much I already understood.

This workaround works only per session, it is not persistent.

I'm not a well-seasoned coder by any means, but I know how environment variables work, neighbor.

Also, if your packages are up to date, mpv will work fine without any workaround

Gads. This is the equivalent of "try turning it off and on." mpv --version won't pull up anything – because of the same error message I've already mentioned – but here this is what pkg shows:

$pkg show mpv
Package: mpv
Version: 0.29.1-3
Maintainer: Fredrik Fornwall @fornwall
Installed-Size: 1294 kB
Depends: libiconv, ffmpeg, openal-soft, libandroid-support, libandroid-glob, liblua52, libpulseaudio
Homepage: https://mpv.io/
Download-Size: 612 kB
APT-Manual-Installed: yes
APT-Sources: https://termux.net stable/main arm Packages
Description: Command-line media player

@john-x what's your output of termux-info?

$termux-info
Updatable packages:
All packages up to date
Subscribed repositories:
https://termux.net stable/main
https://termux.net stable/main
System information:
Linux localhost 3.10.49-ge7aac37 #1 SMP PREEMPT Wed Feb 3 16:37:37 CST 2016 armv7l Android
Termux-packages arch:
arm
Android version:
5.1
Device manufacturer:
motorola
Device model:
XT1526

Here is my `printenv' output too:

$printenv
SHELL=/data/data/com.termux/files/usr/bin/bash
PREFIX=/data/data/com.termux/files/usr
PWD=/data/data/com.termux/files/home
EXTERNAL_STORAGE=/storage/emulated/legacy
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libiconv.so
HOME=/data/data/com.termux/files/home
LANG=en_US.UTF-8
TMPDIR=/data/data/com.termux/files/usr/tmp
ANDROID_DATA=/data
TERM=xterm-256color
SHLVL=1
ANDROID_ROOT=/system
LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib
PATH=/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets:/data/data/com.termux/files/usr/local/bin
_=/data/data/com.termux/files/usr/bin/applets/printenv

What is output of strings /data/data/com.termux/files/usr/lib/libiconv.so | grep iconv_open ?
Just really strange that ld_preload'ing libiconv is not working for you.

libiconv_open_into

Downgraded my tablet from Android 6 to 5.1, now I have same issue with mpv...
LD_PRELOAD will not work with mpv because it will be reset: $PREFIX/bin/mpv is a wrapper script:

#!/data/data/com.termux/files/usr/bin/sh
export LD_PRELOAD=/data/data/com.termux/files/usr/lib/libavcodec.so:/data/data/com.termux/files/usr/lib/libavfilter.so:/data/data/com.termux/files/usr/lib/libavformat.so:/data/data/com.termux/files/usr/lib/libavutil.so:/data/data/com.termux/files/usr/lib/libpostproc.so:/data/data/com.termux/files/usr/lib/libswresample.so:/data/data/com.termux/files/usr/lib/libswscale.so
LD_LIBRARY_PATH=/system/lib:/system/vendor/lib:/data/data/com.termux/files/usr/lib exec /data/data/com.termux/files/usr/libexec/mpv "$@"

And it seems that it works on Android 6 because of a bit different linker.

And it seems that it works on Android 6 because of a bit different linker.

Looks like. No problems with mpv on Android 6 here.

That fixed it! Thank you!
Also, I think I owe you an apology, @xeffyr. I'm sorry for being short tempered. I was having a bad day and it was driving me crazy trying to troubleshoot the problem on my own. Thank you for taking time out of your day to maintain these packages and for your help. God bless.

I have binutils installed but no 'strings' command ...

strings /data/data/com.termux/files/usr/lib/libiconv.so | grep iconv_open
strings-GNU: command not found

I have binutils installed but no 'strings' command ...

  • Why you are executing this ?

  • By looking on your output (strings-GNU: command not found) I can only say that you have something wrong with your installation. There no command strings-GNU available but only strings. Messing with aliases ?

And this issue should be solved as not so many packages were affected and they were fixed yesterday.

./startfluxbox.sh
/data/data/com.termux/files/home > CANNOT LINK EXECUTABLE: cannot locate symbol "iconv_open" referenced by "fluxbox"...

X11 packages will be fixed later since they are not part of main package set.


Workaround:

export LD_PRELOAD=libandroid-support.so
Was this page helpful?
0 / 5 - 0 ratings

Related issues

StephanBeer picture StephanBeer  Â·  3Comments

newmania picture newmania  Â·  3Comments

Zuccace picture Zuccace  Â·  3Comments

thurask picture thurask  Â·  3Comments

ILadis picture ILadis  Â·  3Comments