-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
android-5.xIssue happens on devices running Android 5.xIssue happens on devices running Android 5.xbug reportSomething is not working properlySomething is not working properly
Description
Problem description
Clang produces strange linking errors when trying to link readline program.
$ clang test.c -lreadline
/data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libreadline.so: undefined reference to `strtol@LIBC'
/data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libreadline.so: undefined reference to `fwrite@LIBC'
/data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libreadline.so: undefined reference to `longjmp@LIBC'
/data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/lib/libreadline.so: undefined reference to `__errno@LIBC'
<some lines skipped>
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
Steps to reproduce
-
Make sure your device running Android OS v5.x (just android-5 packages isn't enough).
-
Put following content to test.c:
#include <stdio.h>
#include <stdlib.h>
#include <readline/readline.h>
#include <readline/history.h>
int main(int argc, char** argv)
{
char* buf;
while ((buf = readline("$ ")) != NULL) {
if (strlen(buf) > 0) {
add_history(buf);
}
printf("echo [%s]\n", buf);
free(buf);
}
return 0;
}
clang test.c -lreadline
Expected behavior
Program should be compiled successfully.
Additional information
Updatable packages:
All packages up to date
Subscribed repositories:
https://dl.bintray.com/grimler/science-packages-21 science/stable
https://dl.bintray.com/grimler/game-packages-21 games/stable
https://termux.net stable/main
https://termux.net stable/main
System information:
Linux localhost 3.1.10-gf5d7b8b #1 SMP PREEMPT Thu Jan 8 04:50:16 UTC 2015 armv7l Android
Termux-packages arch:
arm
Android version:
5.1.1
Device manufacturer:
asus
Device model:
Nexus 7
Initially issue was reported on mailing list.
ikarus23 and kribakarans
Metadata
Metadata
Assignees
Labels
android-5.xIssue happens on devices running Android 5.xIssue happens on devices running Android 5.xbug reportSomething is not working properlySomething is not working properly