xiph / opus

Modern audio compression for the internet.
https://opus-codec.org/
Other
2.31k stars 619 forks source link

Undefined reference to opus_select_arch #327

Open BKPepe opened 7 months ago

BKPepe commented 7 months ago

Hey guys,

Recently in OpenWrt master branch @krant updated opus to the latest version and wanted to use Meson in commit https://github.com/openwrt/packages/commit/6c3db5d603c3a9ed94ce4e15b556b6a0d1daf15f.

However, after some time and properly being tested, he found out that there are some issues with Meson for some targets in OpenWrt:

[135/168] Linking target src/libopus.so.0.10.0
FAILED: src/libopus.so.0.10.0 
arm-openwrt-linux-muslgnueabi-gcc  -o src/libopus.so.0.10.0 src/libopus.so.0.10.0.p/opus.c.o src/libopus.so.0.10.0.p/opus_decoder.c.o src/libopus.so.0.10.0.p/opus_encoder.c.o src/libopus.so.0.10.0.p/extensions.c.o src/libopus.so.0.10.0.p/opus_multistream.c.o src/libopus.so.0.10.0.p/opus_multistream_encoder.c.o src/libopus.so.0.10.0.p/opus_multistream_decoder.c.o src/libopus.so.0.10.0.p/repacketizer.c.o src/libopus.so.0.10.0.p/opus_projection_encoder.c.o src/libopus.so.0.10.0.p/opus_projection_decoder.c.o src/libopus.so.0.10.0.p/mapping_matrix.c.o src/libopus.so.0.10.0.p/analysis.c.o src/libopus.so.0.10.0.p/mlp.c.o src/libopus.so.0.10.0.p/mlp_data.c.o -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/lib -Wl,--as-needed -Wl,--no-undefined -fuse-ld=bfd -shared -fPIC -Wl,--start-group -Wl,-soname,libopus.so.0 -Wl,--whole-archive celt/libopus-celt.a silk/libopus-silk.a -Wl,--no-whole-archive -fuse-ld=bfd -znow -zrelro -lm -Wl,--end-group
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/opus_decoder.c.o: in function `opus_decoder_init':
opus_decoder.c:(.text+0x11c8): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/opus_decoder.c.o: in function `opus_dred_decoder_init':
opus_decoder.c:(.text+0x1ee0): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/opus_encoder.c.o: in function `opus_encoder_init':
opus_encoder.c:(.text+0x2174): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/opus_multistream_encoder.c.o: in function `opus_multistream_encoder_init_impl':
opus_multistream_encoder.c:(.text+0x224): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: src/libopus.so.0.10.0.p/analysis.c.o: in function `tonality_analysis_init':
analysis.c:(.text+0x236c): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: celt/libopus-celt.a.p/celt_decoder.c.o:celt_decoder.c:(.text+0x2db8): more undefined references to `opus_select_arch' follow
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: celt/libopus-celt.a.p/pitch.c.o: in function `pitch_search':
pitch.c:(.text+0xd60): undefined reference to `CELT_PITCH_XCORR_IMPL'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: celt/libopus-celt.a.p/celt_lpc.c.o: in function `_celt_autocorr':
celt_lpc.c:(.text+0xea0): undefined reference to `CELT_PITCH_XCORR_IMPL'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: silk/libopus-silk.a.p/init_decoder.c.o: in function `silk_reset_decoder':
init_decoder.c:(.text+0x24): undefined reference to `opus_select_arch'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: silk/libopus-silk.a.p/fixed_burg_modified_FIX.c.o: in function `silk_burg_modified_c':
burg_modified_FIX.c:(.text+0xc64): undefined reference to `CELT_PITCH_XCORR_IMPL'
/builder/shared-workdir/build/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-12.3.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/12.3.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld.bfd: silk/libopus-silk.a.p/fixed_pitch_analysis_core_FIX.c.o: in function `silk_pitch_analysis_core':
pitch_analysis_core_FIX.c:(.text+0xfc0): undefined reference to `CELT_PITCH_XCORR_IMPL'
collect2: error: ld returned 1 exit status

I am not sure why he could not reach you and discuss his issue with you guys, but maybe he is just shy, or he does not like me at all. Haha! 😆 😆 We could keep this in our repository, but I am afraid that you would not like it.

Could you please look at the issue we are dealing with? Otherwise, we will get back to using autotools as he proposed in https://github.com/openwrt/packages/pull/23727

jmvalin commented 7 months ago

I assume you're using the latest git (main)? Can you give mode details on the exact meson command you're using and provide the generated config.h? For the symbols to be missing, it means either 1) celt/arm/armcpu.c and celt/arm/arm_celt_map.c didn't get compiled, or 2) they were compiled but the defines caused the symbols not to be defined. Can you check which of those is the case? In general, anything with your build that would be different from a 32-bit RPi build? Regarding autotools, I'd say that if possible, it might actually be a better option since it's better tested than the other build systems. That being said, I still intend on fixing this meson issue.

BKPepe commented 7 months ago

@krant Kind reminder to look at this issue, which you reported to us in OpenWrt.