Issues with compiling gst-plugins-bad with libaom support


first, congrats on moving ahead with this forum. it is more convenient than the mailing list.

I have compiled libaom on Pi (debian 11 bullseye) from src to get the latest optimization and compiled gst from src as well (1.22.6). it starts throwing issues like:

[573/867] Linking target ext/aom/
FAILED: ext/aom/ 
cc  -o ext/aom/ ext/aom/ ext/aom/ ext/aom/ ext/aom/ -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname, -Wl,-Bsymbolic-functions -Wl,-z,nodelete -mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -mtune=arm1176jzf-s -Wl,-rpath,/usr/local/lib/arm-linux-gnueabihf -Wl,-rpath-link,/usr/local/lib/arm-linux-gnueabihf /usr/local/lib/arm-linux-gnueabihf/ /usr/local/lib/arm-linux-gnueabihf/ /usr/local/lib/arm-linux-gnueabihf/ /usr/local/lib/arm-linux-gnueabihf/ /usr/local/lib/arm-linux-gnueabihf/ /usr/lib/arm-linux-gnueabihf/ /usr/lib/arm-linux-gnueabihf/ /usr/local/lib/arm-linux-gnueabihf/libaom.a -Wl,--end-group
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libaom.a(encodeframe_utils.c.o): in function `av1_set_ssim_rdmult':
encodeframe_utils.c:(.text+0xa78): undefined reference to `pow'
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libaom.a(encodeframe_utils.c.o): in function `av1_get_cb_rdmult':
encodeframe_utils.c:(.text+0xd18): undefined reference to `log'
/usr/bin/ld: encodeframe_utils.c:(.text+0xd3c): undefined reference to `log'
/usr/bin/ld: encodeframe_utils.c:(.text+0xd78): undefined reference to `exp'
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libaom.a(encodeframe_utils.c.o): in function `av1_get_hier_tpl_rdmult':
encodeframe_utils.c:(.text+0x1078): undefined reference to `log'
/usr/bin/ld: encodeframe_utils.c:(.text+0x10c4): undefined reference to `exp'
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libaom.a(encodeframe_utils.c.o): in function `av1_get_q_for_deltaq_objective':
/usr/bin/ld: disflow.c:(.text+0x718): undefined reference to `rint'
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libaom.a(disflow.c.o):disflow.c:(.text+0x738): more undefined references to `rint' follow
collect2: error: ld returned 1 exit status

any hint is appreciated

full logs:

That looks like a bug in libaom. It should list -lm in Libs.private so that it is pulled in when doing static linking.

OOC, why do you do build libaom as a static library instead of a shared one?

it seems static build is actually the default configuration:

I changed it to shared and recompiled it again just in case, but still had the same issue.

That should be reproducible with anything else linking to it (but not explicitly by itself against -lm) too then. Can you check that other software fails the same way if it just uses the information from the pkg-config file?

i have compiled ffmpeg 6.0 with --enable-libaom and it seems fine. also libavif seems ok as well.

i have also raised this to aom team (link) but it seems the -lm linking is correct.

i think I’m missing something in my build but I’m not expert to see it.

Ok, so libaom is actually including -lm in Libs.private in the pkg-config file but it’s not used by GStreamer here. Can you report that in Gitlab? That seems like a bug somewhere either in GStreamer’s build system, or in meson not correctly picking that up.

done, thank you

1 Like