CCExtractor / rusty_ffmpeg

FFI bindings for FFmpeg inner libraries.

Home Page:https://crates.io/crates/rusty_ffmpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] `libstdc++` error on Termux

alexmozaidze opened this issue · comments

When trying to compile rusty_ffmpeg with link_system_ffmpeg on Termux, I couldn't, due to the following error:

Compiling rusty_ffmpeg v0.13.1+ffmpeg.6.0
error: failed to add native library /data/data/com.termux/files/usr/lib/libstdc++.a: file too small to be an archive

error: could not compile `rusty_ffmpeg` (lib) due to previous error
zsh: exit 101   CARGO_INCREMENTAL=0 cargo r

The contents of libstdc++.a are as follows:

INPUT(-lc++_static -lc++abi)

Please try file /data/data/com.termux/files/usr/lib/libstdc++.a and ls -al /data/data/com.termux/files/usr/lib/libstdc++.a then put the command line output here. It looks like it's not an archive file.

❯ file /data/data/com.termux/files/usr/lib/libstdc++.a
/data/data/com.termux/files/usr/lib/libstdc++.a: ASCII text

❯ ls -al /data/data/com.termux/files/usr/lib/libstdc++.a
-rw------- 1 u0_a363 u0_a363 29 Nov 22 19:57 /data/data/com.termux/files/usr/lib/libstdc++.a

/data/data/com.termux/files/usr/lib/libstdc++.a: ASCII text

This shows that your libstdc++.a is a text file rather than a valid archive. There is something wrong with Termux 🤔

I googled a bit and found out that it's a linker script, which is why it's not a conventional .a archive. I am not sure about it all myself, since I'm not even that good with linkers, but searching up "linker script" I found an old GNU LD Manual that may have some answers.