CCExtractor / rusty_ffmpeg

FFI bindings for FFmpeg inner libraries.
https://crates.io/crates/rusty_ffmpeg
MIT License
175 stars 26 forks source link

[Bug] `libstdc++` error on Termux #101

Open alexmozaidze opened 11 months ago

alexmozaidze commented 11 months ago

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)
ldm0 commented 11 months ago

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.

alexmozaidze commented 11 months ago
❯ 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
ldm0 commented 11 months ago

/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 🤔

alexmozaidze commented 11 months ago

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.